2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-15 08:12:02 +00:00

Merge branch 'master' into 2335

This commit is contained in:
cxhong
2017-03-28 08:43:35 -04:00
committed by GitHub
55 changed files with 516 additions and 151 deletions
+23 -1
View File
@@ -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 <node> on`` to power on the compute node after the BMC boots.
@@ -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**\ ]
@@ -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
@@ -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.
@@ -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)**\
@@ -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.
@@ -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
@@ -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.
@@ -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.
+7 -1
View File
@@ -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'})
+4 -2
View File
@@ -46,6 +46,8 @@ my %usage = (
rpower <noderange> [on|onstandby|off|cycle|state|sms]
Blade(using AMM) specific:
rpower <noderange> [cycle|softoff] [-V|--verbose]
Lenovo high-density server specific:
rpower <noderange> [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 <noderange> [on|off|stat] [-V|--verbose]
+5
View File
@@ -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;
+11 -3
View File
@@ -12,7 +12,7 @@ B<rpower> [B<-h>|B<--help>|B<-v>|B<--version>]
B<rpower> I<noderange> [B<on>|B<off>|B<softoff>|B<reset>|B<boot>|B<stat>|B<state>|B<status>|B<wake>|B<suspend> [B<-w> I<timeout>] [B<-o>] [B<-r>]]
B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>]
B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>|B<pdureset>]
=head2 OpenBMC specific:
@@ -50,7 +50,11 @@ B<rpower> I<noderange> [B<on>|B<onstandby>|B<off>|B<stat>|B<state>|B<sms>]
=head2 Blade specific:
B<rpower> I<noderange> [B<cycle>|B<softoff>]
B<rpower> I<noderange> [B<cycle>|B<softoff>]
=head2 Lenovo High-Density Server specific:
B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<boot>|B<reseat>]
=head2 zVM specific:
@@ -62,7 +66,7 @@ B<rpower> I<noderange> [B<start>|B<stop>|B<restart>|B<pause>|B<unpause>|B<state>
=head2 pdu specific:
B<rpower> I<noderange> [B<stat>|B<off>|B<on>]
B<rpower> I<noderange> [B<stat>|B<off>|B<on>|B<reset>]
=head1 DESCRIPTION
@@ -173,6 +177,10 @@ This option is recommended over B<cycle>.
Power off, then on.
=item B<reseat>
For Lenovo high-density servers, simulates unplugging and replugging the node into the chassis.
=item B<of>
Boot the node to open firmware console mode.
+18 -14
View File
@@ -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<xdsh> hangs.
=item B<-K>|B<--ssh-setup>
@@ -324,8 +324,8 @@ available from any target in the specified I<timeout>, B<xdsh>
displays an error and terminates execution for the remote
targets that failed to respond. If I<timeout> is not specified,
B<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 B<-K> flag which defaults
to 10 seconds.
=item B<-T>|B<--trace>
@@ -430,28 +430,32 @@ remote I<user_ID> is used.
If B<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 B<-K> flag, you will not be prompted for a password.
=item B<DSH_SYNTAX>
Specifies the shell syntax to use on remote targets; B<ksh> or
B<csh>. If not specified, the B<ksh> syntax is assumed. This
B<csh>. If not specified, the B<ksh> syntax is assumed. This
variable is overridden by the B<-S> flag.
=item B<DSH_TIMEOUT>
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<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 B<-v> flag.
=back
=head1 B<Compatibility with AIX dsh>
To provide backward compatibility for scripts written using dsh in
To provide backward compatibility for scripts written using B<dsh> in
AIX and CSM, a tool has been provided B<groupfiles4dsh>,
which will build node group files from the
xCAT database that can be used by dsh. See B<man groupfiles4dsh>.
xCAT database that can be used by B<dsh>. See B<man groupfiles4dsh>.
=head1 B<SECURITY>
@@ -470,7 +474,7 @@ userdefined.
=head1 B<EXIT STATUS>
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<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.
=head1 B<EXAMPLES>
@@ -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<qswitch> with device configuration file
B</var/opt/xcat/IBSwitch/Qlogic/config> and user name B<username>, Enter
B</var/opt/xcat/IBSwitch/Qlogic/config> and user name B<username>, 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<xdsh>, enter
xcatconfig -m
=item 11.
To define the Mellanox switch as a node and run a command to show the ssh keys.
B<mswitch> with and user name B<username>, Enter
B<mswitch> with and user name B<username>, enter
chdef -t node -o mswitch groups=all nodetype=switch
@@ -559,7 +563,7 @@ If it is for Telnet, add I<tn:> in front of the user name: I<tn:admin>.
=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<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:
xdsh node1,node2 --sudo -l user1 "cat /etc/passwd"
+1 -1
View File
@@ -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;
}
+1
View File
@@ -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'}) {
+1 -1
View File
@@ -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;
}
@@ -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 = '';
+4 -1
View File
@@ -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}) {
+4
View File
@@ -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";
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+2 -2
View File
@@ -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')) {
+1 -1
View File
@@ -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;
}
+23 -12
View File
@@ -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};
+10 -3
View File
@@ -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"});
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
@@ -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#
@@ -232,6 +232,7 @@ makehosts_l
makehosts_d
makehosts_n
makehosts_n_noderange
makehost_n_r
xdcp_src_dst
makedns_h
makedns_d_node
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n
makehosts_n_noderange
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -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
@@ -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
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n
makehosts_n_noderange
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -214,6 +214,7 @@ makehosts_l
makehosts_d
makehosts_n
makehosts_n_noderange
makehost_n_r
xdcp_src_dst
makedns_h
makedns_d_node
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n
makehosts_n_noderange
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -10,6 +10,7 @@ makehosts_h
makehosts_help
makehosts_n
makehosts_n_noderange
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n
makehosts_n_noderange
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n_noderange
makehosts_n
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n_noderange
makehosts_n
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n_noderange
makehosts_n
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
@@ -9,6 +9,7 @@ makehosts_h
makehosts_help
makehosts_n_noderange
makehosts_n
makehost_n_r
chdef_null
chdef_z
chdef_t_o_error
+40 -19
View File
@@ -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
+59
View File
@@ -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
@@ -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
+52 -10
View File
@@ -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
+11
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
+32 -28
View File
@@ -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
-1
View File
@@ -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
+5 -8
View File
@@ -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/&lt;/</' -e 's/&gt;/>/' -e 's/&amp;/&/' -e 's/&quot/"/' -e "s/&apos;/'/" > /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/&lt;/</' -e 's/&gt;/>/' -e 's/&amp;/&/' -e 's/&quot/"/' -e "s/&apos;/'/" > /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/&lt;/</' -e 's/&gt;/>/' -e 's/&amp;/&/' -e 's/&quot/"/' -e "s/&apos;/'/" > /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
+4
View File
@@ -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"