diff options
| author | dongxiaoyan <[email protected]> | 2020-04-01 12:42:05 +0800 |
|---|---|---|
| committer | dongxiaoyan <[email protected]> | 2020-04-01 12:42:05 +0800 |
| commit | acc676857bd85512f344a8d06aa1ae8846e7c0db (patch) | |
| tree | f2a7e19139d7f763e699ae10a997184c168fed76 /02-Keyword/tsg_adc | |
Diffstat (limited to '02-Keyword/tsg_adc')
| -rw-r--r-- | 02-Keyword/tsg_adc/FileOperation.robot | 25 | ||||
| -rw-r--r-- | 02-Keyword/tsg_adc/SystemCommand.robot | 35 |
2 files changed, 60 insertions, 0 deletions
diff --git a/02-Keyword/tsg_adc/FileOperation.robot b/02-Keyword/tsg_adc/FileOperation.robot new file mode 100644 index 0000000..bbf23cb --- /dev/null +++ b/02-Keyword/tsg_adc/FileOperation.robot @@ -0,0 +1,25 @@ +*** Settings *** +Library String +Library json +Library OperatingSystem +Library RequestsLibrary +Library Selenium2Library +Library Collections +Library FileLibrary +Resource ../../02-Keyword/tsg_bfapi/Common.robot +Resource ../../03-Variable/BifangApiVariable.txt + + +*** Keywords *** +insert_policyId_to_file + [Arguments] ${key} ${policyId} ${objectids} + ${dict} Create Dictionary policyId=${policyId} objectId=${objectids} + ${json} json.Dumps ${dict} + Alter Dict ${path}/03-Variable/AllFlowCaseVariable.txt ${key} ${json} + +insert_time_to_file + [Arguments] ${key} ${starttime} ${endtime} + ${value} json.Loads ${${key}} + ${dict} Create Dictionary policyId=${value}[policyId] objectId=${value}[objectId] starttime=${starttime} endtime=${endtime} + ${json} json.Dumps ${dict} + Alter Dict ${path}/03-Variable/AllFlowCaseVariable.txt ${key} ${json} diff --git a/02-Keyword/tsg_adc/SystemCommand.robot b/02-Keyword/tsg_adc/SystemCommand.robot new file mode 100644 index 0000000..78a4744 --- /dev/null +++ b/02-Keyword/tsg_adc/SystemCommand.robot @@ -0,0 +1,35 @@ +*** Settings *** +Library OperatingSystem +Library Selenium2Library +Library RequestsLibrary +Library Collections + +*** Keywords *** +SystemCommands + [Arguments] ${commandstr} ${stringlist} + log toSystemCommand_SystemCommandTest + ${commandreturn} OperatingSystem.Run ${commandstr} + ${listlenth}= Get Length ${stringlist} + FOR ${var} IN RANGE ${listlenth} + #log ${var} + Should Contain ${commandreturn} ${stringlist}[${var}] + END + ${rescode} Set Variable 200 + log ${rescode} + [Return] ${rescode} + +SystemCommand + [Arguments] ${commandstr} @{stringlist} + log dxytest${commandstr} + ${commandreturn} OperatingSystem.Run ${commandstr} + #nslookup -d www.jd.com + log ${commandreturn} + FOR ${var} IN @{stringlist} + log dxytest + log ${var} + Should Contain ${commandreturn} ${var} + END + #Should Contain ${commandreturn} ${qatype} + ${rescode} Set Variable 200 + log ${rescode} + [Return] ${rescode} |
