Skip to content

Commit

Permalink
robot:add pjdtest
Browse files Browse the repository at this point in the history
  • Loading branch information
YunhuiChen committed Sep 15, 2022
1 parent 8928694 commit 40f2aed
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
2 changes: 2 additions & 0 deletions robot/Resources/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@
md5_check = []
fs_md5check_thread = ""
fs_mount_thread = ""
fs_pjdtest_thread = ""
fs_use_curvebs = False
thrash_fs_mount = True
thrash_fs_mdtest = True
thrash_mount_host = "pubbeta2-nova48-3"
pjdtest_source_path = "/var/lib/jenkins/workspace/pjdfstest"
# chunkserver mount point
cs_0 = curve_workspace + "0"
cs_1 = curve_workspace + "1"
Expand Down
34 changes: 34 additions & 0 deletions robot/Resources/keywords/fs_fault_inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,3 +619,37 @@ def stop_cto_file_md5check():
assert result == config.md5_check[0],"cto md5 check fail,ont mount ponit is %s,other is %s"%(config.md5_check[0],result)
except:
raise

def start_pjdtest_cmd(pjd_path):
try:
test_dir = config.fs_mount_path
workspace = test_dir + pjd_path
test_client = config.fs_test_client[0]
ssh = shell_operator.create_ssh_connect(test_client, 1046, config.abnormal_user)
ori_cmd = "cd %s && sudo prove -r %s > result.txt"%(workspace,pjdtest_source_path)
rs = shell_operator.ssh_exec(ssh, ori_cmd)
logger.info("pjdtest result is %s"%rs[1])
assert rs[3] == 0,"pjdtest fail,result is %s"%rs[2]
ori_cmd = "cd %s && cat result.txt |grep 'Failed:'"%workspace
rs = shell_operator.ssh_exec(ssh, ori_cmd)
logger.debug("pjdtest result is %s"%rs[1])
return rs[1]
except:
raise

def start_pjdtest(pjdfs):
thread = mythread.runThread(start_pjdtest_cmd,pjdfs)
logger.debug("start pjdtest")
config.fs_pjdtest_thread = thread
thread.start()

def check_pjdtest_result():
try:
if config.fs_pjdtest_thread == []:
assert False," pjdtest not up"
t = config.fs_pjdtest_thread
assert t.exitcode == 0,"pjdtest fail"
result = t.get_result()
assert result == [],"pjdtest have some failure cases,%s"%result
except:
raise
10 changes: 10 additions & 0 deletions robot/curve_fs_robot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ ${vm_iops_limit} 8000
${chunk_num} 0

*** Test Cases ***
begin pjdtest
[Tags] P2 base interface pjdtest
${pjdfs} evaluate str("pjdtest")
mount test dir ${pjdfs}
start pjdtest ${pjdfs}

inject kill one mds
[Tags] P0 base first release failover
${num} evaluate int(1)
Expand Down Expand Up @@ -151,6 +157,10 @@ test ipmitool restart metaserver node
check fuse iops
[Teardown] wait fs cluster ok

test check pjdtest result
[Tags] P2 base interface pjdtest
check pjdtest result

test loop mount umount
[Tags] P0 base first release failover
sleep 30
Expand Down
21 changes: 21 additions & 0 deletions robot/curve_init.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*** Settings ***
Library Collections
#Library RequestsLibrary
Library Process
#Library SSHLibrary

Suite Setup init
Suite Teardown clean


*** Test Cases ***
inject cases
[Tags] P0 base init
log hello word

*** Keywords ***
init
log init cluster

clean
log clean

0 comments on commit 40f2aed

Please sign in to comment.