From 6e9825f0d1b78422a21d434b964813c313b31af4 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 3 Aug 2017 16:41:37 +0800 Subject: [PATCH] 1, test case for nodeset -V to show server info 2, allow xcattest get 'var' type config from environment variable when no config file specified. For example, when given 'XCATTEST_CN=fake1', xcattest will set $$CN=fake1 --- xCAT-test/autotest/testcase/nodeset/cases0 | 4 ++++ xCAT-test/xcattest | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 84546a788..4d549447b 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -3,7 +3,11 @@ os:Linux cmd:nodeset $$CN stat check:rc==0 check:output=~$$CN:\s+[discover|boot|reboot|install|netboot|shell|standby] +cmd:nodeset $$CN stat -V +check:rc==0 +check:output=~$$CN:\s+\[\w+\]:\s+[discover|boot|reboot|install|netboot|shell|standby] end + start:nodeset_noderange os:Linux cmd:nodeset $$CN test diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index be197d0d9..f7e1f7450 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -220,6 +220,13 @@ if (defined($configfile)) { } } else { $setup_env_by_config_file = 0; + # Leverage environment variable to used in test case + foreach (keys %ENV) { + if (/^XCATTEST_/) { + my @envname=split("_",$_,2); + $config{var}{$envname[-1]} = $ENV{$_}; + } + } } if ($restore) {