From 3f03d53e8b71e854494c4191832d5c1a90a029aa Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 25 Apr 2017 16:51:24 -0400 Subject: [PATCH 01/33] Initialized more_options variable to avoid uninitialized error message --- xCAT-server/lib/xcat/plugins/nodestat.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index 94c2969f2..3dfb73b67 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -649,7 +649,10 @@ sub process_request_nmap { # get additional options from site table my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); - my $more_options = $nmap_options[0]; + my $more_options = ""; + if (defined($nmap_options[0])) { + $more_options = $nmap_options[0]; + } foreach my $ip6 (0, 1) { #first pass, ipv4, second pass ipv6 if ($ip6 and scalar(@ip6s)) { From af3a07a367b69bfa081bc861ce8af7701c496a47 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 10:57:48 -0400 Subject: [PATCH 02/33] Change the output of the rinv firm option to handle all possible return values from the API in a generic string. This allows for the code to support any string without additional effort to create custom messages --- xCAT-server/lib/xcat/plugins/openbmc.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 84d9226a6..a65b49f9f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -935,9 +935,17 @@ sub rinv_response { my %content = %{ ${ $response_info->{data} }{$key_url} }; if ($grep_string eq "firm") { + # This handles the data from the /xyz/openbmc_project/Software endpoint. + # + # Handle printing out all posssible Software values in a generic format: + # node: Software: () + # if (defined($content{Version}) and $content{Version}) { - my $firm_ver = "System Firmware Product Version: " . "$content{Version}"; - xCAT::SvrUtils::sendmsg("$firm_ver", $callback, $node); + # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. + my $purpose_value = (split(/\./, $content{Purpose}))[-1]; + my $activation_value = (split(/\./, $content{Activation}))[-1]; + my $software_str = "$purpose_value Software: $content{Version} (Activation=$activation_value)"; + xCAT::SvrUtils::sendmsg("$software_str", $callback, $node); next; } } From 6c6123ab84fe0029f1cbccda7a669df109e544e5 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 14:17:16 -0400 Subject: [PATCH 03/33] Fix spacing in sub rinv_response() --- xCAT-server/lib/xcat/plugins/openbmc.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index a65b49f9f..e820ba2f5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -922,10 +922,10 @@ sub rinv_response { my $grep_string; if ($node_info{$node}{cur_status} eq "RINV_FIRM_RESPONSE") { - $grep_string = "firm"; - } else { - $grep_string = $status_info{RINV_RESPONSE}{argv}; - } + $grep_string = "firm"; + } else { + $grep_string = $status_info{RINV_RESPONSE}{argv}; + } my $src; my $content_info; @@ -1000,13 +1000,13 @@ sub rinv_response { push (@sorted_output, $node . ": ". $content_info); #Save output in array } } - } - # If sorted array has any contents, sort it and print it - if (scalar @sorted_output > 0) { - @sorted_output = sort @sorted_output; #Sort all output - my $result = join "\n", @sorted_output; #Join into a single string for easier display - xCAT::SvrUtils::sendmsg("$result", $callback); - } + } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + @sorted_output = sort @sorted_output; #Sort all output + my $result = join "\n", @sorted_output; #Join into a single string for easier display + xCAT::SvrUtils::sendmsg("$result", $callback); + } if ($next_status{ $node_info{$node}{cur_status} }) { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; From 03b7e1fb6b9ab90b1ad5d1bc8a91c545d84ead30 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 15:46:49 -0400 Subject: [PATCH 04/33] Check if the item is present on the server, if not, there's no reason to print out the data. Fixed the sorting to be alpha, then numeric. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 29 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index e820ba2f5..70f8b857e 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -942,14 +942,27 @@ sub rinv_response { # if (defined($content{Version}) and $content{Version}) { # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. - my $purpose_value = (split(/\./, $content{Purpose}))[-1]; + my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; - my $software_str = "$purpose_value Software: $content{Version} (Activation=$activation_value)"; - xCAT::SvrUtils::sendmsg("$software_str", $callback, $node); + my $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; + xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); next; } } + if (! defined $content{Present}) { + # This should never happen, but if we find this, contact firmware team to fix... + xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); + next; + } + + # If the item is not found on the server, do not bother printing it out + if ($content{Present} eq 0) { next; } + + # + # Need to re-visit this code, commenting out for now... + # +=for comment if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); @@ -987,6 +1000,7 @@ sub rinv_response { xCAT::SvrUtils::sendmsg("$macaddress", $callback, $node); next; } +=cut if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { @@ -997,15 +1011,16 @@ sub rinv_response { foreach my $key (keys %content) { $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $node . ": ". $content_info); #Save output in array + push (@sorted_output, $content_info); #Save output in array } } } # If sorted array has any contents, sort it and print it if (scalar @sorted_output > 0) { - @sorted_output = sort @sorted_output; #Sort all output - my $result = join "\n", @sorted_output; #Join into a single string for easier display - xCAT::SvrUtils::sendmsg("$result", $callback); + # sort alpha, then numeric + my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort + grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; + xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); } if ($next_status{ $node_info{$node}{cur_status} }) { From 9a457fe2d70fd7cb66b79306ad663235ef2db9ff Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 21:27:15 -0400 Subject: [PATCH 05/33] For now, let's continue printing out all the values --- xCAT-server/lib/xcat/plugins/openbmc.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 70f8b857e..1cb9af5d3 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -956,9 +956,6 @@ sub rinv_response { next; } - # If the item is not found on the server, do not bother printing it out - if ($content{Present} eq 0) { next; } - # # Need to re-visit this code, commenting out for now... # From 33371667cb3482b64a15260d5926adbb66d7dd5e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:42:23 -0400 Subject: [PATCH 06/33] Remove options that are not supported for rinv --- .../admin-guides/references/man1/rinv.1.rst | 18 +++++++++--------- perl-xCAT/xCAT/Usage.pm | 6 +++--- xCAT-client/pods/man1/rinv.1.pod | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index df454d284..3cc89c839 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -28,18 +28,18 @@ BMC/MPA specific: \ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | dimm | bios | mparom | mac | all**\ } -OpenPOWER (using ipmi) server specific: -======================================= +OpenPOWER (IPMI) server specific: +================================= \ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ ] -OpenPOWER (using openbmc) server specific: -========================================== +OpenPOWER (OpenBMC) server specific: +==================================== -\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ ] +\ **rinv**\ \ *noderange*\ [\ **model | serial | mprom | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: @@ -195,25 +195,25 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **mprom**\ - Retrieves mprom firmware level + Retrieves mprom firmware level. \ **deviceid**\ - Retrieves device identification. Usually device, manufacturing and product ids. + Retrieves device identification. Usually device, manufacturing and product IDs. \ **uuid**\ - Retrieves the universally unique identifier + Retrieves the universally unique identifier. \ **guid**\ - Retrieves the global unique identifier + Retrieves the global unique identifier . diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 742f7a9a1..ff3e3ca69 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -97,10 +97,10 @@ my %usage = ( rinv [-h|--help|-v|--version] BMC specific: rinv [mprom|deviceid|uuid|guid|vpd|dimm|all] - OpenPOWER (using ipmi) server specific: + OpenPOWER (IPMI) server specific: rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all] - OpenPOWER (using openbmc) server specific: - rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|cpu|dimm|all] + OpenPOWER (OpenBMC) server specific: + rinv [model|serial|firm|cpu|dimm|all] MPA specific: rinv [firm|bios|diag|mprom|sprom|mparom|mac|mtm] PPC specific(with HMC): diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 3a5c92f29..b08b15279 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -10,13 +10,13 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] B I {B|B|B|B|B|B|B|B|B|B|B|B|B|B|B} -=head2 OpenPOWER (using ipmi) server specific: +=head2 OpenPOWER (IPMI) server specific: B I [B|B|B|B|B|B|B|B|B] -=head2 OpenPOWER (using openbmc) server specific: +=head2 OpenPOWER (OpenBMC) server specific: -B I [B|B|B|B|B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B] =head2 PPC (with HMC) specific: @@ -125,19 +125,19 @@ Diagnostics information of firmware. =item B -Retrieves mprom firmware level +Retrieves mprom firmware level. =item B -Retrieves device identification. Usually device, manufacturing and product ids. +Retrieves device identification. Usually device, manufacturing and product IDs. =item B -Retrieves the universally unique identifier +Retrieves the universally unique identifier. =item B -Retrieves the global unique identifier +Retrieves the global unique identifier . =item B From 09ae91a31ae4c4be5b89ca8657b94d5ad867af50 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:43:11 -0400 Subject: [PATCH 07/33] Generically support the options for OpenBMC and not look for specific fields to print --- xCAT-server/lib/xcat/plugins/openbmc.pm | 66 +++++-------------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 1cb9af5d3..adb21c58e 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -408,7 +408,7 @@ sub parse_args { } } elsif ($command eq "rinv") { $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) { + unless ($subcommand =~ /^model$|^serial$|^firm$|^cpu$|^dimm$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "getopenbmccons") { @@ -956,60 +956,20 @@ sub rinv_response { next; } - # - # Need to re-visit this code, commenting out for now... - # -=for comment - if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { - my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; - xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); - next if ($grep_string eq "model"); - } + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { + $src = "$1 $2"; + } else { + $src = basename $key_url; + } - if (($grep_string eq "vpd" or $grep_string eq "serial") and $key_url =~ /\/motherboard$/) { - my $serialnumber = "BOARD Serial Number: " . "$content{SerialNumber}"; - xCAT::SvrUtils::sendmsg("$serialnumber", $callback, $node); - next if ($grep_string eq "serial"); - } - - if (($grep_string eq "vpd" or $grep_string eq "mprom") and $key_url =~ /\/motherboard$/) { - xCAT::SvrUtils::sendmsg("No mprom information is available", $callback, $node); - next if ($grep_string eq "mprom"); - } - - if (($grep_string eq "vpd" or $grep_string eq "deviceid") and $key_url =~ /\/motherboard$/) { - xCAT::SvrUtils::sendmsg("No deviceid information is available", $callback, $node); - next if ($grep_string eq "deviceid"); - } - - if ($grep_string eq "uuid") { - xCAT::SvrUtils::sendmsg("No uuid information is available", $callback, $node); - last; - } - - if ($grep_string eq "guid") { - xCAT::SvrUtils::sendmsg("No guid information is available", $callback, $node); - last; - } - - if ($grep_string eq "mac" and $key_url =~ /\/ethernet/) { - my $macaddress = "MAC: " . $content{MACAddress}; - xCAT::SvrUtils::sendmsg("$macaddress", $callback, $node); - next; - } -=cut - - if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { - if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { - $src = "$1 $2"; - } else { - $src = basename $key_url; - } - - foreach my $key (keys %content) { - $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $content_info); #Save output in array + foreach my $key (keys %content) { + # If not all options is specified, check whether the key string contains + # the keyword option. If so, add it to the return data + if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + next; } + $content_info = uc ($src) . " " . $key . " : " . $content{$key}; + push (@sorted_output, $content_info); #Save output in array } } # If sorted array has any contents, sort it and print it From 85bcbea210dd884d1253d19a14c6766b834befb1 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:46:12 -0400 Subject: [PATCH 08/33] If no values are in the return array, print a message --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index adb21c58e..bd1b5e917 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -978,6 +978,8 @@ sub rinv_response { my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); + } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); } if ($next_status{ $node_info{$node}{cur_status} }) { From eb9487b0b9de4a42a2e9be4f1d97512d3471e4bb Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 14:24:51 -0400 Subject: [PATCH 09/33] Handle the firmware data using the same sorted output array and add in support for ExtendedVersion --- xCAT-server/lib/xcat/plugins/openbmc.pm | 58 +++++++++++++++---------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index bd1b5e917..276d5f470 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -941,35 +941,47 @@ sub rinv_response { # node: Software: () # if (defined($content{Version}) and $content{Version}) { - # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; - my $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; - xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); + # + # The space below between "SOFTWARE:" and $content{Version} is intentional + # to cause the sorting of this line before any additional info lines + # + $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; + push (@sorted_output, $content_info); + + if ($content{ExtendedVersion} ne "") { + # ExtendedVersion is going to be a comma separated list of additional software + my @versions = split(',', $content{ExtendedVersion}); + foreach my $ver (@versions) { + $content_info = "$purpose_value SOFTWARE: -- additional info: $ver"; + push (@sorted_output, $content_info); + } + } next; } - } - - if (! defined $content{Present}) { - # This should never happen, but if we find this, contact firmware team to fix... - xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); - next; - } - - if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { - $src = "$1 $2"; } else { - $src = basename $key_url; - } - - foreach my $key (keys %content) { - # If not all options is specified, check whether the key string contains - # the keyword option. If so, add it to the return data - if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { - next; + if (! defined $content{Present}) { + # This should never happen, but if we find this, contact firmware team to fix... + xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); + next; + } + + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { + $src = "$1 $2"; + } else { + $src = basename $key_url; + } + + foreach my $key (keys %content) { + # If not all options is specified, check whether the key string contains + # the keyword option. If so, add it to the return data + if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + next; + } + $content_info = uc ($src) . " " . $key . " : " . $content{$key}; + push (@sorted_output, $content_info); #Save output in array } - $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $content_info); #Save output in array } } # If sorted array has any contents, sort it and print it From 9340c2d2e4ae032027931b111b780ee1498eafc0 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 14:52:53 -0400 Subject: [PATCH 10/33] Fixes the test so that rinv options will check both key and key_url --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 276d5f470..45a9395e2 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -976,7 +976,7 @@ sub rinv_response { foreach my $key (keys %content) { # If not all options is specified, check whether the key string contains # the keyword option. If so, add it to the return data - if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + if ($grep_string ne "all" and ((lc($key) !~ m/$grep_string/i) and ($key_url !~ m/$grep_string/i)) ) { next; } $content_info = uc ($src) . " " . $key . " : " . $content{$key}; From e269d43bdc459c93ff6054184ec5e1cf212d02f7 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 8 Jun 2017 09:00:20 -0400 Subject: [PATCH 11/33] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rvitals/cases0 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 9e759843d..11c30bf70 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -110,6 +110,12 @@ check:rc==0 check:output=~12V Sense|AC Avg Power check:output=~Mem Cache Power|MEM Avg Power end +start:rvitals_altitude +description:Retrieves altitude readings. +Attribute: $$CN-The operation object of rvitals command +cmd:rvitals $$CN altitude +check:rc==0 +end start:rvitals_noderange_err description:using not defined node cmd:rvitals testnode From 0580e8d02aae3a4f7c261604af4e8e11ca5f79e2 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 9 Jun 2017 02:16:46 -0400 Subject: [PATCH 12/33] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rvitals/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 11c30bf70..996ee8dea 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -115,6 +115,7 @@ description:Retrieves altitude readings. Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN altitude check:rc==0 +check:output=~No attributes returned from the BMC end start:rvitals_noderange_err description:using not defined node From b888c12291dc1f7374cebbe7ad4fbb3db74bd99e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 9 Jun 2017 08:00:30 -0400 Subject: [PATCH 13/33] Remove mprom from the man page for rinv --- docs/source/guides/admin-guides/references/man1/rinv.1.rst | 2 +- xCAT-client/pods/man1/rinv.1.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 3cc89c839..0a1c944d5 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -39,7 +39,7 @@ OpenPOWER (OpenBMC) server specific: ==================================== -\ **rinv**\ \ *noderange*\ [\ **model | serial | mprom | firm | cpu | dimm | all**\ ] +\ **rinv**\ \ *noderange*\ [\ **model | serial | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index b08b15279..b680c0c7e 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -16,7 +16,7 @@ B I [B|B|B|B|B|B|B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B] =head2 PPC (with HMC) specific: From 56500ea6bf99ce3270bd3b904352eb1676ee89a5 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 12 Jun 2017 09:08:53 -0400 Subject: [PATCH 14/33] Failed to run dhcpd if tftpserver defined as in the network (#3223) table --- xCAT-server/lib/xcat/plugins/dhcp.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 301796b0a..291a9b370 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2457,10 +2457,11 @@ sub addnet { $tftp = $ent->{tftpserver}; } - else - { #presume myself to be it, dhcp no longer does this for us + if (!$tftp || ($tftp eq '')) + { $tftp = $myip; } + if ($ent and $ent->{gateway}) { $gateway = $ent->{gateway}; From 17d8358c3bd87477735baff7f12a50f3682905c8 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 12 Jun 2017 09:09:58 -0400 Subject: [PATCH 15/33] Support user defined ip address for cumulus switch (#3241) --- xCAT-server/share/xcat/scripts/configonie | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/scripts/configonie b/xCAT-server/share/xcat/scripts/configonie index 68a9ab1a0..f3e49a59b 100755 --- a/xCAT-server/share/xcat/scripts/configonie +++ b/xCAT-server/share/xcat/scripts/configonie @@ -125,11 +125,28 @@ sub config_ssh { my $cmd; my @config_switches; + my $nodetab = xCAT::Table->new('hosts'); + my $nodehash = $nodetab->getNodesAttribs(\@nodes,['ip','otherinterfaces']); + foreach my $switch (@nodes) { #remove old host key from /root/.ssh/known_hosts $cmd = `ssh-keygen -R $switch`; - my ($exp, $errstr) = cumulus_connect($switch, $userid, $password, $timeout); + my $static_ip = $nodehash->{$switch}->[0]->{ip}; + my $discover_ip = $nodehash->{$switch}->[0]->{otherinterfaces}; + my $ssh_ip; + + my $p = Net::Ping->new(); + if ($p->ping($static_ip)) { + $ssh_ip = $static_ip; + } elsif ($p->ping($discover_ip)) { + $ssh_ip = $discover_ip; + } else { + print "$switch is not reachable\n"; + next; + } + + my ($exp, $errstr) = cumulus_connect($ssh_ip, $userid, $password, $timeout); if (!defined $exp) { print ("connect failed $errstr\n"); next; @@ -142,6 +159,10 @@ sub config_ssh { ($ret, $err) = cumulus_exec($exp, "chmod 700 /root/.ssh"); ($ret, $err) = cumulus_exec($exp, "echo \"$rootkey\" >/root/.ssh/authorized_keys"); ($ret, $err) = cumulus_exec($exp, "chmod 644 /root/.ssh/authorized_keys"); + #config dhcp ip address to static + if ($ssh_ip eq $discover_ip) { + ($ret, $err) = cumulus_exec($exp, "ifconfig eth0 $static_ip"); + } $exp->hard_close(); push (@config_switches, $switch); From 9b0b05eb6ce3975522173391aec14d9433c4232a Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Tue, 13 Jun 2017 05:03:55 -0400 Subject: [PATCH 16/33] update for won't fix issue --- xCAT-test/autotest/testcase/confignics/cases0 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index b2b5b0af1..a730ff864 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -163,11 +163,11 @@ cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Eth check:rc==0 cmd:makehosts $$CN check:rc==0 -cmd:cat /etc/hosts -check:output=~aliases1-1 -check:output=~aliases1-2 -check:output=~aliases2-1 -check:output=~aliases2-2 +#cmd:cat /etc/hosts +#check:output=~aliases1-1 +#check:output=~aliases1-2 +#check:output=~aliases2-1 +#check:output=~aliases2-2 cmd:updatenode $$CN -P confignics check:rc==0 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi From 0f3411ae36b98bbf75321cd0a082a01c50673f5f Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 13 Jun 2017 11:21:13 -0400 Subject: [PATCH 17/33] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rvitals/cases0 | 31 +++------- .../autotest/testcase/rvitals/openbmctest.sh | 59 +++++++++++++++++++ 2 files changed, 68 insertions(+), 22 deletions(-) create mode 100755 xCAT-test/autotest/testcase/rvitals/openbmctest.sh diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 996ee8dea..4a40f6b5c 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -18,9 +18,8 @@ end start:rvitals_temp description:Retrieves temperatures Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN temp +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN temp check:rc==0 -check:output=~System Temperature|Ambient Temp|temperature end start:rvitals_disktemp @@ -46,17 +45,15 @@ end start:rvitals_voltage description:Retrieves power supply and VRM voltage readings Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN voltage +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN voltage check:rc==0 -check:output=~Frame Voltages|CPU VDD Volt|SysBrd end start:rvitals_power description:Retrieves power status Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN power +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN power check:rc==0 -check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) end start:rvitals_state @@ -79,12 +76,8 @@ end start:rvitals_all description:Retrieves all status Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN all +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN all check:rc==0 -check:output=~System Temperature|Ambient Temp -check:output=~Frame Voltages|CPU VDD Volt|SysBrd -check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) -check:output=~ System State:|System Event:|NMI State end start:rvitals_leds @@ -98,34 +91,28 @@ end start:rvitals_fanspeed description:Retrieves fan speeds. Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN fanspeed +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN fanspeed check:rc==0 -check:output=~Fan|Fan\s*\d:\s*\w+\s*RPM end start:rvitals_wattage description:Retrieves wattage readings. Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN wattage +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN wattage check:rc==0 -check:output=~12V Sense|AC Avg Power -check:output=~Mem Cache Power|MEM Avg Power end start:rvitals_altitude description:Retrieves altitude readings. Attribute: $$CN-The operation object of rvitals command -cmd:rvitals $$CN altitude +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN altitude check:rc==0 -check:output=~No attributes returned from the BMC end start:rvitals_noderange_err description:using not defined node -cmd:rvitals testnode +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals testnode check:rc!=0 -check:output=~Error end start:rvitals_errorcommand description:using wrong command -cmd: rvitals $$CN errorcommand +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN errorcommand check:rc!=0 -check:output=~Unrecognized rvitals arguments end diff --git a/xCAT-test/autotest/testcase/rvitals/openbmctest.sh b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh new file mode 100755 index 000000000..8584e79e4 --- /dev/null +++ b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +function test_openbmccommand() +{ +node_number=0; +number=0; +if [[ $1 ]]&&[[ $2 ]]&&[[ $3 ]];then + `$1 $2 $3 >/tmp/openbmccommand.test`; + if [[ $? -eq 0 ]];then + echo right command; + number=`awk 'END{print NR}' /tmp/openbmccommand.test` + echo number is $number + `cat /tmp/openbmccommand.test |awk -F : '{print $1}' > /tmp/openbmccommand.test1` + for i in `cat /tmp/openbmccommand.test1` + do + echo $i + if [[ $i == $2 ]];then + node_number=1; + else + echo no than more node checkeid + node_number=2; + fi + done + if [[ $node_number -eq 1 ]];then + `cat /tmp/openbmccommand.test |awk -F : '{print $2}'> /tmp/openbmccommand.test2` + if [[ $number -eq 1 ]]&&[[ `awk -F "" '{for(i=1;i<=NF;++i) if($i==":") ++sum}END{print sum}' /tmp/openbmccommand.test` -eq 1 ]];then + if [[ `cat /tmp/openbmccommand.test` =~ "No attributes returned from the BMC" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No mprom information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No deviceid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No uuid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No guid information is available" ]];then + echo "No attributes" + return 0; + else + return 1; + fi + else + if [[ `cat /tmp/openbmccommand.test2` =~ "No attributes returned from the BMC" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No mprom information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No deviceid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No uuid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No guid information is available" ]];then + echo "wrong return" + return 1; + else + echo "right return" + return 0 + fi + fi + else + if [[ $node_number -eq 2 ]];then + return 0; + fi + fi + else + return 1; + fi +else + return 1; +fi +} +test_openbmccommand $1 $2 $3 +if [[ $? -eq 0 ]];then + exit 0; +else + exit 1; +fi From d3a85b352d124e4fb04c2b74f57580b884189556 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 03:57:05 -0400 Subject: [PATCH 18/33] refine test cases to check hostname in sles12.2 statelite #2690 --- .../installation/reg_linux_statelite_installation_flat | 6 ++++++ .../reg_linux_statelite_installation_hierarchy_by_nfs | 3 +++ .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 3 +++ 3 files changed, 12 insertions(+) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 4b3b6849b..7cc906537 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -75,6 +75,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~compute/rootimg on / type nfs +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "echo "test"> /test.statelite" check:rc!=0 @@ -110,6 +113,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~rootfs on / type tmpfs +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:sleep 120 cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 076a14c2d..65ac3cf86 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -95,6 +95,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~compute/rootimg on / type nfs +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "echo "test"> /test.statelite" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index e9851d362..fd7d84f4e 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -89,6 +89,9 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~rootfs on / type +cmd:xdsh $$CN hostname +check:rc==0 +check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 From 4fcacba83893f98dab2fe934a8b73f59ea8b8078 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 14 Jun 2017 01:38:32 -0400 Subject: [PATCH 19/33] fix issue Couldn't find ID in the discinfo database #3254 --- perl-xCAT/xCAT/data/discinfo.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 75274be3e..c3432566a 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -11,8 +11,9 @@ require Exporter; @EXPORT = qw(); @EXPORT_OK = qw(distnames numdiscs); +use strict; -my %distnames = ( +our %distnames = ( "1480943823.812754" => "centos7.3", #x86_64 "1450147276.351714" => "centos7.2", #ppc64le "1449699925.561114" => "centos7.2", #x86_64 @@ -135,7 +136,7 @@ my %distnames = ( "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM "1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM ); -my %numdiscs = ( +our %numdiscs = ( "1156364963.862322" => 4, "1178480581.024704" => 3 ); From ae2f2a5bdc32348692d8cb9191c6fa6d0ae50d8b Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 03:22:52 -0400 Subject: [PATCH 20/33] modify rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases0 | 96 +++++++++++++++++++------ 1 file changed, 75 insertions(+), 21 deletions(-) diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index 5b61937df..d5aae55f0 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -4,14 +4,30 @@ #check:rc!=0 #check:output=~Usage #end +start:rinv_h +description:show help information for rinv +cmd:rinv -h +check:rc==0 +check:output=~Usage +check:output=~rinv +end +start:rinv_v +description:show version for Version +cmd:rinv -v +check:rc==0 +check:output=~Version +end + start:rinv_bus -arch:ppc +description:rinv list all buses for each I/O slot +Attribute: $$CN-The operation object of rinv command cmd:rinv $$CN bus check:rc==0 check:output=~I/O Bus Information end start:rinv_config -arch:ppc +description:Retrieves number of processors, speed, total memory, and DIMM locations. +Attribute: $$CN-The operation object of rinv command cmd:rinv $$CN config check:rc==0 check:output=~Machine Configuration Info @@ -19,38 +35,76 @@ check:output=~Number of Processors:\s*\d+ check:output=~Total Memory \(\w+\):\s*\d+ end start:rinv_serial -arch:ppc -cmd:rinv $$CN serial +description:Retrieves serial number. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN serial check:rc==0 -check:output=~Serial Number:\s*\w{7} end start:rinv_model -arch:ppc -cmd:rinv $$CN model +description:Retrieves serial number. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN model check:rc==0 -check:output=~Machine Type/Model\s*:\s*\w{4}-\w{3} end start:rinv_firm -arch:ppc -cmd:rinv $$CN firm +description:Retrieves firmware versions. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN firm check:rc==0 -check:output=~Release Level\s*:\s*\w+ end start:rinv_all -arch:ppc -cmd:rinv $$CN all +description:get serial,model +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN all +check:rc==0 +end +start:rinv_cpu +description:get cpu information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN cpu +check:rc==0 +end +start:rinv_dimm +description:get dimm information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN dimm +check:rc==0 +end +start:rinv_uuid +description:get uuid information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN uuid check:rc==0 -check:output=~I/O Bus Information -check:output=~Machine Configuration Info -check:output=~Number of Processors:\s*\d+ -check:output=~Total Memory \(\w+\):\s*\d+ -check:output=~Serial Number:\s*\w{7} -check:output=~Machine Type/Model\s*:\s*\w{4}-\w{3} -check:output=~Release Level\s*:\s*\w+ end start:rinv_noderange_err cmd:rinv testnode check:rc!=0 check:output=~Error end - +start:rinv_mixnode +cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi +check:rc==0 +cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ +check:rc==0 +cmd:chdef -p -t node -o $$CN groups="test" +check:rc==0 +cmd:rinv test all +check:rc==1 +check:output=~testnode: Error +check:output=~$$CN: SYSTEM +cmd:chdef -m -t node -o $$CN groups="test" +check:rc==0 +cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi +check:rc==0 +end +start:rinv_wrongbmcpasswd +cmd:lsdef -l $$CN -z >/tmp/testnode.stanza +check:rc==0 +cmd:chdef $$CN bmcpassword=test +check:rc==0 +cmd:rinv $$CN all +check:rc==1 +check:output=~$$CN: Error: Invalid username or password +cmd:cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza +check:rc==0 +end From d1a87e7b44dbfdcbbe4272c66bc1cd63580e1400 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 05:32:53 -0400 Subject: [PATCH 21/33] modify rinv testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases0 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index d5aae55f0..5cd9d942c 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -76,12 +76,21 @@ Attribute: $$CN-The operation object of rinv command cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN uuid check:rc==0 end +start:rinv_vpd +description:get vpd information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN vpd +check:rc==0 +end + start:rinv_noderange_err cmd:rinv testnode check:rc!=0 check:output=~Error end start:rinv_mixnode +description:get mixnode information,one is invalid node +Attribute: $$CN-The operation object of rinv command cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi check:rc==0 cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ @@ -98,6 +107,8 @@ cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stan check:rc==0 end start:rinv_wrongbmcpasswd +description:get right return if bmc's passwd wrong +Attribute: $$CN-The operation object of rinv command cmd:lsdef -l $$CN -z >/tmp/testnode.stanza check:rc==0 cmd:chdef $$CN bmcpassword=test From 4eeb0c1fef8b2cf3e8c8ae726997c1ca5dce9924 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 14 Jun 2017 05:33:34 -0400 Subject: [PATCH 22/33] modify rinv testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases1 | 70 ------------------------- 1 file changed, 70 deletions(-) delete mode 100644 xCAT-test/autotest/testcase/rinv/cases1 diff --git a/xCAT-test/autotest/testcase/rinv/cases1 b/xCAT-test/autotest/testcase/rinv/cases1 deleted file mode 100644 index 292e9b915..000000000 --- a/xCAT-test/autotest/testcase/rinv/cases1 +++ /dev/null @@ -1,70 +0,0 @@ -start:rinv_serial -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN serial -check:rc==0 -check:output=~NODE 1 Chassis Serial Number:\s*\w{7} -end - -start:rinv_model -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN model -check:rc==0 -check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} -end - -start:rinv_firm -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN firm -check:rc==0 -check:output=~BMC Firmware\s*:\s*\w+.\w+ -end - -start:rinv_deviceid -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN deviceid -check:rc==0 -check:output=~Device ID:\s*\w+ -check:output=~Product ID:\s*\w+ -check:output=~Manufacturer ID:\s*\w+ -end - - -start:rinv_vpd -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN vpd -check:rc==0 -check:output=~Manufacturer ID:\s*\w+ -check:output=~Device ID:\s*\w+ -check:output=~BMC Firmware:\s*\w+.\w+ -check:output=~NODE 1 Chassis Serial Number:\s*\w{7} -check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} -end - - -start:rinv_all -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN all -check:rc==0 -check:output=~BMC Firmware:\s*\w+.\w+ -check:output=~BMCCARD Board Part Number:\s*\w{7} -check:output=~UUID/GUID:\s*\w+-\w+-\w+-\w+-\w+ -check:output=~Product ID:\s*\d+ -check:output=~Manufacturer ID:\s*\d+ -check:output=~Device ID:\s*\d+ -check:output=~BMCCARD Board Serial Number:\s*\w+ -end - -start:rinv_noderange_err -hcp:ipmi -arch:ppc64le -cmd:rinv testnode -check:rc!=0 -check:output=~Error -end - From eeda12c26558430b88efde2e42dba8458c11ec8a Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 14 Jun 2017 23:17:11 -0400 Subject: [PATCH 23/33] fix autotest statelite case failure --- xCAT-test/autotest/testcase/installation/litefile_sles.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/installation/litefile_sles.csv b/xCAT-test/autotest/testcase/installation/litefile_sles.csv index b3ade0407..d4e7d90e7 100644 --- a/xCAT-test/autotest/testcase/installation/litefile_sles.csv +++ b/xCAT-test/autotest/testcase/installation/litefile_sles.csv @@ -4,6 +4,7 @@ "ALL","/etc/ntp.conf","tmpfs",, "ALL","/etc/ntp.conf.org","tmpfs",, "ALL","/etc/resolv.conf","tmpfs",, +"ALL","/etc/hostname","tmpfs",, "ALL","/etc/ssh/","tmpfs",, "ALL","/etc/sysconfig/","tmpfs",, "ALL","/etc/syslog-ng/","tmpfs",, From 0dce825785f062a15d634c73ea540c658f5fad23 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Jun 2017 02:32:32 -0400 Subject: [PATCH 24/33] Add testcases for simulator multiple --- .../autotest/testcase/simulator/change_ip.sh | 21 ------ .../testcase/simulator/clear_simulator | 20 +++++- .../testcase/simulator/config_simulator.sh | 58 +++++++++++++++ .../testcase/simulator/setup_simulator | 71 ++++++++++++++++++- 4 files changed, 147 insertions(+), 23 deletions(-) delete mode 100755 xCAT-test/autotest/testcase/simulator/change_ip.sh create mode 100755 xCAT-test/autotest/testcase/simulator/config_simulator.sh diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh deleted file mode 100755 index 59fb80b0a..000000000 --- a/xCAT-test/autotest/testcase/simulator/change_ip.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -flag=$1 -mnhn=$2 -cnhn=$3 - -if [ $flag = "-s" ]; then - cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` - echo $cnip > "/tmp/simulator" - mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` - chdef $cnhn bmc=$mnip -elif [ $flag = "-c" ]; then - cnip=`cat /tmp/simulator` - chdef $cnhn bmc=$cnip - process=`ps aux | grep "simulator" | grep "python" | awk -F ' ' '{print $2}'` - if [ $process ]; then - kill $process - fi - rm -rf "openbmc_simulator" -fi -exit $? diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 61e2207c9..1c3df64c9 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -1,5 +1,23 @@ start:clear_openbmc_simulator description:clear evironment -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -c $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_100 +description:clear evironment that simulate 100 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 100 +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_1000 +description:clear evironment that simulate 1000 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 1000 +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_5000 +description:clear evironment that simulate 5000 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 5000 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh new file mode 100755 index 000000000..6f9a1377f --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +flag=$1 +mnhn=$2 +cnhn=$3 +nodes=$4 + +mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` +if [ $nodes ]; then + nic=`ip -4 -o a | grep $mnip | awk -F ' ' '{print $2}'` + + if [ $nodes = "1000" ]; then + range=`echo $(echo 10.100.{1..10}.{1..100})` + elif [ $nodes = "5000" ]; then + range=`echo $(echo 10.100.{1..50}.{1..100})` + else + range=`echo $(echo 10.100.{1..10}.{1..10})` + fi +fi + +if [ $flag = "-s" ]; then + if [ $nodes ]; then + lsdef $cnhn -z > /tmp/$cnhn.stanza + rmdef $cnhn + + /root/openbmc_simulator/simulator -n $nic -r $range + + if [ $nodes = "1000" ]; then + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc + chdef simulator_test_[0-999] groups=$cnhn + elif [ $nodes = "5000" ]; then + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc + chdef simulator_test_[0-4999] groups=$cnhn + else + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/10)).((\$1)%10+1)|" bmcusername=root bmcpassword=0penBmc + chdef simulator_test_[0-99] groups=$cnhn + fi + else + cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` + echo $cnip > "/tmp/simulator" + mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` + chdef $cnhn bmc=$mnip + /root/openbmc_simulator/simulator + fi +elif [ $flag = "-c" ]; then + if [ $nodes ]; then + /root/openbmc_simulator/simulator -c -n $nic -r $range + rmdef $cnhn + cat /tmp/$cnhn.stanza | mkdef -z + else + /root/openbmc_simulator/simulator -c + cnip=`cat /tmp/simulator` + chdef $cnhn bmc=$cnip + fi + + rm -rf /root/openbmc_simulator +fi +exit $? diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index 6a4bb71f6..e69f8c562 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -19,6 +19,75 @@ cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git check:rc==0 cmd:/root/openbmc_simulator/simulator & check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -s $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_100 +description:install dependent packaages, setup and start 100 openbmc simulator +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 100 +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_1000 +description:install dependent packaages, setup and start 1000 openbmc simulator +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 1000 +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_5000 +description:install dependent packaages, setup and start 5000 openbmc simulator +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 5000 check:rc==0 end From 30b4929625c71d4186a681ec6da43f4748284157 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 15 Jun 2017 14:35:29 -0400 Subject: [PATCH 25/33] Fixes to rinstall/winstall man pages --- .../references/man8/makedns.8.rst | 2 +- .../references/man8/makeknownhosts.8.rst | 14 ++++--- .../references/man8/makenetworks.8.rst | 2 +- .../references/man8/makeroutes.8.rst | 2 +- .../references/man8/nodeset.8.rst | 4 +- .../references/man8/rinstall.8.rst | 23 ++++++----- .../references/man8/winstall.8.rst | 35 +++++++---------- .../references/man8/xcatconfig.8.rst | 12 +++--- .../references/man8/xcatsetup.8.rst | 2 +- xCAT-client/pods/man8/makedns.8.pod | 2 +- xCAT-client/pods/man8/makenetworks.8.pod | 2 +- xCAT-client/pods/man8/makeroutes.8.pod | 2 +- xCAT-client/pods/man8/nodeset.8.pod | 4 +- xCAT-client/pods/man8/rinstall.8.pod | 23 ++++++----- xCAT-client/pods/man8/winstall.8.pod | 38 +++++++++---------- xCAT-client/pods/man8/xcatconfig.8.pod | 12 +++--- xCAT-client/pods/man8/xcatsetup.8.pod | 2 +- xCAT-server/lib/xcat/plugins/rinstall.pm | 4 +- 18 files changed, 87 insertions(+), 98 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/makedns.8.rst b/docs/source/guides/admin-guides/references/man8/makedns.8.rst index 9b558dccf..a97c1401a 100644 --- a/docs/source/guides/admin-guides/references/man8/makedns.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makedns.8.rst @@ -43,7 +43,7 @@ The \ **forwarders**\ value should be set to the IP address of one or more name An xCAT \ **network**\ definition must be defined for each network used in the cluster. The \ **net**\ and \ **mask**\ attributes will be used by the \ **makedns**\ command. -A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definiton corresponding to the node or in the \ **site**\ definition. +A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definition corresponding to the node or in the \ **site**\ definition. Only entries in /etc/hosts or the hosts specified by \ **noderange**\ that have a corresponding xCAT network definition will be added to DNS. diff --git a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst index 495704d9c..fe31b65ad 100644 --- a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -d | -**\ **-remove**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -**\ **-remove | -d | -**\ **-delete**\ ] [\ **-V | -**\ **-verbose**\ ] \ **makeknownhosts**\ [\ **-h | -**\ **-help**\ ] @@ -53,12 +53,18 @@ OPTIONS -\ **-r| -d| -**\ **-remove**\ +\ **-d|-**\ **-delete**\ Only removes the entries for the nodes from the known_hosts file. +\ **-r|-**\ **-remove**\ + + Synonymous to \ **-d|-**\ **-delete**\ . + + + \ **-V|-**\ **-verbose**\ Verbose mode. @@ -97,10 +103,6 @@ EXAMPLES .. code-block:: perl - makeknownhosts node02 -r - - or - makeknownhosts node02 -d diff --git a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst index 4b0b7a11c..aa78cdc5b 100644 --- a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst @@ -35,7 +35,7 @@ The \ **makenetworks**\ command can be used to gather network information from Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the managment node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. You can use the "-d" option to display the network information without writing it to the database. diff --git a/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst b/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst index 9a0145393..1bb33dd5c 100644 --- a/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst @@ -35,7 +35,7 @@ DESCRIPTION *********** -The \ **makeroutes**\ command adds or deletes routes on the management node or any given nodes. The \ **noderange**\ specifies the nodes where the routes are to be added or removed. When the \ *noderange*\ is omitted, the action will be done on the management node. The \ **-r**\ option specifies the name of routes. The details of the routes are defined in the \ **routes**\ table which contians the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on \ **noderes.routenames**\ for the nodes or on \ **site.mnroutenames**\ for the management node will be used. +The \ **makeroutes**\ command adds or deletes routes on the management node or any given nodes. The \ **noderange**\ specifies the nodes where the routes are to be added or removed. When the \ *noderange*\ is omitted, the action will be done on the management node. The \ **-r**\ option specifies the name of routes. The details of the routes are defined in the \ **routes**\ table which contains the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on \ **noderes.routenames**\ for the nodes or on \ **site.mnroutenames**\ for the management node will be used. If you want the routes be automatically setup during node deployment, first put a list of route names to \ **noderes.routenames**\ and then add \ *setroute*\ script name to the \ **postscripts.postbootscripts**\ for the nodes. diff --git a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst index 23ec24e23..35edfcd45 100644 --- a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst +++ b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst @@ -53,7 +53,7 @@ Assume that /tftpboot is the root for tftpd (set in site(5)|site.5). \ **nodeset**\ is called by \ **rinstall**\ and \ **winstall**\ and is also called by the installation process remotely to set the boot state back to "boot". -A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. *************** @@ -114,7 +114,7 @@ A user can supply their own scripts to be run on the mn or on the service node ( \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. diff --git a/docs/source/guides/admin-guides/references/man8/rinstall.8.rst b/docs/source/guides/admin-guides/references/man8/rinstall.8.rst index 0e06cd9e6..f33d0144c 100644 --- a/docs/source/guides/admin-guides/references/man8/rinstall.8.rst +++ b/docs/source/guides/admin-guides/references/man8/rinstall.8.rst @@ -19,9 +19,9 @@ Name **************** -\ **rinstall**\ \ *noderange*\ \ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **rinstall**\ \ *noderange*\ [\ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ ] [\ **runimage=**\ \ *task*\ ] [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ \ *noderange*\ \ **osimage**\ =\ *imagename*\ | [\ **-O**\ ] \ *imagename*\ [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **rinstall**\ \ *noderange*\ [\ **osimage**\ =\ *imagename*\ | \ *imagename*\ ] [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] \ **rinstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] @@ -31,11 +31,11 @@ Name ******************* -\ **rinstall**\ is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +\ **rinstall**\ is a convenience command to begin OS provision on a noderange. -If \ **osimage**\ =\ *imagename*\ | \ **-O**\ \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. +If \ **osimage**\ =\ *imagename*\ | \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. -If -c is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes , see winstall(8)|winstall.8. +If \ **-c**\ is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes, see winstall(8)|winstall.8. *************** @@ -50,9 +50,9 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **osimage | osimage=**\ \ *imagename*\ |\ **-O**\ \ *imagename*\ +\ *imagename*\ | \ **osimage=**\ \ *imagename*\ - Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. + Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the \ *imagename*\ is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. @@ -62,7 +62,7 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **runimage**\ =\ *task*\ +\ **runimage=**\ \ *task*\ If you would like to run a task after deployment, you can define that task with this attribute. @@ -70,14 +70,13 @@ If -c is specified, it will then run rcons on the node. This is allowed only if \ **runcmd=bmcsetup**\ - This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC - for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. + This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. @@ -100,7 +99,7 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **-V | -**\ **-Verbose**\ +\ **-V | -**\ **-verbose**\ Verbose output. diff --git a/docs/source/guides/admin-guides/references/man8/winstall.8.rst b/docs/source/guides/admin-guides/references/man8/winstall.8.rst index cfe21170c..e939b5554 100644 --- a/docs/source/guides/admin-guides/references/man8/winstall.8.rst +++ b/docs/source/guides/admin-guides/references/man8/winstall.8.rst @@ -19,11 +19,11 @@ Name **************** -\ **rinstall**\ \ *noderange*\ \ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **winstall**\ \ *noderange*\ [\ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ ] [\ **runimage=**\ \ *task*\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ \ *noderange*\ \ **osimage**\ =\ *imagename*\ | [\ **-O**\ ] \ *imagename*\ [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **winstall**\ \ *noderange*\ [\ **osimage**\ =\ *imagename*\ | \ *imagename*\ ] [\ **-**\ **-ignorekernelchk**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] +\ **winstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] ******************* @@ -31,11 +31,11 @@ Name ******************* -\ **winstall**\ is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +\ **winstall**\ is a convenience command to begin OS provision on a noderange. -If \ **osimage**\ =\ *imagename*\ | \ **-O**\ \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. +If \ **osimage**\ =\ *imagename*\ | \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. -It will then run wcons on the nodes. +It will then run \ **wcons**\ on the noderange. *************** @@ -50,9 +50,9 @@ It will then run wcons on the nodes. -\ **osimage | osimage=**\ \ *imagename*\ |\ **-O**\ \ *imagename*\ +\ *imagename*\ | \ **osimage=**\ \ *imagename*\ - Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. + Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the \ *imagename*\ is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. @@ -62,7 +62,7 @@ It will then run wcons on the nodes. -\ **runimage**\ =\ *task*\ +\ **runimage=**\ \ *task*\ If you would like to run a task after deployment, you can define that task with this attribute. @@ -70,14 +70,13 @@ It will then run wcons on the nodes. \ **runcmd=bmcsetup**\ - This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC - for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. + This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. @@ -100,18 +99,12 @@ It will then run wcons on the nodes. -\ **-V | -**\ **-Verbose**\ +\ **-V | -**\ **-verbose**\ Verbose output. -\ **-c | -**\ **-console**\ - - Requests that rinstall runs rcons once the provision starts. This will only work if there is only one node in the noderange. See winstall(8)|winstall.8 for starting consoles on multiple nodes. - - - **************** \ **Examples**\ @@ -119,7 +112,7 @@ It will then run wcons on the nodes. -1. Provison nodes 1 through 20, using their current configuration. +1. Provision nodes 1 through 20, using their current configuration. .. code-block:: perl @@ -134,7 +127,7 @@ It will then run wcons on the nodes. .. code-block:: perl - winstall node1-node20 -O rhels6.4-ppc64-netboot-compute + winstall node1-node20 osimage=rhels6.4-ppc64-netboot-compute diff --git a/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst b/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst index 75d981311..85a089555 100644 --- a/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst +++ b/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst @@ -66,19 +66,19 @@ OPTIONS \ **-i|-**\ **-initialinstall**\ - The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the datebase, export directories, start syslog and other daemons as needed after the initial install of xCAT. + The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the database, export directories, start syslog and other daemons as needed after the initial install of xCAT. \ **-u|-**\ **-updateinstall**\ - The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, datebase, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. + The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, database, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. \ **-k|-**\ **-sshkeys**\ - This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distribute to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. + This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distributed to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. rspconfig will need to be run to distribute the key to the MM and HMCs. Any device, we need to ssh from the MN to the device will also have to be updated with the new ssh keys. @@ -91,7 +91,7 @@ OPTIONS \ **-c|-**\ **-credentials**\ - This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistribed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stop and started. + This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistributed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stopped and started. @@ -103,9 +103,9 @@ OPTIONS \ **-f|-**\ **-force**\ - The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinititialize the site table. This option should be used, if keys or credentials become corrupt or lost. + The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinitialize the site table. This option should be used, if keys or credentials become corrupt or lost. Additional action must be taken after using the force options. ssh keys must be redistributed to the nodes, site table attributes might need to be restored, makeconservercf needs to be rerun to pick up the new credentials and conserver stopped and started, rspconfig needs to be rerun to distribute the new keys to the MM and the HMCs. - A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. + A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. Redistribute credentials and ssh keys to the service nodes and ssh keys to the nodes by using the updatenode -k command. diff --git a/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst b/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst index 494551577..355cc6cb6 100644 --- a/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst +++ b/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst @@ -124,7 +124,7 @@ Configuration File The \ **config file**\ is organized in stanza format and supports the keywords in the sample file below. Comment lines -begin with "#". Stanzas can be ommitted if you do not want to define that type of object. +begin with "#". Stanzas can be omitted if you do not want to define that type of object. The only hostname formats supported are those shown in this sample file, although you can change the base text and the numbers. For example, hmc1-hmc3 could be changed to hwmgmt01-hwmgmt12. The hostnames specified must sort correctly. I.e. use node01-node80, instead of node1-node80. diff --git a/xCAT-client/pods/man8/makedns.8.pod b/xCAT-client/pods/man8/makedns.8.pod index e74603548..8366b8c8e 100644 --- a/xCAT-client/pods/man8/makedns.8.pod +++ b/xCAT-client/pods/man8/makedns.8.pod @@ -24,7 +24,7 @@ The B value should be set to the IP address of one or more nameserve An xCAT B definition must be defined for each network used in the cluster. The B and B attributes will be used by the B command. -A network B and B values must be provided either in the B definiton corresponding to the node or in the B definition. +A network B and B values must be provided either in the B definition corresponding to the node or in the B definition. Only entries in /etc/hosts or the hosts specified by B that have a corresponding xCAT network definition will be added to DNS. diff --git a/xCAT-client/pods/man8/makenetworks.8.pod b/xCAT-client/pods/man8/makenetworks.8.pod index 963fdde9f..771ff4eeb 100644 --- a/xCAT-client/pods/man8/makenetworks.8.pod +++ b/xCAT-client/pods/man8/makenetworks.8.pod @@ -16,7 +16,7 @@ The B command can be used to gather network information from an xC Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the managment node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. You can use the "-d" option to display the network information without writing it to the database. diff --git a/xCAT-client/pods/man8/makeroutes.8.pod b/xCAT-client/pods/man8/makeroutes.8.pod index b20e161e0..77b315ec4 100644 --- a/xCAT-client/pods/man8/makeroutes.8.pod +++ b/xCAT-client/pods/man8/makeroutes.8.pod @@ -16,7 +16,7 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 DESCRIPTION -The B command adds or deletes routes on the management node or any given nodes. The B specifies the nodes where the routes are to be added or removed. When the I is omitted, the action will be done on the management node. The B<-r> option specifies the name of routes. The details of the routes are defined in the B table which contians the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on B for the nodes or on B for the management node will be used. +The B command adds or deletes routes on the management node or any given nodes. The B specifies the nodes where the routes are to be added or removed. When the I is omitted, the action will be done on the management node. The B<-r> option specifies the name of routes. The details of the routes are defined in the B table which contains the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on B for the nodes or on B for the management node will be used. If you want the routes be automatically setup during node deployment, first put a list of route names to B and then add I script name to the B for the nodes. diff --git a/xCAT-client/pods/man8/nodeset.8.pod b/xCAT-client/pods/man8/nodeset.8.pod index bc8e2fb46..15618d46d 100644 --- a/xCAT-client/pods/man8/nodeset.8.pod +++ b/xCAT-client/pods/man8/nodeset.8.pod @@ -34,7 +34,7 @@ B only sets the next boot state, but does not reboot. B is called by B and B and is also called by the installation process remotely to set the boot state back to "boot". -A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 B @@ -77,7 +77,7 @@ for basic remote access. This causes the IP, netmask, gateway, username, and pa =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B diff --git a/xCAT-client/pods/man8/rinstall.8.pod b/xCAT-client/pods/man8/rinstall.8.pod index f7060e929..6675b0ca3 100644 --- a/xCAT-client/pods/man8/rinstall.8.pod +++ b/xCAT-client/pods/man8/rinstall.8.pod @@ -4,19 +4,19 @@ B - Begin OS provision on a noderange =head1 B -B I B | B | B [B<-c>|B<--console>] [B<-V>|B<--verbose>] +B I [B | B | B] [BI] [B<-c>|B<--console>] [B<-V>|B<--verbose>] -B I B=I | [B<-O>] I [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] +B I [B=I | I] [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 B -B is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +B is a convenience command to begin OS provision on a noderange. -If B=I | B<-O> I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. +If B=I | I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. -If -c is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes , see L. +If B<-c> is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes, see L. =head1 B @@ -26,26 +26,25 @@ If -c is specified, it will then run rcons on the node. This is allowed only if Instruct network boot loader to be skipped, generally meaning boot to hard disk -=item B|BI|B<-O>I +=item I | BI -Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the is omitted, the os image name will be obtained from I for the node. +Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the I is omitted, the os image name will be obtained from I for the node. =item B<--ignorekernelchk> Skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. That means all drivers from osimage.driverupdatesrc will be injected to initrd for the specific target kernel. -=item B=I +=item BI If you would like to run a task after deployment, you can define that task with this attribute. =item B -This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC -for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. +This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B<-h>|B<--help> @@ -60,7 +59,7 @@ Display version. For BMC-based servers, to specify the next boot mode to be "UEFI Mode". -=item B<-V>|B<--Verbose> +=item B<-V>|B<--verbose> Verbose output. diff --git a/xCAT-client/pods/man8/winstall.8.pod b/xCAT-client/pods/man8/winstall.8.pod index e8f25bb3c..acc377761 100644 --- a/xCAT-client/pods/man8/winstall.8.pod +++ b/xCAT-client/pods/man8/winstall.8.pod @@ -4,19 +4,19 @@ B - Begin OS provision on a noderange =head1 B -B I B | B | B [B<-c>|B<--console>] [B<-V>|B<--verbose>] +B I [B | B | B] [BI] [B<-V>|B<--verbose>] -B I B=I | [B<-O>] I [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] +B I [B=I | I] [B<--ignorekernelchk>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] -B [B<-h>|B<--help>|B<-v>|B<--version>] +B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 B -B is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +B is a convenience command to begin OS provision on a noderange. -If B=I | B<-O> I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. - -It will then run wcons on the nodes. +If B=I | I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. + +It will then run B on the noderange. =head1 B @@ -26,26 +26,25 @@ It will then run wcons on the nodes. Instruct network boot loader to be skipped, generally meaning boot to hard disk -=item B|BI|B<-O>I +=item I | BI -Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the is omitted, the os image name will be obtained from I for the node. +Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the I is omitted, the os image name will be obtained from I for the node. =item B<--ignorekernelchk> Skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. That means all drivers from osimage.driverupdatesrc will be injected to initrd for the specific target kernel. -=item B=I +=item BI If you would like to run a task after deployment, you can define that task with this attribute. =item B -This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC -for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. +This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B<-h>|B<--help> @@ -60,31 +59,28 @@ Display version. For BMC-based servers, to specify the next boot mode to be "UEFI Mode". -=item B<-V>|B<--Verbose> +=item B<-V>|B<--verbose> Verbose output. -=item B<-c>|B<--console> - -Requests that rinstall runs rcons once the provision starts. This will only work if there is only one node in the noderange. See L for starting consoles on multiple nodes. - =back + =head1 B =over 2 =item 1. -Provison nodes 1 through 20, using their current configuration. +Provision nodes 1 through 20, using their current configuration. winstall node1-node20 =item 2. Provision nodes 1 through 20 with the osimage rhels6.4-ppc64-netboot-compute. - winstall node1-node20 -O rhels6.4-ppc64-netboot-compute + winstall node1-node20 osimage=rhels6.4-ppc64-netboot-compute -=back +=back =head1 B B diff --git a/xCAT-client/pods/man8/xcatconfig.8.pod b/xCAT-client/pods/man8/xcatconfig.8.pod index 7d7e73be7..3ad208093 100644 --- a/xCAT-client/pods/man8/xcatconfig.8.pod +++ b/xCAT-client/pods/man8/xcatconfig.8.pod @@ -38,15 +38,15 @@ Displays verbose messages. =item B<-i|--initialinstall> -The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the datebase, export directories, start syslog and other daemons as needed after the initial install of xCAT. +The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the database, export directories, start syslog and other daemons as needed after the initial install of xCAT. =item B<-u|--updateinstall> -The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, datebase, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. +The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, database, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. =item B<-k|--sshkeys> -This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distribute to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. +This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distributed to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. rspconfig will need to be run to distribute the key to the MM and HMCs. Any device, we need to ssh from the MN to the device will also have to be updated with the new ssh keys. =item B<-s|--sshnodehostkeys> @@ -55,7 +55,7 @@ This option will remove and regenerate the node host ssh keys. It should only b =item B<-c|--credentials> -This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistribed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stop and started. +This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistributed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stopped and started. =item B<-d|--database> @@ -63,9 +63,9 @@ This option will reinitialize the basic xCAT database table setup. It will not =item B<-f|--force> -The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinititialize the site table. This option should be used, if keys or credentials become corrupt or lost. +The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinitialize the site table. This option should be used, if keys or credentials become corrupt or lost. Additional action must be taken after using the force options. ssh keys must be redistributed to the nodes, site table attributes might need to be restored, makeconservercf needs to be rerun to pick up the new credentials and conserver stopped and started, rspconfig needs to be rerun to distribute the new keys to the MM and the HMCs. -A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. +A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. Redistribute credentials and ssh keys to the service nodes and ssh keys to the nodes by using the updatenode -k command. =item B<-m|--mgtnode> diff --git a/xCAT-client/pods/man8/xcatsetup.8.pod b/xCAT-client/pods/man8/xcatsetup.8.pod index 7ee96dd95..bea98a54c 100644 --- a/xCAT-client/pods/man8/xcatsetup.8.pod +++ b/xCAT-client/pods/man8/xcatsetup.8.pod @@ -85,7 +85,7 @@ The B command has only been implemented and tested for system p serve =head2 Configuration File The B is organized in stanza format and supports the keywords in the sample file below. Comment lines -begin with "#". Stanzas can be ommitted if you do not want to define that type of object. +begin with "#". Stanzas can be omitted if you do not want to define that type of object. The only hostname formats supported are those shown in this sample file, although you can change the base text and the numbers. For example, hmc1-hmc3 could be changed to hwmgmt01-hwmgmt12. The hostnames specified must sort correctly. I.e. use node01-node80, instead of node1-node80. diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 906746b33..421b4d71e 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -622,8 +622,8 @@ sub usage { my $callback = shift; my $rsp = {}; $rsp->{data}->[0] = "Usage:"; - $rsp->{data}->[1] = " $command boot | shell | runcmd=bmcsetup [-c|--console] [-u|--uefimode] [-V|--verbose]"; - $rsp->{data}->[2] = " $command osimage= | -O [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]"; + $rsp->{data}->[1] = " $command [boot | shell | runcmd=bmcsetup] [runimage=] [-c|--console] [-u|--uefimode] [-V|--verbose]"; + $rsp->{data}->[2] = " $command [osimage= | ] [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]"; $rsp->{data}->[3] = " $command [-h|--help|-v|--version]"; xCAT::MsgUtils->message("I", $rsp, $callback); } From a246b048c57c95f3a5725c55afbc42166f2c9d58 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Jun 2017 21:23:53 -0400 Subject: [PATCH 26/33] modified depending on comments --- .../testcase/simulator/clear_simulator | 6 +- .../testcase/simulator/config_simulator.sh | 42 ++++++---- .../testcase/simulator/setup_simulator | 76 +------------------ 3 files changed, 33 insertions(+), 91 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 1c3df64c9..03c442fd9 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -6,18 +6,18 @@ end start:clear_openbmc_simulator_multiple_100 description:clear evironment that simulate 100 OpenBMCs -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 100 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 100 check:rc==0 end start:clear_openbmc_simulator_multiple_1000 description:clear evironment that simulate 1000 OpenBMCs -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 1000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 1000 check:rc==0 end start:clear_openbmc_simulator_multiple_5000 description:clear evironment that simulate 5000 OpenBMCs -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN 5000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 5000 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh index 6f9a1377f..715d4cfd0 100755 --- a/xCAT-test/autotest/testcase/simulator/config_simulator.sh +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -1,9 +1,11 @@ #!/bin/bash -flag=$1 -mnhn=$2 -cnhn=$3 -nodes=$4 +flag=$1 # -s:setup simulator -c:clear simulator env +mnhn=$2 # MN hostname +cnhn=$3 # CN hostname +username=$4 # bmcusername +password=$5 # bmcpassword +nodes=$6 # number of IPs want to config mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` if [ $nodes ]; then @@ -14,27 +16,37 @@ if [ $nodes ]; then elif [ $nodes = "5000" ]; then range=`echo $(echo 10.100.{1..50}.{1..100})` else - range=`echo $(echo 10.100.{1..10}.{1..10})` + range=`echo $(echo 10.100.1.{1..100})` fi fi if [ $flag = "-s" ]; then + os=`cat /etc/*release*` + if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + echo "Install git Failed" + exit 1 + fi + elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + echo "Install git Failed" + exit 1 + fi + fi + + cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git + if [ $nodes ]; then lsdef $cnhn -z > /tmp/$cnhn.stanza rmdef $cnhn /root/openbmc_simulator/simulator -n $nic -r $range - if [ $nodes = "1000" ]; then - chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc - chdef simulator_test_[0-999] groups=$cnhn - elif [ $nodes = "5000" ]; then - chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=root bmcpassword=0penBmc - chdef simulator_test_[0-4999] groups=$cnhn - else - chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/10)).((\$1)%10+1)|" bmcusername=root bmcpassword=0penBmc - chdef simulator_test_[0-99] groups=$cnhn - fi + node_end=$[nodes-1] + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=$username bmcpassword=$password + chdef simulator_test_[0-$node_end] groups=$cnhn # use CN hostname as group, so when run command against CN will rpower against all nodes added here else cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` echo $cnip > "/tmp/simulator" diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index e69f8c562..8ab412829 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -1,93 +1,23 @@ start:setup_openbmc_simulator description:install dependent packaages, setup and start openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/root/openbmc_simulator/simulator & -check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN check:rc==0 end start:setup_openbmc_simulator_multiple_100 description:install dependent packaages, setup and start 100 openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 100 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 100 check:rc==0 end start:setup_openbmc_simulator_multiple_1000 description:install dependent packaages, setup and start 1000 openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 1000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 1000 check:rc==0 end start:setup_openbmc_simulator_multiple_5000 description:install dependent packaages, setup and start 5000 openbmc simulator -cmd:#!/bin/bash -os=`cat /etc/*release*` -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git -y - if [ $? != 0 ]; then - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git -y - if [ $? != 0 ]; then - exit 1 - fi -fi -exit 0 -check:rc==0 -cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git -check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN 5000 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 5000 check:rc==0 end From dbc0613d82dec25636c4463045f0c22378d112a7 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 15 Jun 2017 21:32:22 -0400 Subject: [PATCH 27/33] refine rpower cases to add more information in the cases. Fix bug 3270 --- xCAT-test/autotest/testcase/rpower/cases0 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index ee6974eac..c8ab300c9 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -1,4 +1,6 @@ start:rpower_off +description:This case is to test off option could remote power off nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done check:ouptut=~Running|on @@ -10,6 +12,8 @@ check:output=~Not Activated|off end start:rpower_stat +description:This case is to test stat option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 5 ];then break;fi done cmd:rpower $$CN stat @@ -29,6 +33,8 @@ check:output=~Not Activated|off end start:rpower_boot +description:This case is to test boot option could power on the nodes if nodes in off state. Or could hard reset the nodes if they are on. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -41,7 +47,8 @@ check:output=~Running|on end start:rpower_status -description:checkout rpower node status could get node's stauts +description:This case is to test status option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN status|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN status @@ -54,7 +61,8 @@ check:output=~Running|on end start:rpower_state -description:checkout rpower node status could get node's stauts +description:This case is to test state option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN state|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN state @@ -67,6 +75,8 @@ check:output=~Running|on end start:rpower_on +description:This case is to test on option could remote power on nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -79,6 +89,8 @@ check:output=~Running|on end start:rpower_reset +description:This case is to test reset option could hard reset nodes when nodes are in on state. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat @@ -91,18 +103,24 @@ check:output=~Running|on end start:rpower_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN check:rc!=0 check:output=~Unsupported|Usage end start:rpower_noderange_nodeps +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN --nodeps check:rc!=0 check:output=~Unsupported|Usage end start:rpower_err_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute:N/A cmd:rpower testnode stat check:rc!=0 check:output=~Error From 201cbf15f7d3e7cbaeccd79b6584a095307d2b0c Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 16 Jun 2017 01:48:56 -0400 Subject: [PATCH 28/33] modify rinv and rvitals testcase for issue:3184 --- xCAT-test/autotest/testcase/rinv/cases0 | 1 - xCAT-test/autotest/testcase/rvitals/openbmctest.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index 5cd9d942c..466b95bf2 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -99,7 +99,6 @@ cmd:chdef -p -t node -o $$CN groups="test" check:rc==0 cmd:rinv test all check:rc==1 -check:output=~testnode: Error check:output=~$$CN: SYSTEM cmd:chdef -m -t node -o $$CN groups="test" check:rc==0 diff --git a/xCAT-test/autotest/testcase/rvitals/openbmctest.sh b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh index 8584e79e4..c28e9fbfd 100755 --- a/xCAT-test/autotest/testcase/rvitals/openbmctest.sh +++ b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh @@ -17,7 +17,7 @@ if [[ $1 ]]&&[[ $2 ]]&&[[ $3 ]];then if [[ $i == $2 ]];then node_number=1; else - echo no than more node checkeid + echo no than more node checked node_number=2; fi done From a8ee4aaee8b59d03072f1d36c7d625255f112b19 Mon Sep 17 00:00:00 2001 From: XuWei Date: Fri, 16 Jun 2017 01:30:02 -0400 Subject: [PATCH 29/33] modified depending on comments --- .../testcase/simulator/config_simulator.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh index 715d4cfd0..80860227a 100755 --- a/xCAT-test/autotest/testcase/simulator/config_simulator.sh +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -7,17 +7,21 @@ username=$4 # bmcusername password=$5 # bmcpassword nodes=$6 # number of IPs want to config +if [ $nodes -gt 10000 ]; then + echo "Unsupported number of nodes: $nodes" + exit 1 +fi + mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` if [ $nodes ]; then nic=`ip -4 -o a | grep $mnip | awk -F ' ' '{print $2}'` - if [ $nodes = "1000" ]; then - range=`echo $(echo 10.100.{1..10}.{1..100})` - elif [ $nodes = "5000" ]; then - range=`echo $(echo 10.100.{1..50}.{1..100})` - else - range=`echo $(echo 10.100.1.{1..100})` + ((a=$nodes/100)) + ((b=$nodes%100)) + if [ $b -eq 0 ]; then + b=100 fi + range=`for((i=1;i<=$a;i++)); do for((m=1;m<=$b;m++)); do echo -n "10.100.$i.$m ";done; done` fi if [ $flag = "-s" ]; then From 5331626d9a6dc87bdbc6b1f8b2abb4f5c6959392 Mon Sep 17 00:00:00 2001 From: chenglch Date: Fri, 16 Jun 2017 16:51:05 +0800 Subject: [PATCH 30/33] Upgrade conserver to 8.2.1 version (#3252) This patch change the `sslauthority` to `sslcacertificatefile` to support the latest version of conserver. It also add scripts to update the `conserver.cf` and $HOME/.consolerc to make sure migration works correctly. implement: #3239 --- perl-xCAT/xCAT/Utils.pm | 63 +++++++++++++++++++++++ xCAT-client/bin/rcons | 20 +++++-- xCAT-server/lib/xcat/plugins/conserver.pm | 11 +++- xCAT-server/sbin/xcatconfig | 46 +++++++++++++++++ 4 files changed, 136 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 06b08ae68..1dde56d16 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -579,6 +579,69 @@ sub Version return $version; } +#------------------------------------------------------------------------------- + +=head3 get_conserver_version + Returns: + consever version number like 8.1.16, undef if error happens + Globals: + none + Error: + none + Example: + $version=xCAT::Utils->get_conserver_version(); + Comments: + none +=cut + +#------------------------------------------------------------------------------- +sub get_conserver_version +{ + my $cmd = "/usr/sbin/conserver -V"; + # output format: + # conserver: conserver.com version 8.2.1 + # conserver: default access type `r' + my @out = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0 || @out < 1) { + return undef; + } + my @parts = split(' ',$out[0]); + if (@parts < 4) { + return undef; + } + my @count = $parts[3] =~ /\./g; + if (@count < 2) { + return undef; + } + return $parts[3]; +} + +#------------------------------------------------------------------------------- + +=head3 calc_conserver_version + Arguments: + version in string format + Returns: + version number + Globals: + none + Error: + none + Example: + $version=xCAT::Utils->calc_conserver_version("8.2.1"); + Comments: + none +=cut + +#------------------------------------------------------------------------------- +sub calc_conserver_version +{ + my $ver_str = shift; + my @vers = split(/\./, $ver_str); + return ord($vers[2]) + ord($vers[1]) * 10000 + ord($vers[0]) * 100000000; +} + + #------------------------------------------------------------------------------- =head3 make_node_list_file diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index 2fa148d6a..65d8d8000 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -127,12 +127,22 @@ elif [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then #NOTE: IPv6 is not good with the below if going by IP, needs more sophisticated #parsing CONSERVER=`echo $CONSERVER|cut -d: -f 1` - + CONSOLE_VER=`console -V | awk '/conserver.com version/ {print $4}'` #Detect console support of SSL, only fixup consolerc if encryption is detected if ! console -h 2>&1 | grep "encryption not compiled" > /dev/null; then # generate .consolerc if it does not exist or is empty if [ ! -s $HOME/.consolerc ]; then - cat > $HOME/.consolerc << EOF + if [ "$CONSOLE_VER" != "8.1.16" ]; then + cat > $HOME/.consolerc << EOF +config * { + port 782; + sslenabled yes; + sslcacertificatefile $HOME/.xcat/ca.pem; + sslcredentials $HOME/.xcat/client-cred.pem; +} +EOF + else + cat > $HOME/.consolerc << EOF config * { port 782; sslenabled yes; @@ -140,6 +150,7 @@ config * { sslcredentials $HOME/.xcat/client-cred.pem; } EOF + fi fi else # ssl is not enabled, comment out the ssl settings in .consolerc @@ -147,7 +158,10 @@ EOF sed -i 's/\Wssl/#ssl/1' $HOME/.consolerc fi fi - + # for migration, upgrade conserver + if [ "$CONSOLE_VER" != "8.1.16" ]; then + sed -i 's/sslauthority/sslcacertificatefile/1' $HOME/.consolerc + fi exec console $FORCE -M $CONSERVER $1 else if [[ "$FORCE" == "-s" ]]; then diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 24336d186..11c3f9b90 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -207,7 +207,16 @@ sub docfheaders { { push @newheaders, "config * {\n"; push @newheaders, " sslrequired yes;\n"; - push @newheaders, " sslauthority /etc/xcat/cert/ca.pem;\n"; + my $version = xCAT::Utils::get_conserver_version(); + if (!$version) { + xCAT::SvrUtils::sendmsg([ 1, "Failed to get conserver version" ], $cb); + return; + } + if (xCAT::Utils::calc_conserver_version($version) < xCAT::Utils::calc_conserver_version("8.1.19")) { + push @newheaders, " sslauthority /etc/xcat/cert/ca.pem;\n"; + } else { + push @newheaders, " sslcacertificatefile /etc/xcat/cert/ca.pem;\n"; + } push @newheaders, " sslcredentials /etc/xcat/cert/server-cred.pem;\n"; push @newheaders, "}\n"; } diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 4327ff09d..51a3f1469 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -464,6 +464,10 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL || $::genCredentials) } +if ($::UPDATEINSTALL) { + upgrade_conserver(); +} + # more config needed after xcatd start if ($::INITIALINSTALL || $::FORCE) { @@ -2338,3 +2342,45 @@ sub startnamedonboot } } } + +#----------------------------------------------------------------------------- + +=head3 upgrade_conserver + + Update conserver configuration files while upgrading xcat + +=cut + +#----------------------------------------------------------------------------- +sub upgrade_conserver +{ + my $version = xCAT::Utils::get_conserver_version(); + if (!$version) { + return; + } + if (xCAT::Utils::calc_conserver_version($version) < xCAT::Utils::calc_conserver_version("8.1.19")) { + return; + } + my $cmd = "/bin/cat /etc/conserver.cf | grep sslauthority"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + return; + } + $cmd = "sed -i 's/sslauthority/sslcacertificatefile/1' /etc/conserver.cf"; + xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) { + return; + } + #restart conserver daemon + if (xCAT::Utils->isAIX()) { + $cmd = "stopsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "startsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + } else { + $cmd = "/etc/init.d/conserver stop"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "/etc/init.d/conserver start"; + xCAT::Utils->runcmd($cmd, 0); + } +} From 9de8c1aad1819c41c1e5344224bfe71665bdf031 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 16 Jun 2017 10:49:29 -0400 Subject: [PATCH 31/33] For serial and model options, only return the system level information --- xCAT-server/lib/xcat/plugins/openbmc.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 45a9395e2..906751c1f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -967,6 +967,13 @@ sub rinv_response { next; } + # SPECIAL CASE: If 'serial' or 'model' is specified, only return the system level information + if ($grep_string eq "serial" or $grep_string eq "model") { + if ($key_url ne "$openbmc_project_url/inventory/system") { + next; + } + } + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { $src = "$1 $2"; } else { From 7beacaa631a3e6efa7af960194f9652bb3c68f68 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 16 Jun 2017 11:04:10 -0400 Subject: [PATCH 32/33] With mid June/2017 firmware, model number is moved from PartNumber -> Model --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index f78cbb687..9fe214b77 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1074,8 +1074,8 @@ sub bmcdiscovery_openbmc{ my $serial; if (defined($response->{data})) { - if (defined($response->{data}->{PartNumber}) and defined($response->{data}->{SerialNumber})) { - $mtm = $response->{data}->{PartNumber}; + if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { + $mtm = $response->{data}->{Model}; $serial = $response->{data}->{SerialNumber}; } else { xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); From 0a3104a981aaac7e0896dc89f4ad7e1471a02e87 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 16 Jun 2017 15:21:27 -0400 Subject: [PATCH 33/33] check community string in the switches table --- xCAT-server/share/xcat/scripts/configBNT | 27 +++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configBNT b/xCAT-server/share/xcat/scripts/configBNT index 3b31b975b..c58c1c1f9 100755 --- a/xCAT-server/share/xcat/scripts/configBNT +++ b/xCAT-server/share/xcat/scripts/configBNT @@ -72,6 +72,12 @@ my $switchhash; my $passwdtab; my @passwd_ent; +#set community string for switch +my $community = "public"; +my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); +my $tmp = $snmpcs[0]; +if (defined($tmp)) { $community = $tmp } + if ($::SWITCH) { my @filternodes = xCAT::NodeRange::noderange( $::SWITCH ); if (nodesmissed) { @@ -80,7 +86,7 @@ if ($::SWITCH) { } # check switch attributes $switchestab = xCAT::Table->new('switches'); - $switchhash = $switchestab->getNodesAttribs(\@filternodes,['switchtype','sshusername','sshpassword','protocol']); + $switchhash = $switchestab->getNodesAttribs(\@filternodes,['switchtype','sshusername','sshpassword','protocol','password','snmpversion']); # get switch username and password from passwd $passwdtab = xCAT::Table->new('passwd'); @@ -98,6 +104,9 @@ if ($::SWITCH) { $switchhash->{$fsw}->[0]->{sshpassword} = $passwd_ent[0]->{password}; } } + if (!defined($switchhash->{$fsw}->[0]->{password})) { + $switchhash->{$fsw}->[0]->{password} = $community; + } push @nodes, $fsw; } else { xCAT::MsgUtils->message("E","The $fsw is not BNT switch, will not config"); @@ -117,12 +126,6 @@ if ($::SWITCH) { my $mactab = xCAT::Table->new("mac"); my $machash = $mactab->getNodesAttribs(\@nodes,['mac']); -#set community string for switch -my $community = "public"; -my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); -my $tmp = $snmpcs[0]; -if (defined($tmp)) { $community = $tmp } - my $switches = join(",",@nodes); my $cmd; my $vlan; @@ -330,12 +333,20 @@ sub config_snmp { my $username; my $passwd; my $protocol; + my $snmppass; + my $snmpversion; my $login_cmd; $username = $switchhash->{$switch}->[0]->{sshusername}; $passwd = $switchhash->{$switch}->[0]->{sshpassword}; $protocol = $switchhash->{$switch}->[0]->{protocol}; + if ($switchhash->{$switch}->[0]->{snmpversion} =~ /3/) { + $snmppass=$community; + } else { + $snmppass = $switchhash->{$switch}->[0]->{password}; + } + if ($protocol =~ /telnet/) { $login_cmd = "telnet $switch\r"; } else { @@ -343,7 +354,7 @@ sub config_snmp { } #get hostname on the switch in case hostname is different - my $ccmd = "snmpwalk -Os -v1 -c $community $switch 1.3.6.1.2.1.1.5"; + my $ccmd = "snmpwalk -Os -v1 -c $snmppass $switch 1.3.6.1.2.1.1.5"; my $result = xCAT::Utils->runcmd($ccmd, 0); my ($desc,$switchhost) = split /: /, $result; if (!$switchhost) {