diff --git a/docs/source/advanced/pdu/pdu.rst b/docs/source/advanced/pdu/pdu.rst index 781a7dbc9..a8566b5f8 100644 --- a/docs/source/advanced/pdu/pdu.rst +++ b/docs/source/advanced/pdu/pdu.rst @@ -63,6 +63,12 @@ The following commands are supported against a compute node: cn01: f5pdu3 outlet 6 is on cn01: f5pdu3 outlet 7 is on + * Power cycling the PDU outlets on a compute node: :: + + # rpower cn01 pdureset + cn01: f5pdu3 outlet 6 is reset + cn01: f5pdu3 outlet 7 is reset + The following commands are supported against a PDU: * Check the status of the full PDU: :: @@ -98,7 +104,7 @@ The following commands are supported against a PDU: f5pdu3: outlet 12 is off * Power on the full PDU: :: - + # rpower f5pdu3 on f5pdu3: outlet 1 is on f5pdu3: outlet 2 is on @@ -112,6 +118,22 @@ The following commands are supported against a PDU: f5pdu3: outlet 10 is on f5pdu3: outlet 11 is on f5pdu3: outlet 12 is on + + * Power reset the full PDU: :: + + # rpower f5pdu3 reset + f5pdu3: outlet 1 is reset + f5pdu3: outlet 2 is reset + f5pdu3: outlet 3 is reset + f5pdu3: outlet 4 is reset + f5pdu3: outlet 5 is reset + f5pdu3: outlet 6 is reset + f5pdu3: outlet 7 is reset + f5pdu3: outlet 8 is reset + f5pdu3: outlet 9 is reset + f5pdu3: outlet 10 is reset + f5pdu3: outlet 11 is reset + f5pdu3: outlet 12 is reset **Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower on`` to power on the compute node after the BMC boots. diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index ca436bd30..b344f75d6 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -29,7 +29,7 @@ BMC (using IPMI) specific: \ **rpower**\ \ *noderange*\ [\ **on | off | softoff | reset | boot | stat | state | status | wake | suspend**\ [\ **-w**\ \ *timeout*\ ] [\ **-o**\ ] [\ **-r**\ ]] -\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat**\ ] +\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ] OpenBMC specific: @@ -115,7 +115,7 @@ pdu specific: ============= -\ **rpower**\ \ *noderange*\ [\ **stat | off | on**\ ] +\ **rpower**\ \ *noderange*\ [\ **stat | off | on | reset**\ ] diff --git a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst index 51f71f74d..6132f8048 100644 --- a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst @@ -264,7 +264,7 @@ running commands, are terminated (SIGTERM). xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the install image. No other xdsh flags, environment variables apply with this input. A noderange is not accepted. Only runs on the local host, - normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that xdsh hangs. + normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that \ **xdsh**\ hangs. @@ -381,8 +381,8 @@ running commands, are terminated (SIGTERM). displays an error and terminates execution for the remote targets that failed to respond. If \ *timeout*\ is not specified, \ **xdsh**\ waits indefinitely to continue processing output from - all remote targets. The exception is the -K flag which defaults - to 10 seconds. + all remote targets. The exception is the \ **-K**\ flag which defaults + to 10 seconds. @@ -512,22 +512,28 @@ running commands, are terminated (SIGTERM). If \ **DSH_REMOTE_PASSWORD**\ is set to the password of the userid (usually root) that will ssh to the node, then when - you use the -K flag, you will not be prompted for a password. + you use the \ **-K**\ flag, you will not be prompted for a password. \ **DSH_SYNTAX**\ Specifies the shell syntax to use on remote targets; \ **ksh**\ or - \ **csh**\ . If not specified, the \ **ksh**\ syntax is assumed. This + \ **csh**\ . If not specified, the \ **ksh**\ syntax is assumed. This variable is overridden by the \ **-S**\ flag. \ **DSH_TIMEOUT**\ - Specifies the time, in seconds, to wait for output from - each remote target. This variable is overridden by the \ **-t**\ flag. + Specifies the time, in seconds, to wait for output from + each remote target. This variable is overridden by the \ **-t**\ flag. + + + +\ **DSH_VERIFY**\ + + Verifies each target before executing any remote commands on the target. If a target is not responding, execution of remote commands for the target is canceled. This variable is overridden by the \ **-v**\ flag. @@ -537,10 +543,10 @@ running commands, are terminated (SIGTERM). ********************************** -To provide backward compatibility for scripts written using dsh in +To provide backward compatibility for scripts written using \ **dsh**\ in AIX and CSM, a tool has been provided \ **groupfiles4dsh**\ , which will build node group files from the -xCAT database that can be used by dsh. See \ **man groupfiles4dsh**\ . +xCAT database that can be used by \ **dsh**\ . See \ **man groupfiles4dsh**\ . **************** @@ -566,7 +572,7 @@ userdefined. ******************* -The dsh command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. +The \ **xdsh**\ command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. **************** @@ -662,7 +668,7 @@ on the service node fedora9 diskless image, enter: To define the QLogic IB switch as a node and to set up the SSH keys for IB switch \ **qswitch**\ with device configuration file - \ **/var/opt/xcat/IBSwitch/Qlogic/config**\ and user name \ **username**\ , Enter + \ **/var/opt/xcat/IBSwitch/Qlogic/config**\ and user name \ **username**\ , enter .. code-block:: perl @@ -674,7 +680,7 @@ on the service node fedora9 diskless image, enter: -10. To define the Management Node in the database so you can use xdsh, Enter +10. To define the Management Node in the database so you can use \ **xdsh**\ , enter .. code-block:: perl @@ -685,7 +691,7 @@ on the service node fedora9 diskless image, enter: 11. To define the Mellanox switch as a node and run a command to show the ssh keys. -\ **mswitch**\ with and user name \ **username**\ , Enter +\ **mswitch**\ with and user name \ **username**\ , enter .. code-block:: perl @@ -723,7 +729,7 @@ on the service node fedora9 diskless image, enter: 13. - To run xdsh with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: + To run \ **xdsh**\ with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man5/nodehm.5.rst b/docs/source/guides/admin-guides/references/man5/nodehm.5.rst index e3978e25e..ef568e90f 100644 --- a/docs/source/guides/admin-guides/references/man5/nodehm.5.rst +++ b/docs/source/guides/admin-guides/references/man5/nodehm.5.rst @@ -50,7 +50,7 @@ nodehm Attributes: \ **mgt**\ - The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details. + The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details. diff --git a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst new file mode 100644 index 000000000..7e006120c --- /dev/null +++ b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst @@ -0,0 +1,82 @@ + +######### +openbmc.5 +######### + +.. highlight:: perl + + +**** +NAME +**** + + +\ **openbmc**\ - a table in the xCAT database. + + +******** +SYNOPSIS +******** + + +\ **openbmc Attributes:**\ \ *node*\ , \ *bmc*\ , \ *username*\ , \ *password*\ , \ *comments*\ , \ *disable*\ + + +*********** +DESCRIPTION +*********** + + +Setting for nodes that are controlled by an on-board OpenBmc. + + +******************* +openbmc Attributes: +******************* + + + +\ **node**\ + + The node name or group name. + + + +\ **bmc**\ + + The hostname of the BMC adapter. + + + +\ **username**\ + + The BMC userid. + + + +\ **password**\ + + The BMC password. + + + +\ **comments**\ + + Any user-written notes. + + + +\ **disable**\ + + Set to 'yes' or '1' to comment out this row. + + + + +******** +SEE ALSO +******** + + +\ **nodels(1)**\ , \ **chtab(8)**\ , \ **tabdump(8)**\ , \ **tabedit(8)**\ + diff --git a/docs/source/guides/admin-guides/references/man5/passwd.5.rst b/docs/source/guides/admin-guides/references/man5/passwd.5.rst index 3438aa4b6..4123a9258 100644 --- a/docs/source/guides/admin-guides/references/man5/passwd.5.rst +++ b/docs/source/guides/admin-guides/references/man5/passwd.5.rst @@ -50,13 +50,13 @@ passwd Attributes: \ **password**\ - The default password for this type of component + The default password for this type of component. On Linux, a crypted form could be provided. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported. \ **cryptmethod**\ - Indicates the method that was used to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default. + Indicates the method to use to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default to encrypt plain-text passwords. diff --git a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst index 4f8be2d93..4100de4bb 100644 --- a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst +++ b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst @@ -565,6 +565,12 @@ notification(5)|notification.5 +openbmc(5)|openbmc.5 + + Setting for nodes that are controlled by an on-board OpenBmc. + + + osdistro(5)|osdistro.5 Information about all the OS distros in the xCAT cluster diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 7e42304f6..8894cc520 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -57,16 +57,24 @@ group Attributes: -\ **bmc**\ (ipmi.bmc) +\ **bmc**\ (ipmi.bmc, openbmc.bmc) + + The hostname of the BMC adapter. + + or The hostname of the BMC adapter. -\ **bmcpassword**\ (ipmi.password) +\ **bmcpassword**\ (ipmi.password, openbmc.password) The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default. + or + + The BMC password. + \ **bmcport**\ (ipmi.bmcport) @@ -115,10 +123,14 @@ group Attributes: -\ **bmcusername**\ (ipmi.username) +\ **bmcusername**\ (ipmi.username, openbmc.username) The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default. + or + + The BMC userid. + \ **bmcvlantag**\ (ipmi.taggedvlan) @@ -461,7 +473,7 @@ group Attributes: \ **mgt**\ (nodehm.mgt) - The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details. + The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index f1ae11918..f375eaac0 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -69,16 +69,24 @@ node Attributes: -\ **bmc**\ (ipmi.bmc) +\ **bmc**\ (ipmi.bmc, openbmc.bmc) + + The hostname of the BMC adapter. + + or The hostname of the BMC adapter. -\ **bmcpassword**\ (ipmi.password) +\ **bmcpassword**\ (ipmi.password, openbmc.password) The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default. + or + + The BMC password. + \ **bmcport**\ (ipmi.bmcport) @@ -127,10 +135,14 @@ node Attributes: -\ **bmcusername**\ (ipmi.username) +\ **bmcusername**\ (ipmi.username, openbmc.username) The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default. + or + + The BMC userid. + \ **bmcvlantag**\ (ipmi.taggedvlan) @@ -461,7 +473,7 @@ node Attributes: \ **mgt**\ (nodehm.mgt) - The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details. + The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details. diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 2fa5c5a14..787bb64c7 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -50,7 +50,7 @@ our @dsh_valid_env = ( 'DSH_REMOTE_PASSWORD', 'DSH_TO_USERID', 'DSH_FROM_USERID', 'DEVICETYPE', 'RSYNCSN', 'DSH_RSYNC_FILE', - 'RSYNCSNONLY', + 'RSYNCSNONLY', 'DSH_VERIFY', ); select(STDERR); $| = 1; @@ -2492,6 +2492,12 @@ sub config_dsh $dsh_trace && xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + $$options{'verify'} = $$options{'verify'} || $ENV{'DSH_VERIFY'} || undef; + my $rsp = {}; + $rsp->{data}->[0] = "TRACE: Verify value is $$options{'verify'} "; + $dsh_trace + && xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + # Check if $$options{'pre-command'} has been overwritten # Mellanox uses pre-command = cli if (!$$options{'pre-command'}) diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index c7f7bb3ef..0cbba194a 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -46,6 +46,8 @@ my %usage = ( rpower [on|onstandby|off|cycle|state|sms] Blade(using AMM) specific: rpower [cycle|softoff] [-V|--verbose] + Lenovo high-density server specific: + rpower [on|off|reset|boot|reseat] zVM specific: rpower noderange [on|off|reset|stat|softoff] MIC specific: @@ -53,8 +55,8 @@ my %usage = ( docker specific: rpower noderange [start|stop|restart|pause|unpause|state] pdu specific: - rpower noderange [off|on|stat] - rpower noderange [pduoff|pduon|pdustat] + rpower noderange [off|on|stat|status|reset] + rpower noderange [pduoff|pduon|pdustat|pdustatus|pdureset] ", "rbeacon" => "Usage: rbeacon [on|off|stat] [-V|--verbose] diff --git a/xCAT-client/bin/xdsh b/xCAT-client/bin/xdsh index 164f4ba77..89e4ff0a6 100644 --- a/xCAT-client/bin/xdsh +++ b/xCAT-client/bin/xdsh @@ -190,6 +190,11 @@ if ($ENV{'DSH_ENVIRONMENT'}) push(@{ $cmdref->{env} }, "DSH_ENVIRONMENT=$ENV{'DSH_ENVIRONMENT'}"); } +if ($ENV{'DSH_VERIFY'}) +{ + push(@{ $cmdref->{env} }, "DSH_VERIFY=$ENV{'DSH_VERIFY'}"); +} + xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response); exit $xCAT::Client::EXITCODE; diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index bc8a0e062..2a8bd9d96 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -12,7 +12,7 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] B I [B|B|B|B|B|B|B|B|B|B [B<-w> I] [B<-o>] [B<-r>]] -B I [B|B|B] +B I [B|B|B|B] =head2 OpenBMC specific: @@ -50,7 +50,11 @@ B I [B|B|B|B|B|B] =head2 Blade specific: -B I [B|B] +B I [B|B] + +=head2 Lenovo High-Density Server specific: + +B I [B|B|B|B|B] =head2 zVM specific: @@ -62,7 +66,7 @@ B I [B|B|B|B|B|B =head2 pdu specific: -B I [B|B|B] +B I [B|B|B|B] =head1 DESCRIPTION @@ -173,6 +177,10 @@ This option is recommended over B. Power off, then on. +=item B + +For Lenovo high-density servers, simulates unplugging and replugging the node into the chassis. + =item B Boot the node to open firmware console mode. diff --git a/xCAT-client/pods/man1/xdsh.1.pod b/xCAT-client/pods/man1/xdsh.1.pod index a9d06a6c4..38596e793 100644 --- a/xCAT-client/pods/man1/xdsh.1.pod +++ b/xCAT-client/pods/man1/xdsh.1.pod @@ -231,7 +231,7 @@ for valid names. xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the install image. No other xdsh flags, environment variables apply with this input. A noderange is not accepted. Only runs on the local host, -normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that xdsh hangs. +normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that B hangs. =item B<-K>|B<--ssh-setup> @@ -324,8 +324,8 @@ available from any target in the specified I, B displays an error and terminates execution for the remote targets that failed to respond. If I is not specified, B waits indefinitely to continue processing output from -all remote targets. The exception is the -K flag which defaults -to 10 seconds. +all remote targets. The exception is the B<-K> flag which defaults +to 10 seconds. =item B<-T>|B<--trace> @@ -430,28 +430,32 @@ remote I is used. If B is set to the password of the userid (usually root) that will ssh to the node, then when -you use the -K flag, you will not be prompted for a password. +you use the B<-K> flag, you will not be prompted for a password. =item B Specifies the shell syntax to use on remote targets; B or -B. If not specified, the B syntax is assumed. This +B. If not specified, the B syntax is assumed. This variable is overridden by the B<-S> flag. =item B -Specifies the time, in seconds, to wait for output from -each remote target. This variable is overridden by the B<-t> flag. +Specifies the time, in seconds, to wait for output from +each remote target. This variable is overridden by the B<-t> flag. + +=item B + +Verifies each target before executing any remote commands on the target. If a target is not responding, execution of remote commands for the target is canceled. This variable is overridden by the B<-v> flag. =back =head1 B -To provide backward compatibility for scripts written using dsh in +To provide backward compatibility for scripts written using B in AIX and CSM, a tool has been provided B, which will build node group files from the -xCAT database that can be used by dsh. See B. +xCAT database that can be used by B. See B. =head1 B @@ -470,7 +474,7 @@ userdefined. =head1 B -The dsh command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. +The B command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. =head1 B @@ -524,20 +528,20 @@ To cleanup the servicenode directory that stages the copy of files to the nodes, To define the QLogic IB switch as a node and to set up the SSH keys for IB switch B with device configuration file -B and user name B, Enter +B and user name B, enter chdef -t node -o qswitch groups=all nodetype=switch xdsh qswitch -K -l username --devicetype IBSwitch::Qlogic =item 10. -To define the Management Node in the database so you can use xdsh, Enter +To define the Management Node in the database so you can use B, enter xcatconfig -m =item 11. To define the Mellanox switch as a node and run a command to show the ssh keys. -B with and user name B, Enter +B with and user name B, enter chdef -t node -o mswitch groups=all nodetype=switch @@ -559,7 +563,7 @@ If it is for Telnet, add I in front of the user name: I. =item 13. -To run xdsh with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: +To run B with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: xdsh node1,node2 --sudo -l user1 "cat /etc/passwd" diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index cfb58162c..ab2e4f072 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -235,7 +235,7 @@ sub process_command { if ($command eq 'rpower') { $subcommand = $request->{op}; } #pdu commands will be handled in the pdu plugin - if(($subcommand eq 'pduoff') || ($subcommand eq 'pduon') || ($subcommand eq 'pdustat')){ + if(($subcommand eq 'pduoff') || ($subcommand eq 'pduon') || ($subcommand eq 'pdustat') || ($subcommand eq 'pdureset')){ return 0; } diff --git a/xCAT-server/lib/xcat/dsh/Context/DSH.pm b/xCAT-server/lib/xcat/dsh/Context/DSH.pm index 14299915b..2d30f630d 100644 --- a/xCAT-server/lib/xcat/dsh/Context/DSH.pm +++ b/xCAT-server/lib/xcat/dsh/Context/DSH.pm @@ -132,6 +132,7 @@ sub context_properties { || $ENV{'DSH_REPORTS_DIRECTORY'}; $properties{'DSH_SYNTAX'} = $ENV{'DSH_SYNTAX'}; $properties{'DSH_TIMEOUT'} = $ENV{'DSH_TIMEOUT'}; + $properties{'DSH_VERIFY'} = $ENV{'DSH_VERIFY'}; $properties{'RSYNC_RSH'} = $ENV{'RSYNC_RSH'}; if ($ENV{'DSH_ON_HMC'}) { diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 5eaac006c..c202c331b 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -4401,7 +4401,7 @@ sub process_request { else { $moreinfo = build_more_info($noderange, $callback); } #pdu commands will be handled in the pdu plugin - if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) { return; } diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index b593236fb..d05a44ef5 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -896,6 +896,11 @@ sub bmcdiscovery_ipmi { my $output = xCAT::Utils->runcmd("$icmd", -1); if ($output =~ $bmcstr) { + if ($output =~ /RAKP 2 message indicates an error : (.+)\nError: (.+)/) { + xCAT::MsgUtils->message("E", { data => ["$2: $1 for $ip"] }, $::CALLBACK); + return 1; + } + # The output contains System Power indicated the username/password is correct, then try to get MTMS if ($output =~ /System Power\s*:\s*\S*/) { my $mtm = ''; diff --git a/xCAT-server/lib/xcat/plugins/confluent.pm b/xCAT-server/lib/xcat/plugins/confluent.pm index 595d00bf6..0b0602acc 100644 --- a/xCAT-server/lib/xcat/plugins/confluent.pm +++ b/xCAT-server/lib/xcat/plugins/confluent.pm @@ -463,7 +463,7 @@ sub donodeent { } } if (defined($cfgent->{consoleondemand})) { - if ($cfgent->{consoleondemand}) { + if ($cfgent->{consoleondemand} == 'yes') { $parameters{'console.logging'} = 'none'; } else { @@ -472,6 +472,9 @@ sub donodeent { } elsif ($::XCATSITEVALS{'consoleondemand'} and $::XCATSITEVALS{'consoleondemand'} !~ m/^n/) { $parameters{'console.logging'} = 'none'; } + elsif ($::XCATSITEVALS{'consoleondemand'} and $::XCATSITEVALS{'consoleondemand'} == 'no') { + $parameters{'console.logging'} = 'full'; + } # ok, now for nodepos... if (defined $cfgent->{u}) { diff --git a/xCAT-server/lib/xcat/plugins/docker.pm b/xCAT-server/lib/xcat/plugins/docker.pm index 5b7e16796..3118da70c 100755 --- a/xCAT-server/lib/xcat/plugins/docker.pm +++ b/xCAT-server/lib/xcat/plugins/docker.pm @@ -12,6 +12,10 @@ package xCAT_plugin::docker; BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + my $async_path = "/usr/local/share/perl5/"; + unless (grep { $_ eq $async_path } @INC) { + push @INC, $async_path; + } } use lib "$::XCATROOT/lib/perl"; diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index d705ca81e..fcdb09b0c 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -407,7 +407,7 @@ sub process_request { } #pdu commands will be handled in the pdu plugin - if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) { return; } #my $sitetab = xCAT::Table->new('site'); diff --git a/xCAT-server/lib/xcat/plugins/hpblade.pm b/xCAT-server/lib/xcat/plugins/hpblade.pm index 090bb6738..364627ba7 100755 --- a/xCAT-server/lib/xcat/plugins/hpblade.pm +++ b/xCAT-server/lib/xcat/plugins/hpblade.pm @@ -647,7 +647,7 @@ sub process_request { else { $moreinfo = build_more_info($noderange, $callback); } #pdu commands will be handled in the pdu plugin - if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) { return; } diff --git a/xCAT-server/lib/xcat/plugins/hpilo.pm b/xCAT-server/lib/xcat/plugins/hpilo.pm index 72855e11a..3a88db4e3 100755 --- a/xCAT-server/lib/xcat/plugins/hpilo.pm +++ b/xCAT-server/lib/xcat/plugins/hpilo.pm @@ -362,7 +362,7 @@ sub process_request { } #pdu commands will be handled in the pdu plugin - if (($extrargs->[0] eq 'pdustat') || ($extrargs->[0] eq 'pduon') || ($extrargs->[0] eq 'pduoff')) { + if (($extrargs->[0] eq 'pdustat') || ($extrargs->[0] eq 'pdureset') || ($extrargs->[0] eq 'pduon') || ($extrargs->[0] eq 'pduoff')) { return; } diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 30edfb46e..4354876f0 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -7686,8 +7686,8 @@ sub preprocess_request { } #pdu commands will be handled in the pdu plugin - if(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){ - return 0; + if(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat') || ($subcmd eq 'pdureset')){ + return 0; } if (($subcmd ne 'reseat') && ($subcmd ne 'stat') && ($subcmd ne 'state') && ($subcmd ne 'status') && ($subcmd ne 'on') && ($subcmd ne 'off') && ($subcmd ne 'softoff') && ($subcmd ne 'nmi') && ($subcmd ne 'cycle') && ($subcmd ne 'reset') && ($subcmd ne 'boot') && ($subcmd ne 'wake') && ($subcmd ne 'suspend')) { diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index becd4c557..6e2434eea 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3675,7 +3675,7 @@ sub process_request { } #pdu commands will be handled in the pdu plugin - if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) { return; } diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 88441b2cf..e72e412e4 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -6,6 +6,10 @@ package xCAT_plugin::openbmc; BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + my $async_path = "/usr/local/share/perl5/"; + unless (grep { $_ eq $async_path } @INC) { + push @INC, $async_path; + } } use lib "$::XCATROOT/lib/perl"; use strict; @@ -192,7 +196,7 @@ sub preprocess_request { my $parse_result = parse_args($command, $extrargs); if (ref($parse_result) eq 'ARRAY') { - $callback->({ error => $parse_result->[1], errorcode => $parse_result->[0] }); + $callback->({ errorcode => $parse_result->[0], data => $parse_result->[1] }); $request = {}; return; } @@ -300,7 +304,7 @@ sub parse_args { return ([ 1, "No option specified for rpower" ]); } unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) { - return ([ 1, "$subcommand is not supported for rpower" ]); + return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "rinv") { # @@ -310,7 +314,7 @@ sub parse_args { unless ($subcommand =~ /^cpu$|^dimm$|^bios$|^all$/) { - return ([ 1, "Only 'cpu','dimm', 'bios','all' are supported currently" ]); + return ([ 1, "Unsupported command: $command $subcommand" ]); } } else { return ([ 1, "Command is not supported." ]); @@ -383,28 +387,35 @@ sub parse_command_status { sub parse_node_info { my $noderange = shift; - my $table = xCAT::Table->new('openbmc'); - my $tablehash = $table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']); + my $passwd_table = xCAT::Table->new('passwd'); + my $passwd_hash = $passwd_table->getAttribs({ 'key' => 'openbmc' }, qw(username password)); + + my $openbmc_table = xCAT::Table->new('openbmc'); + my $openbmc_hash = $openbmc_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']); foreach my $node (@$noderange) { - if (defined($tablehash->{$node}->[0])) { - if ($tablehash->{$node}->[0]->{'bmc'}) { - $node_info{$node}{bmc} = $tablehash->{$node}->[0]->{'bmc'}; + if (defined($openbmc_hash->{$node}->[0])) { + if ($openbmc_hash->{$node}->[0]->{'bmc'}) { + $node_info{$node}{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'}; } else { xCAT::SvrUtils::sendmsg("Unable to get attribute bmc", $callback, $node); next; } - if ($tablehash->{$node}->[0]->{'username'}) { - $node_info{$node}{username} = $tablehash->{$node}->[0]->{'username'}; + if ($openbmc_hash->{$node}->[0]->{'username'}) { + $node_info{$node}{username} = $openbmc_hash->{$node}->[0]->{'username'}; + } elsif ($passwd_hash and $passwd_hash->{username}) { + $node_info{$node}{username} = $passwd_hash->{username}; } else { xCAT::SvrUtils::sendmsg("Unable to get attribute username", $callback, $node); delete $node_info{$node}; next; } - if ($tablehash->{$node}->[0]->{'password'}) { - $node_info{$node}{password} = $tablehash->{$node}->[0]->{'password'}; + if ($openbmc_hash->{$node}->[0]->{'password'}) { + $node_info{$node}{password} = $openbmc_hash->{$node}->[0]->{'password'}; + } elsif ($passwd_hash and $passwd_hash->{password}) { + $node_info{$node}{password} = $passwd_hash->{password}; } else { xCAT::SvrUtils::sendmsg("Unable to get attribute password", $callback, $node); delete $node_info{$node}; diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 92d3c3350..9d54d92fc 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -140,7 +140,7 @@ sub process_request return powerstat($noderange, $callback); }elsif ($command eq "rpower") { my $subcmd = $exargs[0]; - if (($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){ + if (($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')|| ($subcmd eq 'pdureset') ){ #if one day, pdu node have pdu attribute, handle in this section too return powerpduoutlet($noderange, $subcmd, $callback); } else { @@ -160,7 +160,7 @@ sub process_request } } if(@allpdunodes) { - if(($subcmd eq 'on') || ($subcmd eq 'off') || ($subcmd eq 'stat') || ($subcmd eq 'state')){ + if(($subcmd eq 'on') || ($subcmd eq 'off') || ($subcmd eq 'stat') || ($subcmd eq 'state') || ($subcmd eq 'reset') ){ return powerpdu(\@allpdunodes, $subcmd, $callback); } else { my $pdunode = join (",", @allpdunodes); @@ -232,9 +232,12 @@ sub powerpdu { if ($subcmd eq "off") { $value = 0; $statstr = "off"; - } else { + } elsif ( $subcmd eq "on") { $value = 1; $statstr = "on"; + } else { + $value = 2; + $statstr = "reset"; } for (my $outlet =1; $outlet <= $count; $outlet++) @@ -304,6 +307,10 @@ sub powerpduoutlet { $value = 1; $statstr = "on"; outletpower($session, $outlet, $value); + } elsif ($subcmd eq "pdureset") { + $value = 2; + $statstr = "reset"; + outletpower($session, $outlet, $value); } else { $callback->({ error => "$subcmd is not support"}); } diff --git a/xCAT-server/lib/xcat/plugins/rhevm.pm b/xCAT-server/lib/xcat/plugins/rhevm.pm index 5a45e7870..c2b833958 100644 --- a/xCAT-server/lib/xcat/plugins/rhevm.pm +++ b/xCAT-server/lib/xcat/plugins/rhevm.pm @@ -127,7 +127,7 @@ sub preprocess_request { } #pdu commands will be handled in the pdu plugin - if (($extraargs->[0] eq 'pdustat') || ($extraargs->[0] eq 'pduon') || ($extraargs->[0] eq 'pduoff')) { + if (($extraargs->[0] eq 'pdustat') || ($extraargs->[0] eq 'pdureset') || ($extraargs->[0] eq 'pduon') || ($extraargs->[0] eq 'pduoff')) { return; } diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index 7a552e7aa..6629f9b9f 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -706,7 +706,7 @@ sub process_request { } #pdu commands will be handled in the pdu plugin - if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) { return; } diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 911be973e..d04a98aae 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -2319,7 +2319,7 @@ sub powerVM { my $out; ##pdu commands will be handled in the pdu plugin - if ($args->[0] eq 'pduon' || $args->[0] eq 'pduoff' || $args->[0] eq 'pdustat') { + if ($args->[0] eq 'pduon' || $args->[0] eq 'pdureset' || $args->[0] eq 'pduoff' || $args->[0] eq 'pdustat') { return; } diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat b/xCAT-server/share/xcat/install/scripts/post.xcat index 2179b2f82..48024de9c 100755 --- a/xCAT-server/share/xcat/install/scripts/post.xcat +++ b/xCAT-server/share/xcat/install/scripts/post.xcat @@ -180,6 +180,7 @@ echo " # global value to store the running status of the postbootscripts,the value is non-zero if one postbootscript failed return_value=0 + # subroutine used to run postscripts # \$1 argument is the script type # rest argument is the script name and arguments @@ -227,6 +228,7 @@ run_ps () { return_value=-1 fi + return 0 } # subroutine end @@ -389,6 +391,19 @@ fi #create the preboot script and run here TMP=`sed "/^#\s*postbootscripts-start-here/,/^#\s*postbootscripts-end-here/ d" /xcatpost/mypostscript` echo "$TMP" > /xcatpost/mypostscript + +echo " +#save bad return code to /opt/xcat/xcatinfo +if [ \"\$return_value\" -ne \"0\" ]; then + grep 'POSTSCRIPTS_RC' /opt/xcat/xcatinfo > /dev/null 2>&1 + if [ \$? -eq 0 ]; then + sed -i \"s/POSTSCRIPTS_RC=.*/POSTSCRIPTS_RC=1/\" /opt/xcat/xcatinfo + else + echo \"POSTSCRIPTS_RC=1\" >> /opt/xcat/xcatinfo + fi +fi +" >> /xcatpost/mypostscript + chmod 755 /xcatpost/mypostscript export ARCH=#TABLE:nodetype:THISNODE:arch# diff --git a/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle b/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle index 3d02946bd..d0f631fd2 100644 --- a/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle @@ -232,6 +232,7 @@ makehosts_l makehosts_d makehosts_n makehosts_n_noderange +makehost_n_r xdcp_src_dst makedns_h makedns_d_node diff --git a/xCAT-test/autotest/bundle/rhels6.9_x86_64.bundle b/xCAT-test/autotest/bundle/rhels6.9_x86_64.bundle index bd2907ad7..9e922a688 100644 --- a/xCAT-test/autotest/bundle/rhels6.9_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.9_x86_64.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n makehosts_n_noderange +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle b/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle index 0303d2545..9577fb385 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle @@ -4,8 +4,6 @@ go_xcat_noinput go_xcat_with_x go_xcat_with_xcat-version-1 go_xcat_online_repo_case6 -makehosts_help -makehosts_n_noderange updatenode_h updatenode_v updatenode_diskful_syncfiles @@ -224,11 +222,14 @@ lsxcatd_null lsxcatd_h lsxcatd_d lsxcatd_a +makehosts_help +makehosts_n_noderange makehosts_h makehosts_null makehosts_l makehosts_d makehosts_n +makehost_n_r xdcp_src_dst makedns_h makedns_d_node diff --git a/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle index e7dc0de66..f17b883c8 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle @@ -152,13 +152,6 @@ rpower_reset rpower_noderange rpower_noderange_nodeps rpower_err_noderange -rscan_noderange -rscan_x -rscan_z -rscan_w -rscan_x_w -rscan_z_w -rvitals_lcds rvitals_noderange_err tabdump_table tabdump_d @@ -224,6 +217,7 @@ makehosts_l makehosts_d makehosts_n makehosts_n_noderange +makehost_n_r xdcp_src_dst makedns_h makedns_d_node diff --git a/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle b/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle index 497756717..53b49e38d 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n makehosts_n_noderange +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle b/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle index 66b390c1d..956d7fa6b 100644 --- a/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle +++ b/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle @@ -214,6 +214,7 @@ makehosts_l makehosts_d makehosts_n makehosts_n_noderange +makehost_n_r xdcp_src_dst makedns_h makedns_d_node diff --git a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle index 620a1d9a4..1515dd3a5 100644 --- a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n makehosts_n_noderange +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle index 65ff91ea2..13d930b24 100644 --- a/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle @@ -10,6 +10,7 @@ makehosts_h makehosts_help makehosts_n makehosts_n_noderange +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle index 4003012a6..78877bdbd 100644 --- a/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n makehosts_n_noderange +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle index be6932c9d..f258d566c 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n_noderange makehosts_n +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle index 72d300f72..b45a72056 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n_noderange makehosts_n +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle index 74df70cbe..212853add 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n_noderange makehosts_n +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle index 51decc528..9b377bcca 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle @@ -9,6 +9,7 @@ makehosts_h makehosts_help makehosts_n_noderange makehosts_n +makehost_n_r chdef_null chdef_z chdef_t_o_error diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index c63a8ad8f..1238039d8 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -1,6 +1,6 @@ start:confignics_config_one_port_single_value description:confignics -cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=100.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=100_1_0_0-255_255_0_0 check:rc==0 @@ -8,16 +8,16 @@ 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 check:output=~100.1.0.100 -check:output!~dhcp +check:output=~MTU=1501 cmd:rmdef -t network -o 100_1_0_0-255_255_0_0 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi end start:confignics_config_multiple_ports_single_value description:confignics -cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 check:rc==0 -cmd:mkdef -t network -o 200_1_0_0-255_255_0_0 net=200.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 200_1_0_0-255_255_0_0 net=200.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1502 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=100.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=100_1_0_0-255_255_0_0 check:rc==0 @@ -28,9 +28,11 @@ 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 check:output=~100.1.0.100 check:output!~dhcp +check:output=~MTU=1501 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~200.1.0.100 check:output!~dhcp +check:output=~MTU=1502 cmd:rmdef -t network -o 100_1_0_0-255_255_0_0 cmd:rmdef -t network -o 200_1_0_0-255_255_0_0 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi @@ -39,13 +41,13 @@ end start:confignics_config_multiple_ports_multiple_value description:confignics -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1502 check:rc==0 -cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1503 check:rc==0 -cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1504 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" check:rc==0 @@ -56,15 +58,19 @@ 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 check:output=~11.1.0.100 check:output!~dhcp +check:output=~MTU=1501 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~12.1.0.100 check:output!~dhcp +check:output=~MTU_1=1502 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~13.1.0.100 check:output!~dhcp +check:output=~MTU=1503 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~14.1.0.100 check:output!~dhcp +check:output=~MTU_1=1504 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 @@ -77,13 +83,13 @@ end start:confignics_config_multiple_port_withnichostnamesuffixes_multiple_value description:confignics -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1502 check:rc==0 -cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1503 check:rc==0 -cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1504 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" check:rc==0 @@ -103,15 +109,19 @@ 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 check:output=~11.1.0.100 check:output!~dhcp +output=~MTU=1501 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~12.1.0.100 check:output!~dhcp +output=~MTU=1502 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~13.1.0.100 check:output!~dhcp +output=~MTU=1503 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~14.1.0.100 check:output!~dhcp +output=~MTU=1504 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 @@ -125,13 +135,13 @@ end start:confignics_config_multiple_port_withnicaliases_multiple_value description:confignics -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1502 check:rc==0 -cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1503 check:rc==0 -cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1504 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1|aliases1-2" check:rc==0 @@ -149,15 +159,19 @@ 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 check:output=~11.1.0.100 check:output!~dhcp +output=~MTU=1501 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~12.1.0.100 check:output!~dhcp +output=~MTU=1502 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~13.1.0.100 check:output!~dhcp +output=~MTU=1503 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~14.1.0.100 check:output!~dhcp +output=~MTU=1504 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 @@ -181,6 +195,7 @@ 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-scripts/ifcfg-$$SECONDNIC; fi check:output!~100.1.0.100 +output=~MTU=1501 cmd:rmdef -t network -o 100_1_0_0-255_255_0_0 cmd:chtab node=$$CN nics.disable=0 end @@ -188,7 +203,7 @@ end start:confignics_disable_set_to_1 description:confignics cmd:xdsh $$CN ifdown $$SECONDNIC -cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=100.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=100_1_0_0-255_255_0_0 check:rc==0 @@ -198,15 +213,21 @@ 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-scripts/ifcfg-$$SECONDNIC; fi check:output!~100.1.0.100 +output=~MTU=1501 cmd:rmdef -t network -o 100_1_0_0-255_255_0_0 cmd:chtab node=$$CN nics.disable=0 end start:confignics_s description:confignics_s +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/confignics/mtu_set_clean S 1501 +check:rc==0 +cmd:tabdump networks +check:rc==0 cmd:updatenode $$CN "confignics -s" check:rc==0 check:output!~invalid -cmd:if cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-eth0 |grep IPADDR=$$NODEIP";elif cat /etc/*release |grep SUSE >/dev/null; then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-eth0 |grep IPADDR=$$NODEIP";fi -cmd:sleep 5 +cmd:if cat /etc/*release |grep "Red Hat" >/dev/null ;then if [[ `xdsh $$CN cat /etc/sysconfig/network-scripts/ifcfg-eth0 ` =~ "IPADDR=$$NODEIP" ]] && [[ `xdsh $$CN cat /etc/sysconfig/network-scripts/ifcfg-eth0 ` =~ "MTU=1501" ]] ; then exit 0 ;else exit 1 ; fi ;elif cat /etc/*release |grep SUSE >/dev/null ; then if [[ `xdsh $$CN cat /etc/sysconfig/network/ifcfg-eth0 ` =~ "IPADDR=$$NODEIP" ]] && [[ `xdsh $$CN cat /etc/sysconfig/network/ifcfg-eth0 ` =~ "MTU=1501" ]] ;then exit 0;else exit 1;fi;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/confignics/mtu_set_clean C 1501 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/confignics/mtu_set_clean b/xCAT-test/autotest/testcase/confignics/mtu_set_clean new file mode 100755 index 000000000..adbc8db69 --- /dev/null +++ b/xCAT-test/autotest/testcase/confignics/mtu_set_clean @@ -0,0 +1,59 @@ +#!/bin/bash +function test_ip() +{ + IP=$1 + VALID_CHECK=$(echo $IP|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}') + if echo $IP|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then + if [ ${VALID_CHECK:-no} == "yes" ]; then + echo $1; + else + return 1; + fi + else + return 1; + fi + +} +function get_master_ip() +{ + test_ip $1; + if [[ $? -eq 1 ]]; then + rc2=`ping $MASTERIP -c 10`; + if [[ $? -eq 0 ]]; then + MASTERIPN=` ping $MASTERIP -c 1 |grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'`; + echo $MASTERIPN; + else + echo "invalid master value"; + exit 1; + fi + fi + +} +MASTERIP="" +NETWORKNAME="" +MASTERIP=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; +MASTERIP=$(get_master_ip $MASTERIP); +if [[ `tabdump networks |grep $MASTERIP` = "" ]]; then + makenetworks +fi +NETWORKNAME=`tabdump networks |grep $MASTERIP|awk -F'"' '{print $2}'`; +echo $NETWORKNAME,$MASTERIP; +if [[ $NETWORKNAME = "" ]] || [[ $MASTERIP = "" ]];then + exit 2; +else + if [ $1 = "S" ] ;then + chdef -t network -o $NETWORKNAME mtu=$2 + if [[ $? -eq 0 ]];then + exit 0; + else + exit 1; + fi + else [ $1 = "C" ] + chdef -t network -o $NETWORKNAME mtu=" " + if [[ $? -eq 0 ]];then + exit 0; + else + exit 1; + fi + fi +fi diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index abba79cee..09f12aecc 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -27,6 +27,8 @@ check:rc==0 cmd:copycds $$ISO check:rc==0 +cmd:updatenode $$CN -f +check:rc==0 cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index 9ec2032ac..46965af78 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -14,7 +14,7 @@ end start:makehosts_null description:makehosts -cmd:cp -f /etc/hosts /etc/hosts.xcatbak +cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|" check:rc==0 cmd:mkdef -t node -o node01,node02 groups="compute" @@ -31,11 +31,11 @@ check:output=~node02 cmd:chtab -d node=compute hosts cmd:rmdef node01 cmd:rmdef node02 -cmd:mv -f /etc/hosts.xcatbak /etc/hosts +cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts end start:makehosts_l -cmd:cp -f /etc/hosts /etc/hosts.xcatbak +cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|" check:rc==0 cmd:chdef -t node -o node01,node02 groups="compute" @@ -51,12 +51,12 @@ check:output=~node02.cluster.net cmd:chtab -d node=compute hosts cmd:rmdef node01 cmd:rmdef node02 -cmd:mv -f /etc/hosts.xcatbak /etc/hosts +cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts cmd:rm -rf /tmp/hosts end start:makehosts_d -cmd:cp -f /etc/hosts /etc/hosts.xcatbak +cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|" check:rc==0 cmd:chdef -t node -o node01 groups="compute" @@ -73,12 +73,12 @@ cmd:diff /tmp/1 /tmp/2 check:output=~node01.cluster.net cmd:chtab -d node=compute hosts cmd:rmdef node01 -cmd:mv -f /etc/hosts.xcatbak /etc/hosts +cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts cmd:rm -f /tmp/1 /tmp/2 end start:makehosts_n -cmd:cp -f /etc/hosts /etc/hosts.xcatbak +cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|" check:rc==0 cmd:chdef -t node -o node01 groups="compute" @@ -97,12 +97,12 @@ check:output=~node01.cluster.net cmd:chtab -d node=compute hosts cmd:rmdef node01 cmd:cp /etc/hosts /hosts -cmd:mv -f /etc/hosts.xcatbak /etc/hosts +cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts cmd:rm -rf /tmp/hosts end start:makehosts_n_noderange -cmd:cp -f /etc/hosts /etc/hosts.xcatbak +cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|" check:rc==0 cmd:chdef -t node -o node01 groups="compute" @@ -119,10 +119,52 @@ cmd:cat /tmp/hosts check:output=~node01.cluster.net cmd:chtab -d node=compute hosts cmd:rmdef node01 -cmd:mv -f /etc/hosts.xcatbak /etc/hosts +cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts cmd:cat /etc/hosts| grep -v node01 > /tmp/1 cmd:mv -f /tmp/1 /etc/hosts cmd:rm -rf /tmp/hosts end +start:makehost_n_r +descriptions:modify makehosts testcases according to special node name eg:s01 and s01r* . for issue #2717 and #2683 +cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest +cmd:lsdef s01;if [ $? -eq 0 ]; then lsdef -l s01 -z >/tmp/s01.standa ;rmdef s01;fi +check:rc==0 +cmd:lsdef s01r1b01;if [ $? -eq 0 ]; then lsdef -l s01r1b01 -z >/tmp/s01r1b01.standa ;rmdef s01r1b01;fi +check:rc==0 +cmd:nodeadd s01 groups=service; chdef s01 ip=70.2.0.254;nodeadd s01r1b01 groups=compute; chdef s01r1b01 ip=80.2.0.254;makehosts +check:rc==0 +cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi +check:rc==0 +cmd:makehosts s01 +check:rc==0 +cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi +check:rc==0 +cmd:makehosts service +check:rc==0 +cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi +check:rc==0 +cmd:makehosts -d s01 +check:rc==0 +cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 = "" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi +check:rc==0 +cmd:makehosts +check:rc==0 +cmd:makehosts -d service +check:rc==0 +cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 = "" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi +check:rc==0 +cmd:makehosts +check:rc==0 +cmd:makehosts -d s01r1b01 +check:rc==0 +cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 = "" ]];then exit 0;else exit 1;fi +check:rc==0 +cmd:if [ -e /tmp/s01.standa ]; then rmdef s01; cat /tmp/s01.standa | mkdef -z; rm -rf /tmp/s01.standa; fi +check:rc==0 +cmd:if [ -e /tmp/s01r1b01.standa ]; then rmdef s01r1b01; cat /tmp/s01r1b01.standa | mkdef -z; rm -rf /tmp/s01r1b01.standa; fi +check:rc==0 +cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts +end + diff --git a/xCAT-test/autotest/testcase/mkdef/cases1 b/xCAT-test/autotest/testcase/mkdef/cases1 new file mode 100644 index 000000000..0d77e6e28 --- /dev/null +++ b/xCAT-test/autotest/testcase/mkdef/cases1 @@ -0,0 +1,11 @@ +start:mkdef_github_issue2582 +description:Verify github issue 2582 +cmd:mkdef -t group -o doubletrouble bmc='|\z|-imm|' mgt=ipmi +check:rc==0 +cmd:mkdef mgt02 groups=doubletrouble +check:rc==0 +cmd:lsdef mgt02 -i bmc | grep bmc=mgt02-imm$ +check:rc==0 +cmd:rmdef mgt02 +cmd:rmdef -t group doubletrouble +end diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 49f2ec47d..3f81504ec 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -169,7 +169,7 @@ cmd:mkdef -t node -o testnode1 arch=ppc64el cons=ipmi groups=pbmc mgt=ipmi ip=10 check:rc==0 cmd:nodeset testnode1 osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 -check:output=~Warning: testnode1: petitboot might be invalid +check:output=~Warning: testnode1: petitboot might be invalid|testnode1 could not be resolved cmd:noderm testnode1 end diff --git a/xCAT-test/autotest/testcase/nodeset/cases1 b/xCAT-test/autotest/testcase/nodeset/cases1 new file mode 100644 index 000000000..816f4ee59 --- /dev/null +++ b/xCAT-test/autotest/testcase/nodeset/cases1 @@ -0,0 +1,9 @@ +start:nodeset_addkcmdline +cmd:chdef $$CN addkcmdline=debug +check:rc==0 +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +cmd:find -L /tftpboot -name '*$$CN*' -exec cat {} + | grep debug +check:rc==0 +cmd:chdef $$CN addkcmdline= +end diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index c522406c2..6f47659f5 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -1,75 +1,79 @@ start:rpower_off -cmd:rpower $$CN stat -check:ouptut=~Running +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 cmd:rpower $$CN off check:rc==0 -check:output=~Success -cmd:sleep 60 +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 -check:output=~Not Activated -cmd:rpower $$CN on -cmd:sleep 60 +check:output=~Not Activated|off end start:rpower_stat +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 check:rc==0 -check:output=~Running +check:output=~Running|on cmd:rpower $$CN state check:rc==0 -check:output=~Running +check:output=~Running|on +cmd:rpower $$CN off +cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 5 ];then break;fi done +cmd:rpower $$CN stat +check:rc==0 +check:output=~Not Activated|off +cmd:rpower $$CN state +check:rc==0 +check:output=~Not Activated|off end start:rpower_boot cmd:rpower $$CN off -cmd:sleep 60 +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 -check:output=~Not Activated +check:output=~Not Activated|off cmd:rpower $$CN boot check:rc==0 -check:output=~Success -cmd:sleep 60 +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 -check:output=~Running -cmd:sleep 60 +check:output=~Running|on end start:rpower_on cmd:rpower $$CN off -cmd:sleep 60 +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 -check:output=~Not Activated +check:output=~Not Activated|off cmd:rpower $$CN on check:rc==0 -check:output=~Success -cmd:sleep 60 +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 -check:output=~Running -cmd:sleep 60 +check:output=~Running|on end start:rpower_reset +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 -check:ouptut=~Running +check:ouptut=~Running|on cmd:rpower $$CN reset check:rc==0 -check:output=~Success -cmd:sleep 60 +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 -check:output=~Running -cmd:sleep 60 +check:output=~Running|on end start:rpower_noderange cmd:rpower $$CN check:rc!=0 -check:output=~Usage +check:output=~Unsupported|Usage end start:rpower_noderange_nodeps cmd:rpower $$CN --nodeps check:rc!=0 -check:output=~Usage +check:output=~Unsupported|Usage end start:rpower_err_noderange diff --git a/xCAT-test/autotest/testcase/xdcp/cases0 b/xCAT-test/autotest/testcase/xdcp/cases0 index efaa943df..b23b1c647 100644 --- a/xCAT-test/autotest/testcase/xdcp/cases0 +++ b/xCAT-test/autotest/testcase/xdcp/cases0 @@ -10,7 +10,6 @@ check:output=~Version end start:xdcp_src_dst -stop:yes cmd:xdsh $$CN rm -f /tmp/hosts cmd:xdcp $$CN /etc/hosts /tmp/hosts check:rc==0 diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index a93722457..5e5805b52 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -11,7 +11,7 @@ # id.rsa # # if on the Management Node, exit - +umask 0077 if [ -f /etc/os-release ] && cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then #TODO echo "Cumulus OS is not supported yet, nothing to do..." @@ -149,8 +149,7 @@ if [ $? -ne 0 ]; then getcredentials.awk ssh_dsa_hostkey | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_dsa_key MYCONT=`cat /etc/ssh/ssh_host_dsa_key` done - chown root:ssh_keys /etc/ssh/ssh_host_dsa_key - chmod 640 /etc/ssh/ssh_host_dsa_key + egrep -i "^ssh_keys:" /etc/group >/dev/null 2>&1 && chown root:ssh_keys /etc/ssh/ssh_host_dsa_key 2>/dev/null && chmod 640 /etc/ssh/ssh_host_dsa_key if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_dsa_key > /dev/null 2>&1 ; then rm /etc/ssh/ssh_host_dsa_key else @@ -216,8 +215,7 @@ if [ $? -ne 0 ]; then getcredentials.awk ssh_rsa_hostkey | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_rsa_key MYCONT=`cat /etc/ssh/ssh_host_rsa_key` done - chown root:ssh_keys /etc/ssh/ssh_host_rsa_key - chmod 640 /etc/ssh/ssh_host_rsa_key + egrep -i "^ssh_keys:" /etc/group >/dev/null 2>&1 && chown root:ssh_keys /etc/ssh/ssh_host_rsa_key 2>/dev/null && chmod 640 /etc/ssh/ssh_host_rsa_key if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_rsa_key > /dev/null 2>&1 ; then rm /etc/ssh/ssh_host_rsa_key else @@ -288,8 +286,7 @@ if ssh-keygen -t ecdsa -f /tmp/ecdsa_key -P "" &>/dev/null ; then getcredentials.awk ssh_ecdsa_hostkey | grep -v '<'|sed -e 's/<//' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_ecdsa_key MYCONT=`cat /etc/ssh/ssh_host_ecdsa_key` done - chown root:ssh_keys /etc/ssh/ssh_host_ecdsa_key - chmod 640 /etc/ssh/ssh_host_ecdsa_key + egrep -i "^ssh_keys:" /etc/group >/dev/null 2>&1 && chown root:ssh_keys /etc/ssh/ssh_host_ecdsa_key 2>/dev/null && chmod 640 /etc/ssh/ssh_host_ecdsa_key if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_ecdsa_key > /dev/null 2>&1 ; then rm /etc/ssh/ssh_host_ecdsa_key else @@ -318,7 +315,7 @@ if [[ $NTYPE = service ]]; then cp /etc/ssh/ssh* /etc/xcat/hostkeys/. fi -umask 0077 + # This is where we start getting root ssh keys # This tells credentials.pm where to get the root .ssh keys. If no zone then old path of ~.ssh #rootsshpvtkey=ssh_root_key:$zonename diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost index 598cb93d4..de68037f0 100755 --- a/xCAT/postscripts/xcatinstallpost +++ b/xCAT/postscripts/xcatinstallpost @@ -84,6 +84,9 @@ if [ -z "$CNS" ] || [[ "$CNS" =~ ^(1|yes|y)$ ]]; then echo " +[ -f /opt/xcat/xcatinfo ] && grep 'POSTSCRIPTS_RC=1' /opt/xcat/xcatinfo >/dev/null 2>&1 && return_value=1 + + if [ \"\$return_value\" -eq \"0\" ]; then if [ \"\$XCATDEBUGMODE\" = \"1\" ] || [ \"\$XCATDEBUGMODE\" = \"2\" ]; then msgutil_r \"\$MASTER_IP\" \"info\" \"node booted, reporting status...\" \"/var/log/xcat/xcat.log\" @@ -99,6 +102,7 @@ fi " >> /xcatpost/mypostscript.post fi + chmod +x /xcatpost/mypostscript.post if [ -x /xcatpost/mypostscript.post ];then msgutil_r "$MASTER_IP" "info" "running /xcatpost/mypostscript.post" "/var/log/xcat/xcat.log"