From 77103b2736c76defc9f5580b662e62d5e8a0ded3 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Tue, 26 May 2020 18:38:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=91=BD=E4=BB=A4=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=AF=94=E5=AF=B9=E5=8C=85=E5=90=AB=E5=92=8C=E4=B8=8D?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E4=B8=A4=E7=B1=BB=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97=EF=BC=9ASystemCommandReturnCompare?= =?UTF-8?q?=20=E5=8F=82=E6=95=B0=E8=AF=B4=E6=98=8E=EF=BC=9A=E8=A6=81?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E7=9A=84=E7=B3=BB=E7=BB=9F=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=20=20=20=20=E5=91=BD=E4=BB=A4=E8=BF=94=E5=9B=9E=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E8=A6=81=E5=8C=85=E5=90=AB=E7=9A=84=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=88=97=E8=A1=A8=20=20=20=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C=E4=B8=8D=E8=83=BD=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E7=9A=84=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 02-Keyword/tsg_adc/SystemCommand.robot | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/02-Keyword/tsg_adc/SystemCommand.robot b/02-Keyword/tsg_adc/SystemCommand.robot index 289df21..091f38e 100644 --- a/02-Keyword/tsg_adc/SystemCommand.robot +++ b/02-Keyword/tsg_adc/SystemCommand.robot @@ -37,3 +37,27 @@ SystemCommand ${rescode} Set Variable 200 log ${rescode} [Return] ${rescode} + + +SystemCommandReturnCompare + #执行命令并比对命令返回结果 需要执行的系统命令 命令返回结果要包含的字符串列表 命令返回结果不能包含的字符串列表 + [Arguments] ${commandstr} ${stringlist} ${stringlistnotin} + log toSystemCommand_SystemCommandTest + ${commandreturn} OperatingSystem.Run ${commandstr} + Append To File ${path}/write_file.txt ${commandstr} + Append To File ${path}/write_file.txt %%%%%%%%%%%%%%newbat + Append To File ${path}/write_file.txt ${commandreturn} + #${commandreturn} Set Variable abcdeConnection was reset + ${listlenth}= Get Length ${stringlist} + FOR ${var} IN RANGE ${listlenth} + log ${var} + Should Contain ${commandreturn} ${stringlist}[${var}] + END + ${listnotin}= Get Length ${stringlistnotin} + FOR ${varn} IN RANGE ${listnotin} + log ${varn} + Should Not Contain ${commandreturn} ${stringlistnotin}[${varn}] + END + ${rescode} Set Variable 200 + log ${rescode} + [Return] ${rescode}