From 1f34af896f3a51a011ce7a024a7b38e539defec0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 7 May 2019 16:19:48 -0400 Subject: [PATCH 1/5] Add xcatprobe testcase --- xCAT-test/autotest/testcase/probe/xcatproble_list | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 xCAT-test/autotest/testcase/probe/xcatproble_list diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list new file mode 100644 index 000000000..f7752dda6 --- /dev/null +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -0,0 +1,7 @@ +start:xcatprobe_work +description:To test if xcatprobe list works. This case must run in xcat mn +label:mn_only,ci_test +cmd:xcatprobe -l +check:rc == 0 +check:output =~ Supported sub commands are: +end From 050c15f84134e796c865df249454ca0dbe596ec4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 9 May 2019 09:30:45 -0400 Subject: [PATCH 2/5] Check more of the output --- xCAT-test/autotest/testcase/probe/xcatproble_list | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list index f7752dda6..1d797da59 100644 --- a/xCAT-test/autotest/testcase/probe/xcatproble_list +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -2,6 +2,15 @@ start:xcatprobe_work description:To test if xcatprobe list works. This case must run in xcat mn label:mn_only,ci_test cmd:xcatprobe -l -check:rc == 0 -check:output =~ Supported sub commands are: +check:rc==0 +check:output=~Supported sub commands are: +check:output=~detect_dhcp +check:output=~osdeploy +check:output=~nodecheck +check:output=~xcatmn +check:output=~osimagecheck +check:output=~discovery +check:output=~image +check:output=~clusterstatus +check:output=~switch_macmap end From 6ea2ffcee185093485cca5a204df1814118fc307 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 9 May 2019 10:18:35 -0400 Subject: [PATCH 3/5] mend --- xCAT-test/autotest/testcase/probe/xcatproble_list | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list index 1d797da59..07a9cbabb 100644 --- a/xCAT-test/autotest/testcase/probe/xcatproble_list +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -2,7 +2,6 @@ start:xcatprobe_work description:To test if xcatprobe list works. This case must run in xcat mn label:mn_only,ci_test cmd:xcatprobe -l -check:rc==0 check:output=~Supported sub commands are: check:output=~detect_dhcp check:output=~osdeploy From 520651eef1b7a494563b7dffe04f9014b86a7029 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 13 May 2019 10:33:30 -0400 Subject: [PATCH 4/5] Verify xcatprobe -l output --- .../autotest/testcase/probe/xcatproble_list | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list index 07a9cbabb..214711885 100644 --- a/xCAT-test/autotest/testcase/probe/xcatproble_list +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -1,15 +1,13 @@ start:xcatprobe_work description:To test if xcatprobe list works. This case must run in xcat mn label:mn_only,ci_test +cmd:mkdir -p /tmp/xcatprobe_l cmd:xcatprobe -l +check:rc==0 check:output=~Supported sub commands are: -check:output=~detect_dhcp -check:output=~osdeploy -check:output=~nodecheck -check:output=~xcatmn -check:output=~osimagecheck -check:output=~discovery -check:output=~image -check:output=~clusterstatus -check:output=~switch_macmap +cmd:xcatprobe -l|grep -v "Supported sub commands are" |awk '/^[[:graph:]]/ {print $1}'|sort > /tmp/xcatprobe_l/subcmd_from_xcatprobe_l +cmd:ls -l /opt/xcat/probe/subcmds/ |awk '/^-/ {print $9}'|sort > /tmp/xcatprobe_l/subcmd_under_subcmds_dir +cmd:diff -y /tmp/xcatprobe_l/subcmd_from_xcatprobe_l /tmp/xcatprobe_l/subcmd_under_subcmds_dir +check:rc==0 +cmd:rm -rf /tmp/xcatprobe_l end From 236d6ac7a1b35c873fe73884a0a230e0d24e8c27 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 14 May 2019 12:11:21 -0400 Subject: [PATCH 5/5] Add xcatprobe to CI environment --- travis.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/travis.pl b/travis.pl index 3404908fb..abcf39047 100644 --- a/travis.pl +++ b/travis.pl @@ -382,11 +382,22 @@ sub install_xcat{ print "[install_xcat] $cmd....[Pass]\n"; } } + $cmd = "sudo apt-get install xcat-probe --allow-remove-essential --allow-unauthenticated"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[install_xcat] $cmd ....[Failed]\n"; + print Dumper \@output; + $ret = 1; + }else{ + print "[install_xcat] $cmd ....[Pass]:\n"; + } + if($ret){ $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; } + $check_result_str .= "> **INSTALL XCAT SUCCESSFUL**"; send_back_comment("$check_result_str"); }