From 7ce5108422145307d9dc712073e7f99237d79960 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Wed, 19 Dec 2018 03:34:04 -0500 Subject: [PATCH 01/77] rpower for redfish support --- .../agent/hwctl/executor/redfish_power.py | 89 +++++++ .../lib/python/agent/hwctl/redfish_client.py | 99 ++++++- .../lib/python/agent/xcatagent/redfish.py | 15 +- xCAT-server/lib/xcat/plugins/redfish.pm | 242 ++++++++++++++++++ 4 files changed, 441 insertions(+), 4 deletions(-) create mode 100644 xCAT-server/lib/xcat/plugins/redfish.pm diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py index 75b6e079d..00325b994 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py @@ -15,6 +15,12 @@ from hwctl import redfish_client as redfish import logging logger = logging.getLogger('xcatagent') +POWER_STATE_DB = { + "on" : "powering-on", + "off" : "powering-off", + "boot" : "powering-on", +} + class RedfishPowerTask(ParallelNodesCommand): """Executor for power-related actions.""" @@ -27,8 +33,91 @@ class RedfishPowerTask(ParallelNodesCommand): state = 'Unknown' try: rf.login() + chassis_state = rf.get_chassis_power_state() + if chassis_state == 'On': + state = rf.get_systems_power_state().lower() + else: + state = chassis_state.lower() self.callback.info('%s: %s' % (node, state)) except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) return state + + def get_bmcstate (self, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + state = 'Unknown' + try: + rf.login() + state = rf.get_bmc_state().lower() + self.callback.info('%s: %s' % (node, state)) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + return state + + def set_state(self, state, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + rf.login() + rf.set_power_state(state) + new_status = POWER_STATE_DB.get(state, '') + self.callback.info('%s: %s' % (node, state)) + if new_status: + self.callback.update_node_attributes('status', node, new_status) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + def reboot(self, optype='boot', **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + resettype = 'boot' + + try: + rf.login() + chassis_state = rf.get_chassis_power_state() + if chassis_state == 'Off': + status = chassis_state + else: + status = rf.get_systems_power_state() + + if status == 'Off': + if optype == 'reset': + return self.callback.info('%s: %s' % (node, status.lower())) + else: + resettype = 'on' + + rf.set_power_state(resettype) + new_status = POWER_STATE_DB.get(optype, '') + self.callback.info('%s: %s' % (node, optype)) + if new_status: + self.callback.update_node_attributes('status', node, new_status) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + def reboot_bmc(self, optype='warm', **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + rf.login() + except (SelfServerException, SelfClientException) as e: + return self.callback.error(e.message, node) + + try: + rf.reboot_bmc(optype) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + else: + self.callback.info('%s: %s' % (node, 'bmcreboot')) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index 9e01def8f..463d7e3b9 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -19,8 +19,19 @@ logger = logging.getLogger('xcatagent') HTTP_PROTOCOL = "https://" PROJECT_URL = "/redfish/v1" +CHASSIS_URL = PROJECT_URL + "/Chassis" +MANAGER_URL = PROJECT_URL + "/Managers" +SYSTEMS_URL = PROJECT_URL + "/Systems" SESSION_URL = PROJECT_URL + "/SessionService/Sessions" +BMC_RESET_TYPE = "ForceRestart" + +POWER_RESET_TYPE = { + 'boot' : 'ForceRestart', + 'off' : 'ForceOff', + 'on' : 'ForceOn', +} + class RedfishRest(object): headers = {'Content-Type': 'application/json'} @@ -119,7 +130,10 @@ class RedfishRest(object): if cmd == 'login' and not 'X-Auth-Token' in resp.headers: raise SelfServerException('Login Failed: Did not get Session Token from response') - self._print_record_log('%s %s' % (code, data['Name']), cmd) + if 'Name' in data: + self._print_record_log('%s %s' % (code, data['Name']), cmd) + elif 'error' in data: + self._print_record_log('%s %s' % (code, data['error']['Message']), cmd) return data def login(self): @@ -127,3 +141,86 @@ class RedfishRest(object): payload = { "UserName": self.username, "Password": self.password } self.request('POST', SESSION_URL, payload=payload, timeout=20, cmd='login') + def _get_members(self, url): + + data = self.request('GET', url, cmd='get_members') + try: + return data['Members'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + def get_bmc_state(self): + + members = self._get_members(MANAGER_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_bmc_state') + try: + return data['PowerState'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + def get_chassis_power_state(self): + + members = self._get_members(CHASSIS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_chassis_power_state') + try: + return data['PowerState'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + def get_systems_power_state(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_systems_power_state') + try: + return data['PowerState'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + def _get_bmc_actions(self): + + members = self._get_members(MANAGER_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_bmc_actions') + try: + actions = data['Actions']['#Manager.Reset']['ResetType@Redfish.AllowableValues'] + target_url = data['Actions']['#Manager.Reset']['target'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + return (target_url, actions) + + def reboot_bmc(self, optype='warm'): + + target_url, actions = self._get_bmc_actions() + if BMC_RESET_TYPE not in actions: + raise SelfClientException('Unsupport option: %s' % BMC_RESET_TYPE) + + data = { "ResetType": BMC_RESET_TYPE } + return self.request('POST', target_url, payload=data, cmd='set_bmc_state') + + def _get_power_actions(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_power_actions') + try: + actions = data['Actions']['#ComputerSystem.Reset']['ResetType@Redfish.AllowableValues'] + target_url = data['Actions']['#ComputerSystem.Reset']['target'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + return (target_url, actions) + + def set_power_state(self, state): + + target_url, actions = self._get_power_actions() + if POWER_RESET_TYPE[state] not in actions: + raise SelfClientException('Unsupport option: %s' % state) + + data = { "ResetType": POWER_RESET_TYPE[state] } + return self.request('POST', target_url, payload=data, cmd='set_power_state') + + diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py index 1e37e9493..f9ec0e9d1 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py @@ -30,7 +30,7 @@ VERBOSE = False # global variables of rpower POWER_REBOOT_OPTIONS = ('boot', 'reset') -POWER_SET_OPTIONS = ('on', 'off', 'bmcreboot', 'softoff') +POWER_SET_OPTIONS = ('on', 'off', 'bmcreboot') POWER_GET_OPTIONS = ('bmcstate', 'state', 'stat', 'status') class RedfishManager(base.BaseManager): @@ -50,7 +50,7 @@ class RedfishManager(base.BaseManager): # 1, parse args rpower_usage = """ Usage: - rpower [-V|--verbose] [boot|bmcreboot|bmcstate|off|on|reset|softoff|stat|state|status] + rpower [-V|--verbose] [boot|bmcreboot|bmcstate|off|on|reset|stat|state|status] Options: -V --verbose rpower verbose mode. @@ -73,5 +73,14 @@ class RedfishManager(base.BaseManager): # 3, run the subcommands runner = RedfishPowerTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) - DefaultPowerManager().get_power_state(runner) + if action == 'bmcstate': + DefaultPowerManager().get_bmc_state(runner) + elif action == 'bmcreboot': + DefaultPowerManager().reboot_bmc(runner) + elif action in POWER_GET_OPTIONS: + DefaultPowerManager().get_power_state(runner) + elif action in POWER_REBOOT_OPTIONS: + DefaultPowerManager().reboot(runner, optype=action) + else: + DefaultPowerManager().set_power_state(runner, power_state=action) diff --git a/xCAT-server/lib/xcat/plugins/redfish.pm b/xCAT-server/lib/xcat/plugins/redfish.pm new file mode 100644 index 000000000..984860e79 --- /dev/null +++ b/xCAT-server/lib/xcat/plugins/redfish.pm @@ -0,0 +1,242 @@ +#!/usr/bin/perl +### IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html + +package xCAT_plugin::redfish; + +BEGIN + { + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + } +use lib "$::XCATROOT/lib/perl"; +use strict; +use warnings "all"; + +use Getopt::Long; +use xCAT::Usage; +use xCAT::SvrUtils; +use xCAT::AGENT; +use Data::Dumper; + +#------------------------------------------------------- + +=head3 handled_commands + + Return list of commands handled by this plugin + +=cut + +#------------------------------------------------------- + +sub handled_commands { + return { + rbeacon => 'nodehm:mgt', + reventlog => 'nodehm:mgt', + rinv => 'nodehm:mgt', + rpower => 'nodehm:mgt', + rsetboot => 'nodehm:mgt', + rspconfig => 'nodehm:mgt', + rvitals => 'nodehm:mgt', + }; +} + +my %node_info = (); +my $callback; +$::VERBOSE = 0; + +#------------------------------------------------------- + +=head3 preprocess_request + + preprocess the command + +=cut + +#------------------------------------------------------- + +sub preprocess_request { + my $request = shift; + $callback = shift; + my $command = $request->{command}->[0]; + my $noderange = $request->{node}; + my $extrargs = $request->{arg}; + my @exargs = ($request->{arg}); + my @requests; + + if (ref($extrargs)) { + @exargs = @$extrargs; + } + + my $usage_string = xCAT::Usage->parseCommand($command, @exargs); + if ($usage_string) { + $callback->({ data => [$usage_string] }); + $request = {}; + return; + } + + my $parse_result = parse_args($command, $extrargs, $noderange); + if (ref($parse_result) eq 'ARRAY') { + my $error_data; + foreach my $node (@$noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$node: Error: " . "$parse_result->[1]"; + } + $callback->({ errorcode => [$parse_result->[0]], data => [$error_data] }); + $request = {}; + return; + } + + my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN"); + foreach my $snkey (keys %$sn) { + my $reqcopy = {%$request}; + $reqcopy->{node} = $sn->{$snkey}; + $reqcopy->{'_xcatdest'} = $snkey; + $reqcopy->{_xcatpreprocessed}->[0] = 1; + push @requests, $reqcopy; + } + + return \@requests; +} + +#------------------------------------------------------- + +=head3 process_request + + Process the command + +=cut + +#------------------------------------------------------- + +sub process_request { + my $request = shift; + $callback = shift; + + if (!xCAT::AGENT::exists_python_agent()) { + xCAT::MsgUtils->message("E", { data => ["The xCAT Python agent does not exist. Check if xCAT-openbmc-py package is installed on management node and service nodes."] }, $callback); + return; + } + + my $noderange = $request->{node}; + my $check = parse_node_info($noderange); + $callback->({ errorcode => [$check] }) if ($check); + return unless(%node_info); + + my $pid = xCAT::AGENT::start_python_agent(); + if (!defined($pid)) { + xCAT::MsgUtils->message("E", { data => ["Failed to start the xCAT Python agent. Check /var/log/xcat/cluster.log for more information."] }, $callback); + return; + } + + xCAT::AGENT::submit_agent_request($pid, $request, "redfish", \%node_info, $callback); + xCAT::AGENT::wait_agent($pid, $callback); +} + +#------------------------------------------------------- + +=head3 parse_args + + Parse the command line options and operands + +=cut + +#------------------------------------------------------- + +sub parse_args { + my $command = shift; + my $extrargs = shift; + my $noderange = shift; + my $subcommand = undef; + + unless (GetOptions( + 'V|verbose' => \$::VERBOSE, + )) { + return ([ 1, "Error parsing arguments." ]); + } + + if (scalar(@ARGV) >= 2 and ($command =~ /rbeacon|rpower|rvitals/)) { + return ([ 1, "Only one option is supported at the same time for $command" ]); + } elsif (scalar(@ARGV) == 0 and $command =~ /rbeacon|rspconfig|rpower/) { + return ([ 1, "No option specified for $command" ]); + } else { + $subcommand = $ARGV[0]; + } + + if ($command eq "rpower") { + unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) { + return ([ 1, "Unsupported command: $command $subcommand" ]); + } + } else { + return ([ 1, "Unsupported command: $command" ]); + } +} + +#------------------------------------------------------- + +=head3 parse_node_info + + Parse the node information: bmc, bmcip, username, password + +=cut + +#------------------------------------------------------- + +sub parse_node_info { + my $noderange = shift; + my $rst = 0; + + my $passwd_table = xCAT::Table->new('passwd'); + my $passwd_hash = $passwd_table->getAttribs({ 'key' => 'redfish' }, qw(username password)); + + my $my_table = xCAT::Table->new('openbmc'); + my $my_hash = $my_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']); + + foreach my $node (@$noderange) { + if (defined($my_hash->{$node}->[0])) { + if ($my_hash->{$node}->[0]->{'bmc'}) { + $node_info{$node}{bmc} = $my_hash->{$node}->[0]->{'bmc'}; + $node_info{$node}{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($my_hash->{$node}->[0]->{'bmc'}); + } + unless($node_info{$node}{bmc}) { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node); + delete $node_info{$node}; + $rst = 1; + next; + } + unless($node_info{$node}{bmcip}) { + xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info{$node}{bmc}", $callback, $node); + delete $node_info{$node}; + $rst = 1; + next; + } + if ($my_hash->{$node}->[0]->{'username'}) { + $node_info{$node}{username} = $my_hash->{$node}->[0]->{'username'}; + } elsif ($passwd_hash and $passwd_hash->{username}) { + $node_info{$node}{username} = $passwd_hash->{username}; + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node); + delete $node_info{$node}; + $rst = 1; + next; + } + + if ($my_hash->{$node}->[0]->{'password'}) { + $node_info{$node}{password} = $my_hash->{$node}->[0]->{'password'}; + } elsif ($passwd_hash and $passwd_hash->{password}) { + $node_info{$node}{password} = $passwd_hash->{password}; + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node); + delete $node_info{$node}; + $rst = 1; + next; + } + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node); + $rst = 1; + next; + } + } + + return $rst; +} + +1; From 1f1696862121d8edb74e8e9dcec09252fdc660ac Mon Sep 17 00:00:00 2001 From: xuweibj Date: Fri, 21 Dec 2018 00:28:11 -0500 Subject: [PATCH 02/77] rsetboot for redfish support --- .../agent/hwctl/executor/redfish_setboot.py | 51 +++++++++++++++++ .../lib/python/agent/hwctl/redfish_client.py | 57 +++++++++++++++++++ .../lib/python/agent/xcatagent/redfish.py | 43 ++++++++++++++ xCAT-server/lib/xcat/plugins/redfish.pm | 8 +++ 4 files changed, 159 insertions(+) create mode 100644 xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py new file mode 100644 index 000000000..d80f9515a --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# +from __future__ import print_function +import gevent +import time + +from common.task import ParallelNodesCommand +from common.exceptions import SelfClientException, SelfServerException +from hwctl import redfish_client as redfish + +import logging +logger = logging.getLogger('xcatagent') + +class RedfishBootTask(ParallelNodesCommand): + """Executor for setboot-related actions.""" + + def get_state(self, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + state = 'Unknown' + try: + rf.login() + state = rf.get_boot_state() + self.callback.info('%s: %s' % (node, state)) + + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + return state + + def set_state(self, setboot_state, persistant, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + rf.login() + rf.set_boot_state(persistant, setboot_state) + state = rf.get_boot_state() + self.callback.info('%s: %s' % (node, state)) + + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index 463d7e3b9..a3cb838d5 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -32,6 +32,24 @@ POWER_RESET_TYPE = { 'on' : 'ForceOn', } +BOOTSOURCE_SET_STATE = { + "cd" : "Cd", + "def" : "None", + "floppy": "Floppy", + "hd" : 'Hdd', + "net" : "Pxe", + "setup" : "BiosSetup", +} + +BOOTSOURCE_GET_STATE = { + "BiosSetup": "BIOS Setup", + "Floppy" : "Floppy", + "Cd" : "CD/DVD", + "Hdd" : "Hard Drive", + "None" : "boot override inactive", + "Pxe" : "Network", +} + class RedfishRest(object): headers = {'Content-Type': 'application/json'} @@ -223,4 +241,43 @@ class RedfishRest(object): data = { "ResetType": POWER_RESET_TYPE[state] } return self.request('POST', target_url, payload=data, cmd='set_power_state') + def get_boot_state(self): + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_boot_state') + try: + boot_enable = data['Boot']['BootSourceOverrideEnabled'] + if boot_enable == 'Disabled': + return 'boot override inactive' + bootsource = data['Boot']['BootSourceOverrideTarget'] + return BOOTSOURCE_GET_STATE.get(bootsource, bootsource) + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + def _get_boot_actions(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_boot_actions') + try: + actions = data['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + return (target_url, actions) + + def set_boot_state(self, persistant, state): + + target_url, actions = self._get_boot_actions() + target_data = BOOTSOURCE_SET_STATE[state] + if target_data not in actions: + raise SelfClientException('Unsupport option: %s' % state) + + boot_enable = 'Once' + if persistant: + boot_enable = 'Continuous' + if target_data == 'None': + boot_enable = 'Disabled' + data = {'Boot': {'BootSourceOverrideEnabled': boot_enable, "BootSourceOverrideTarget": target_data} } + return self.request('PATCH', target_url, payload=data, cmd='set_boot_state') diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py index f9ec0e9d1..2ecb33b5b 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py @@ -14,7 +14,9 @@ from docopt import docopt,DocoptExit from common import utils from common import exceptions as xcat_exception from hwctl.executor.redfish_power import RedfishPowerTask +from hwctl.executor.redfish_setboot import RedfishBootTask from hwctl.power import DefaultPowerManager +from hwctl.setboot import DefaultBootManager from xcatagent import base import logging @@ -33,6 +35,10 @@ POWER_REBOOT_OPTIONS = ('boot', 'reset') POWER_SET_OPTIONS = ('on', 'off', 'bmcreboot') POWER_GET_OPTIONS = ('bmcstate', 'state', 'stat', 'status') +# global variables of rsetboot +SETBOOT_GET_OPTIONS = ('stat', '') +SETBOOT_SET_OPTIONS = ('cd', 'def', 'default', 'floppy', 'hd', 'net', 'setup') + class RedfishManager(base.BaseManager): def __init__(self, messager, cwd, nodes=None, envs=None): super(RedfishManager, self).__init__(messager, cwd) @@ -84,3 +90,40 @@ class RedfishManager(base.BaseManager): else: DefaultPowerManager().set_power_state(runner, power_state=action) + + def rsetboot(self, nodesinfo, args): + + # 1, parse args + if not args: + args = ['stat'] + + rsetboot_usage = """ + Usage: + rsetboot [-V|--verbose] [cd|def|default|floppy||hd|net|stat|setup] [-p] + + Options: + -V --verbose rsetboot verbose mode. + -p persistant boot source. + """ + + try: + opts = docopt(rsetboot_usage, argv=args) + + self.verbose = opts.pop('--verbose') + action_type = opts.pop('-p') + action = [k for k,v in opts.items() if v][0] + except Exception as e: + self.messager.error("Failed to parse arguments for rsetboot: %s" % args) + return + + # 2, validate the args + if action not in (SETBOOT_GET_OPTIONS + SETBOOT_SET_OPTIONS): + self.messager.error("Not supported subcommand for rsetboot: %s" % action) + return + + # 3, run the subcommands + runner = RedfishBootTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + if action in SETBOOT_GET_OPTIONS: + DefaultBootManager().get_boot_state(runner) + else: + DefaultBootManager().set_boot_state(runner, setboot_state=action, persistant=action_type) diff --git a/xCAT-server/lib/xcat/plugins/redfish.pm b/xCAT-server/lib/xcat/plugins/redfish.pm index 984860e79..fe8cd4d15 100644 --- a/xCAT-server/lib/xcat/plugins/redfish.pm +++ b/xCAT-server/lib/xcat/plugins/redfish.pm @@ -165,6 +165,14 @@ sub parse_args { unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } + } elsif ($command eq "rsetboot") { + my $persistant; + GetOptions('p' => \$persistant); + return ([ 1, "Only one option is supported at the same time for $command" ]) if (@ARGV > 1); + $subcommand = "stat" if (!defined($ARGV[0])); + unless ($subcommand =~ /^net$|^hd$|^cd$|^def$|^default$|^stat$|^setup$|^floppy$/) { + return ([ 1, "Unsupported command: $command $subcommand" ]); + } } else { return ([ 1, "Unsupported command: $command" ]); } From fae4c21d8f34e1a2c42a49976fe88d8b410348c5 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Fri, 21 Dec 2018 00:35:44 -0500 Subject: [PATCH 03/77] recover --- .../agent/hwctl/executor/redfish_setboot.py | 51 ---------------- .../lib/python/agent/hwctl/redfish_client.py | 58 ------------------- .../lib/python/agent/xcatagent/redfish.py | 42 -------------- xCAT-server/lib/xcat/plugins/redfish.pm | 8 --- 4 files changed, 159 deletions(-) delete mode 100644 xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py deleted file mode 100644 index d80f9515a..000000000 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_setboot.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python -############################################################################### -# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html -############################################################################### -# -*- coding: utf-8 -*- -# -from __future__ import print_function -import gevent -import time - -from common.task import ParallelNodesCommand -from common.exceptions import SelfClientException, SelfServerException -from hwctl import redfish_client as redfish - -import logging -logger = logging.getLogger('xcatagent') - -class RedfishBootTask(ParallelNodesCommand): - """Executor for setboot-related actions.""" - - def get_state(self, **kw): - - node = kw['node'] - rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, - debugmode=self.debugmode, verbose=self.verbose) - - state = 'Unknown' - try: - rf.login() - state = rf.get_boot_state() - self.callback.info('%s: %s' % (node, state)) - - except (SelfServerException, SelfClientException) as e: - self.callback.error(e.message, node) - - return state - - def set_state(self, setboot_state, persistant, **kw): - - node = kw['node'] - rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, - debugmode=self.debugmode, verbose=self.verbose) - - try: - rf.login() - rf.set_boot_state(persistant, setboot_state) - state = rf.get_boot_state() - self.callback.info('%s: %s' % (node, state)) - - except (SelfServerException, SelfClientException) as e: - self.callback.error(e.message, node) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index a3cb838d5..cb1d21f60 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -32,24 +32,6 @@ POWER_RESET_TYPE = { 'on' : 'ForceOn', } -BOOTSOURCE_SET_STATE = { - "cd" : "Cd", - "def" : "None", - "floppy": "Floppy", - "hd" : 'Hdd', - "net" : "Pxe", - "setup" : "BiosSetup", -} - -BOOTSOURCE_GET_STATE = { - "BiosSetup": "BIOS Setup", - "Floppy" : "Floppy", - "Cd" : "CD/DVD", - "Hdd" : "Hard Drive", - "None" : "boot override inactive", - "Pxe" : "Network", -} - class RedfishRest(object): headers = {'Content-Type': 'application/json'} @@ -241,43 +223,3 @@ class RedfishRest(object): data = { "ResetType": POWER_RESET_TYPE[state] } return self.request('POST', target_url, payload=data, cmd='set_power_state') - def get_boot_state(self): - - members = self._get_members(SYSTEMS_URL) - target_url = members[0]['@odata.id'] - data = self.request('GET', target_url, cmd='get_boot_state') - try: - boot_enable = data['Boot']['BootSourceOverrideEnabled'] - if boot_enable == 'Disabled': - return 'boot override inactive' - bootsource = data['Boot']['BootSourceOverrideTarget'] - return BOOTSOURCE_GET_STATE.get(bootsource, bootsource) - except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) - - def _get_boot_actions(self): - - members = self._get_members(SYSTEMS_URL) - target_url = members[0]['@odata.id'] - data = self.request('GET', target_url, cmd='get_boot_actions') - try: - actions = data['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'] - except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) - - return (target_url, actions) - - def set_boot_state(self, persistant, state): - - target_url, actions = self._get_boot_actions() - target_data = BOOTSOURCE_SET_STATE[state] - if target_data not in actions: - raise SelfClientException('Unsupport option: %s' % state) - - boot_enable = 'Once' - if persistant: - boot_enable = 'Continuous' - if target_data == 'None': - boot_enable = 'Disabled' - data = {'Boot': {'BootSourceOverrideEnabled': boot_enable, "BootSourceOverrideTarget": target_data} } - return self.request('PATCH', target_url, payload=data, cmd='set_boot_state') diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py index 2ecb33b5b..7bbc81381 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py @@ -14,7 +14,6 @@ from docopt import docopt,DocoptExit from common import utils from common import exceptions as xcat_exception from hwctl.executor.redfish_power import RedfishPowerTask -from hwctl.executor.redfish_setboot import RedfishBootTask from hwctl.power import DefaultPowerManager from hwctl.setboot import DefaultBootManager @@ -35,10 +34,6 @@ POWER_REBOOT_OPTIONS = ('boot', 'reset') POWER_SET_OPTIONS = ('on', 'off', 'bmcreboot') POWER_GET_OPTIONS = ('bmcstate', 'state', 'stat', 'status') -# global variables of rsetboot -SETBOOT_GET_OPTIONS = ('stat', '') -SETBOOT_SET_OPTIONS = ('cd', 'def', 'default', 'floppy', 'hd', 'net', 'setup') - class RedfishManager(base.BaseManager): def __init__(self, messager, cwd, nodes=None, envs=None): super(RedfishManager, self).__init__(messager, cwd) @@ -90,40 +85,3 @@ class RedfishManager(base.BaseManager): else: DefaultPowerManager().set_power_state(runner, power_state=action) - - def rsetboot(self, nodesinfo, args): - - # 1, parse args - if not args: - args = ['stat'] - - rsetboot_usage = """ - Usage: - rsetboot [-V|--verbose] [cd|def|default|floppy||hd|net|stat|setup] [-p] - - Options: - -V --verbose rsetboot verbose mode. - -p persistant boot source. - """ - - try: - opts = docopt(rsetboot_usage, argv=args) - - self.verbose = opts.pop('--verbose') - action_type = opts.pop('-p') - action = [k for k,v in opts.items() if v][0] - except Exception as e: - self.messager.error("Failed to parse arguments for rsetboot: %s" % args) - return - - # 2, validate the args - if action not in (SETBOOT_GET_OPTIONS + SETBOOT_SET_OPTIONS): - self.messager.error("Not supported subcommand for rsetboot: %s" % action) - return - - # 3, run the subcommands - runner = RedfishBootTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) - if action in SETBOOT_GET_OPTIONS: - DefaultBootManager().get_boot_state(runner) - else: - DefaultBootManager().set_boot_state(runner, setboot_state=action, persistant=action_type) diff --git a/xCAT-server/lib/xcat/plugins/redfish.pm b/xCAT-server/lib/xcat/plugins/redfish.pm index fe8cd4d15..984860e79 100644 --- a/xCAT-server/lib/xcat/plugins/redfish.pm +++ b/xCAT-server/lib/xcat/plugins/redfish.pm @@ -165,14 +165,6 @@ sub parse_args { unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } - } elsif ($command eq "rsetboot") { - my $persistant; - GetOptions('p' => \$persistant); - return ([ 1, "Only one option is supported at the same time for $command" ]) if (@ARGV > 1); - $subcommand = "stat" if (!defined($ARGV[0])); - unless ($subcommand =~ /^net$|^hd$|^cd$|^def$|^default$|^stat$|^setup$|^floppy$/) { - return ([ 1, "Unsupported command: $command $subcommand" ]); - } } else { return ([ 1, "Unsupported command: $command" ]); } From 878d2726ea5c22e9d8e98981b57c1a005ec362f7 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 4 Jan 2019 02:30:20 -0500 Subject: [PATCH 04/77] add a new case updatenode_syncfile_EXECUTEALWAYS_noderange_hierarchy to cover test for bug 5755 --- xCAT-test/autotest/testcase/updatenode/cases0 | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index f917cae2f..f864c7ec2 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -525,3 +525,33 @@ cmd:chtab key=xcatdebugmode site.value=0 check:rc==0 end +start:updatenode_syncfile_EXECUTEALWAYS_noderange_hierarchy +label:others,updatenode +description:this teast case is to verify bug #5755,synclist: EXECUTEALWAYS ignore noderange. This test case should be executed on mn with hierarchy environment, with at least 2 installed diskful cn.In this case, $$CN and $$C2 are the 2 compute nodes. +cmd:xdsh $$CN,$$C2 rm /tmp/file.post +cmd:xdsh $$CN,$$C2 rm /tmp/test +cmd:echo "echo hello >> /tmp/test" > /tmp/file.post +check:rc==0 +cmd:chmod a+x /tmp/file.post +cmd:echo "/tmp/file.post -> ($$CN) /tmp/file.post" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +check:rc==0 +cmd:updatenode $$CN -F +check:rc==0 +cmd:xdsh $$CN "cat /tmp/test" +check:rc==0 +check:output=~hello +cmd:updatenode $$C2 -F +check:rc==0 +cmd:xdsh $$C2 ls /tmp/file.post +check:rc!=0 +cmd:xdsh $$C2 "cat /tmp/test" +check:rc!=0 +check:output!=~hello +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists= +check:rc==0 +cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +check:rc==0 +end From a8eab805fddba0b77793b153b4cac7dfd553669a Mon Sep 17 00:00:00 2001 From: xuweibj Date: Mon, 7 Jan 2019 21:55:16 -0500 Subject: [PATCH 05/77] modify depending on discussion and comments --- .../hwctl/{executor => openbmc}/__init__.py | 0 .../{executor => openbmc}/openbmc_beacon.py | 0 .../openbmc_bmcconfig.py | 0 .../{executor => openbmc}/openbmc_eventlog.py | 0 .../{executor => openbmc}/openbmc_flash.py | 0 .../openbmc_inventory.py | 0 .../{executor => openbmc}/openbmc_power.py | 0 .../{executor => openbmc}/openbmc_sensor.py | 0 .../{executor => openbmc}/openbmc_setboot.py | 0 .../python/agent/hwctl/redfish/__init__.py | 0 .../{executor => redfish}/redfish_power.py | 0 .../lib/python/agent/hwctl/redfish_client.py | 16 +++-- .../lib/python/agent/xcatagent/openbmc.py | 14 ++-- .../lib/python/agent/xcatagent/redfish.py | 3 +- xCAT-server/lib/perl/xCAT/AGENT.pm | 71 +++++++++++++++++++ xCAT-server/lib/xcat/plugins/openbmc2.pm | 70 +----------------- xCAT-server/lib/xcat/plugins/redfish.pm | 71 +------------------ 17 files changed, 91 insertions(+), 154 deletions(-) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/__init__.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_beacon.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_bmcconfig.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_eventlog.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_flash.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_inventory.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_power.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_sensor.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_setboot.py (100%) create mode 100644 xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => redfish}/redfish_power.py (100%) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/__init__.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/__init__.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/__init__.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/__init__.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_beacon.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_beacon.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_setboot.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index cb1d21f60..b8321d07b 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -32,6 +32,10 @@ POWER_RESET_TYPE = { 'on' : 'ForceOn', } +manager_reset_string = '#Manager.Reset' +system_reset_string = '#ComputerSystem.Reset' +reset_type_string = 'ResetType@Redfish.AllowableValues' + class RedfishRest(object): headers = {'Content-Type': 'application/json'} @@ -185,8 +189,8 @@ class RedfishRest(object): target_url = members[0]['@odata.id'] data = self.request('GET', target_url, cmd='get_bmc_actions') try: - actions = data['Actions']['#Manager.Reset']['ResetType@Redfish.AllowableValues'] - target_url = data['Actions']['#Manager.Reset']['target'] + actions = data['Actions'][manager_reset_string][reset_type_string] + target_url = data['Actions'][manager_reset_string]['target'] except KeyError as e: raise SelfServerException('Get KeyError %s' % e.message) @@ -196,7 +200,7 @@ class RedfishRest(object): target_url, actions = self._get_bmc_actions() if BMC_RESET_TYPE not in actions: - raise SelfClientException('Unsupport option: %s' % BMC_RESET_TYPE) + raise SelfClientException('Unsupported option: %s' % BMC_RESET_TYPE) data = { "ResetType": BMC_RESET_TYPE } return self.request('POST', target_url, payload=data, cmd='set_bmc_state') @@ -207,8 +211,8 @@ class RedfishRest(object): target_url = members[0]['@odata.id'] data = self.request('GET', target_url, cmd='get_power_actions') try: - actions = data['Actions']['#ComputerSystem.Reset']['ResetType@Redfish.AllowableValues'] - target_url = data['Actions']['#ComputerSystem.Reset']['target'] + actions = data['Actions'][system_reset_string][reset_type_string] + target_url = data['Actions'][system_reset_string]['target'] except KeyError as e: raise SelfServerException('Get KeyError %s' % e.message) @@ -218,7 +222,7 @@ class RedfishRest(object): target_url, actions = self._get_power_actions() if POWER_RESET_TYPE[state] not in actions: - raise SelfClientException('Unsupport option: %s' % state) + raise SelfClientException('Unsupported option: %s' % state) data = { "ResetType": POWER_RESET_TYPE[state] } return self.request('POST', target_url, payload=data, cmd='set_power_state') diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 080ddef5e..3b96dca62 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -14,13 +14,13 @@ from docopt import docopt,DocoptExit from common import utils from common import exceptions as xcat_exception -from hwctl.executor.openbmc_beacon import OpenBMCBeaconTask -from hwctl.executor.openbmc_setboot import OpenBMCBootTask -from hwctl.executor.openbmc_flash import OpenBMCFlashTask -from hwctl.executor.openbmc_inventory import OpenBMCInventoryTask -from hwctl.executor.openbmc_power import OpenBMCPowerTask -from hwctl.executor.openbmc_sensor import OpenBMCSensorTask -from hwctl.executor.openbmc_eventlog import OpenBMCEventlogTask +from hwctl.openbmc.openbmc_beacon import OpenBMCBeaconTask +from hwctl.openbmc.openbmc_setboot import OpenBMCBootTask +from hwctl.openbmc.openbmc_flash import OpenBMCFlashTask +from hwctl.openbmc.openbmc_inventory import OpenBMCInventoryTask +from hwctl.openbmc.openbmc_power import OpenBMCPowerTask +from hwctl.openbmc.openbmc_sensor import OpenBMCSensorTask +from hwctl.openbmc.openbmc_eventlog import OpenBMCEventlogTask from hwctl.beacon import DefaultBeaconManager from hwctl.setboot import DefaultBootManager from hwctl.flash import DefaultFlashManager diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py index 7bbc81381..322f651cc 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py @@ -13,9 +13,8 @@ from docopt import docopt,DocoptExit from common import utils from common import exceptions as xcat_exception -from hwctl.executor.redfish_power import RedfishPowerTask +from hwctl.redfish.redfish_power import RedfishPowerTask from hwctl.power import DefaultPowerManager -from hwctl.setboot import DefaultBootManager from xcatagent import base import logging diff --git a/xCAT-server/lib/perl/xCAT/AGENT.pm b/xCAT-server/lib/perl/xCAT/AGENT.pm index aee201cbe..c44ea71d7 100644 --- a/xCAT-server/lib/perl/xCAT/AGENT.pm +++ b/xCAT-server/lib/perl/xCAT/AGENT.pm @@ -33,6 +33,77 @@ my %module_type = ( "redfish" => "Redfish", ); +#------------------------------------------------------- + +=head3 parse_node_info + + Parse the node information: bmc, bmcip, username, password + +=cut + +#------------------------------------------------------- +sub parse_node_info { + my $noderange = shift; + my $module = shift; + my $node_info_ref = shift; + my $callback = shift; + my $rst = 0; + + my $passwd_table = xCAT::Table->new('passwd'); + my $passwd_hash = $passwd_table->getAttribs({ 'key' => $module }, 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($openbmc_hash->{$node}->[0])) { + if ($openbmc_hash->{$node}->[0]->{'bmc'}) { + $node_info_ref->{$node}->{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'}; + $node_info_ref->{$node}->{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($openbmc_hash->{$node}->[0]->{'bmc'}); + } + unless($node_info_ref->{$node}->{bmc}) { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + unless($node_info_ref->{$node}->{bmcip}) { + xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info_ref->{$node}->{bmc}", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + if ($openbmc_hash->{$node}->[0]->{'username'}) { + $node_info_ref->{$node}->{username} = $openbmc_hash->{$node}->[0]->{'username'}; + } elsif ($passwd_hash and $passwd_hash->{username}) { + $node_info_ref->{$node}->{username} = $passwd_hash->{username}; + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + + if ($openbmc_hash->{$node}->[0]->{'password'}) { + $node_info_ref->{$node}->{password} = $openbmc_hash->{$node}->[0]->{'password'}; + } elsif ($passwd_hash and $passwd_hash->{password}) { + $node_info_ref->{$node}->{password} = $passwd_hash->{password}; + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node); + $rst = 1; + next; + } + } + + return $rst; +} + sub acquire_lock { my $ppid = shift; $ppid = shift if (($ppid) && ($ppid =~ /AGENT/)); diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index a70a2f5ee..4a73fdcfb 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -141,7 +141,7 @@ sub process_request { } my $noderange = $request->{node}; - my $check = parse_node_info($noderange); + my $check = xCAT::AGENT::parse_node_info($noderange, "openbmc", \%node_info, $callback); if (&refactor_args($request)) { xCAT::MsgUtils->message("E", { data => ["Failed to refactor arguments"] }, $callback); return; @@ -418,74 +418,6 @@ sub parse_args { #------------------------------------------------------- -=head3 parse_node_info - - Parse the node information: bmc, bmcip, username, password - -=cut - -#------------------------------------------------------- -sub parse_node_info { - my $noderange = shift; - my $rst = 0; - - 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($openbmc_hash->{$node}->[0])) { - if ($openbmc_hash->{$node}->[0]->{'bmc'}) { - $node_info{$node}{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'}; - $node_info{$node}{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($openbmc_hash->{$node}->[0]->{'bmc'}); - } - unless($node_info{$node}{bmc}) { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - unless($node_info{$node}{bmcip}) { - xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info{$node}{bmc}", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - 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("Error: Unable to get attribute username", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - - 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("Error: Unable to get attribute password", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - } else { - xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node); - $rst = 1; - next; - } - } - - return $rst; -} - -#------------------------------------------------------- - =head3 refactor_args refractor args to be easily dealt by python client diff --git a/xCAT-server/lib/xcat/plugins/redfish.pm b/xCAT-server/lib/xcat/plugins/redfish.pm index 984860e79..491512a7d 100644 --- a/xCAT-server/lib/xcat/plugins/redfish.pm +++ b/xCAT-server/lib/xcat/plugins/redfish.pm @@ -117,7 +117,7 @@ sub process_request { } my $noderange = $request->{node}; - my $check = parse_node_info($noderange); + my $check = xCAT::AGENT::parse_node_info($noderange, "redfish", \%node_info, $callback); $callback->({ errorcode => [$check] }) if ($check); return unless(%node_info); @@ -170,73 +170,4 @@ sub parse_args { } } -#------------------------------------------------------- - -=head3 parse_node_info - - Parse the node information: bmc, bmcip, username, password - -=cut - -#------------------------------------------------------- - -sub parse_node_info { - my $noderange = shift; - my $rst = 0; - - my $passwd_table = xCAT::Table->new('passwd'); - my $passwd_hash = $passwd_table->getAttribs({ 'key' => 'redfish' }, qw(username password)); - - my $my_table = xCAT::Table->new('openbmc'); - my $my_hash = $my_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']); - - foreach my $node (@$noderange) { - if (defined($my_hash->{$node}->[0])) { - if ($my_hash->{$node}->[0]->{'bmc'}) { - $node_info{$node}{bmc} = $my_hash->{$node}->[0]->{'bmc'}; - $node_info{$node}{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($my_hash->{$node}->[0]->{'bmc'}); - } - unless($node_info{$node}{bmc}) { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - unless($node_info{$node}{bmcip}) { - xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info{$node}{bmc}", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - if ($my_hash->{$node}->[0]->{'username'}) { - $node_info{$node}{username} = $my_hash->{$node}->[0]->{'username'}; - } elsif ($passwd_hash and $passwd_hash->{username}) { - $node_info{$node}{username} = $passwd_hash->{username}; - } else { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - - if ($my_hash->{$node}->[0]->{'password'}) { - $node_info{$node}{password} = $my_hash->{$node}->[0]->{'password'}; - } elsif ($passwd_hash and $passwd_hash->{password}) { - $node_info{$node}{password} = $passwd_hash->{password}; - } else { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - } else { - xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node); - $rst = 1; - next; - } - } - - return $rst; -} - 1; From 1b2ab1cb720ca9cbf27fb1f8fcba19668e9fa314 Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Tue, 8 Jan 2019 17:36:45 +0800 Subject: [PATCH 06/77] refine test case xcatd_start (#5932) --- xCAT-test/autotest/testcase/xcatd/case0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/xcatd/case0 b/xCAT-test/autotest/testcase/xcatd/case0 index 3720bc169..4a8203f15 100644 --- a/xCAT-test/autotest/testcase/xcatd/case0 +++ b/xCAT-test/autotest/testcase/xcatd/case0 @@ -10,7 +10,7 @@ check:output=~Active: active \(running\)|xcatd service is running cmd:ps axjf |grep -v grep |grep "xcatd:" | tee /tmp/xcatd_start/original_xcatd_processes_status check:rc==0 cmd:cat /tmp/xcatd_start/original_xcatd_processes_status |wc -l -check:output=~6 +#check:output=~6 cmd:service xcatd stop check:rc==0 cmd:sleep 3 From 9d36c4d25e363c5019d81cbc56f60158b6f0a638 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 8 Jan 2019 16:06:26 -0500 Subject: [PATCH 07/77] Update small text in the diskful support example for cuda_power9_setup Fix small issue mentioned in 5852 --- docs/source/advanced/gpu/nvidia/osimage/rhels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst index 11c3d11cd..9608fb3f7 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst @@ -189,7 +189,7 @@ xCAT includes a script, ``cuda_power9_setup`` as example, to help user handle th Diskful osimage ^^^^^^^^^^^^^^^ -For diskful deployment, there is no need to change the osimage definition. Instead, add this postscript to your compute node postbootscrtips list. :: +For diskful deployment, there is no need to change the osimage definition. Instead, add this postscript to your compute node postscripts list. :: chdef p9compute -p postscripts=cuda_power9_setup From 62574abb75c08f6758b4c2fbddd7935fd068ae9d Mon Sep 17 00:00:00 2001 From: xuweibj Date: Fri, 21 Dec 2018 00:29:18 -0500 Subject: [PATCH 08/77] rsetboot for redfish support --- .../hwctl/{executor => openbmc}/__init__.py | 0 .../{executor => openbmc}/openbmc_beacon.py | 0 .../openbmc_bmcconfig.py | 0 .../{executor => openbmc}/openbmc_eventlog.py | 0 .../{executor => openbmc}/openbmc_flash.py | 0 .../openbmc_inventory.py | 0 .../{executor => openbmc}/openbmc_power.py | 0 .../{executor => openbmc}/openbmc_sensor.py | 0 .../{executor => openbmc}/openbmc_setboot.py | 0 .../python/agent/hwctl/redfish/__init__.py | 0 .../{executor => redfish}/redfish_power.py | 0 .../agent/hwctl/redfish/redfish_setboot.py | 51 +++++++++++++ .../lib/python/agent/hwctl/redfish_client.py | 73 +++++++++++++++++-- .../lib/python/agent/xcatagent/openbmc.py | 14 ++-- .../lib/python/agent/xcatagent/redfish.py | 45 +++++++++++- xCAT-server/lib/xcat/plugins/redfish.pm | 8 ++ 16 files changed, 177 insertions(+), 14 deletions(-) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/__init__.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_beacon.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_bmcconfig.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_eventlog.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_flash.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_inventory.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_power.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_sensor.py (100%) rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => openbmc}/openbmc_setboot.py (100%) create mode 100644 xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py rename xCAT-openbmc-py/lib/python/agent/hwctl/{executor => redfish}/redfish_power.py (100%) create mode 100644 xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/__init__.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/__init__.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/__init__.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/__init__.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_beacon.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_beacon.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_setboot.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/redfish_power.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py new file mode 100644 index 000000000..d80f9515a --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# +from __future__ import print_function +import gevent +import time + +from common.task import ParallelNodesCommand +from common.exceptions import SelfClientException, SelfServerException +from hwctl import redfish_client as redfish + +import logging +logger = logging.getLogger('xcatagent') + +class RedfishBootTask(ParallelNodesCommand): + """Executor for setboot-related actions.""" + + def get_state(self, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + state = 'Unknown' + try: + rf.login() + state = rf.get_boot_state() + self.callback.info('%s: %s' % (node, state)) + + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + return state + + def set_state(self, setboot_state, persistant, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + rf.login() + rf.set_boot_state(persistant, setboot_state) + state = rf.get_boot_state() + self.callback.info('%s: %s' % (node, state)) + + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index 463d7e3b9..c08ac54fa 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -32,6 +32,28 @@ POWER_RESET_TYPE = { 'on' : 'ForceOn', } +manager_reset_string = '#Manager.Reset' +system_reset_string = '#ComputerSystem.Reset' +reset_type_string = 'ResetType@Redfish.AllowableValues' + +BOOTSOURCE_SET_STATE = { + "cd" : "Cd", + "def" : "None", + "floppy": "Floppy", + "hd" : 'Hdd', + "net" : "Pxe", + "setup" : "BiosSetup", +} + +BOOTSOURCE_GET_STATE = { + "BiosSetup": "BIOS Setup", + "Floppy" : "Floppy", + "Cd" : "CD/DVD", + "Hdd" : "Hard Drive", + "None" : "boot override inactive", + "Pxe" : "Network", +} + class RedfishRest(object): headers = {'Content-Type': 'application/json'} @@ -185,8 +207,8 @@ class RedfishRest(object): target_url = members[0]['@odata.id'] data = self.request('GET', target_url, cmd='get_bmc_actions') try: - actions = data['Actions']['#Manager.Reset']['ResetType@Redfish.AllowableValues'] - target_url = data['Actions']['#Manager.Reset']['target'] + actions = data['Actions'][manager_reset_string][reset_type_string] + target_url = data['Actions'][manager_reset_string]['target'] except KeyError as e: raise SelfServerException('Get KeyError %s' % e.message) @@ -196,7 +218,7 @@ class RedfishRest(object): target_url, actions = self._get_bmc_actions() if BMC_RESET_TYPE not in actions: - raise SelfClientException('Unsupport option: %s' % BMC_RESET_TYPE) + raise SelfClientException('Unsupported option: %s' % BMC_RESET_TYPE) data = { "ResetType": BMC_RESET_TYPE } return self.request('POST', target_url, payload=data, cmd='set_bmc_state') @@ -207,8 +229,8 @@ class RedfishRest(object): target_url = members[0]['@odata.id'] data = self.request('GET', target_url, cmd='get_power_actions') try: - actions = data['Actions']['#ComputerSystem.Reset']['ResetType@Redfish.AllowableValues'] - target_url = data['Actions']['#ComputerSystem.Reset']['target'] + actions = data['Actions'][system_reset_string][reset_type_string] + target_url = data['Actions'][system_reset_string]['target'] except KeyError as e: raise SelfServerException('Get KeyError %s' % e.message) @@ -218,9 +240,48 @@ class RedfishRest(object): target_url, actions = self._get_power_actions() if POWER_RESET_TYPE[state] not in actions: - raise SelfClientException('Unsupport option: %s' % state) + raise SelfClientException('Unsupported option: %s' % state) data = { "ResetType": POWER_RESET_TYPE[state] } return self.request('POST', target_url, payload=data, cmd='set_power_state') + def get_boot_state(self): + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_boot_state') + try: + boot_enable = data['Boot']['BootSourceOverrideEnabled'] + if boot_enable == 'Disabled': + return 'boot override inactive' + bootsource = data['Boot']['BootSourceOverrideTarget'] + return BOOTSOURCE_GET_STATE.get(bootsource, bootsource) + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + def _get_boot_actions(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_boot_actions') + try: + actions = data['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.message) + + return (target_url, actions) + + def set_boot_state(self, persistant, state): + + target_url, actions = self._get_boot_actions() + target_data = BOOTSOURCE_SET_STATE[state] + if target_data not in actions: + raise SelfClientException('Unsupported option: %s' % state) + + boot_enable = 'Once' + if persistant: + boot_enable = 'Continuous' + if target_data == 'None': + boot_enable = 'Disabled' + data = {'Boot': {'BootSourceOverrideEnabled': boot_enable, "BootSourceOverrideTarget": target_data} } + return self.request('PATCH', target_url, payload=data, cmd='set_boot_state') diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 080ddef5e..3b96dca62 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -14,13 +14,13 @@ from docopt import docopt,DocoptExit from common import utils from common import exceptions as xcat_exception -from hwctl.executor.openbmc_beacon import OpenBMCBeaconTask -from hwctl.executor.openbmc_setboot import OpenBMCBootTask -from hwctl.executor.openbmc_flash import OpenBMCFlashTask -from hwctl.executor.openbmc_inventory import OpenBMCInventoryTask -from hwctl.executor.openbmc_power import OpenBMCPowerTask -from hwctl.executor.openbmc_sensor import OpenBMCSensorTask -from hwctl.executor.openbmc_eventlog import OpenBMCEventlogTask +from hwctl.openbmc.openbmc_beacon import OpenBMCBeaconTask +from hwctl.openbmc.openbmc_setboot import OpenBMCBootTask +from hwctl.openbmc.openbmc_flash import OpenBMCFlashTask +from hwctl.openbmc.openbmc_inventory import OpenBMCInventoryTask +from hwctl.openbmc.openbmc_power import OpenBMCPowerTask +from hwctl.openbmc.openbmc_sensor import OpenBMCSensorTask +from hwctl.openbmc.openbmc_eventlog import OpenBMCEventlogTask from hwctl.beacon import DefaultBeaconManager from hwctl.setboot import DefaultBootManager from hwctl.flash import DefaultFlashManager diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py index f9ec0e9d1..1d66178ab 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py @@ -13,8 +13,10 @@ from docopt import docopt,DocoptExit from common import utils from common import exceptions as xcat_exception -from hwctl.executor.redfish_power import RedfishPowerTask +from hwctl.redfish.redfish_power import RedfishPowerTask +from hwctl.redfish.redfish_setboot import RedfishBootTask from hwctl.power import DefaultPowerManager +from hwctl.setboot import DefaultBootManager from xcatagent import base import logging @@ -33,6 +35,10 @@ POWER_REBOOT_OPTIONS = ('boot', 'reset') POWER_SET_OPTIONS = ('on', 'off', 'bmcreboot') POWER_GET_OPTIONS = ('bmcstate', 'state', 'stat', 'status') +# global variables of rsetboot +SETBOOT_GET_OPTIONS = ('stat', '') +SETBOOT_SET_OPTIONS = ('cd', 'def', 'default', 'floppy', 'hd', 'net', 'setup') + class RedfishManager(base.BaseManager): def __init__(self, messager, cwd, nodes=None, envs=None): super(RedfishManager, self).__init__(messager, cwd) @@ -84,3 +90,40 @@ class RedfishManager(base.BaseManager): else: DefaultPowerManager().set_power_state(runner, power_state=action) + + def rsetboot(self, nodesinfo, args): + + # 1, parse args + if not args: + args = ['stat'] + + rsetboot_usage = """ + Usage: + rsetboot [-V|--verbose] [cd|def|default|floppy||hd|net|stat|setup] [-p] + + Options: + -V --verbose rsetboot verbose mode. + -p persistant boot source. + """ + + try: + opts = docopt(rsetboot_usage, argv=args) + + self.verbose = opts.pop('--verbose') + action_type = opts.pop('-p') + action = [k for k,v in opts.items() if v][0] + except Exception as e: + self.messager.error("Failed to parse arguments for rsetboot: %s" % args) + return + + # 2, validate the args + if action not in (SETBOOT_GET_OPTIONS + SETBOOT_SET_OPTIONS): + self.messager.error("Not supported subcommand for rsetboot: %s" % action) + return + + # 3, run the subcommands + runner = RedfishBootTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + if action in SETBOOT_GET_OPTIONS: + DefaultBootManager().get_boot_state(runner) + else: + DefaultBootManager().set_boot_state(runner, setboot_state=action, persistant=action_type) diff --git a/xCAT-server/lib/xcat/plugins/redfish.pm b/xCAT-server/lib/xcat/plugins/redfish.pm index 984860e79..fe8cd4d15 100644 --- a/xCAT-server/lib/xcat/plugins/redfish.pm +++ b/xCAT-server/lib/xcat/plugins/redfish.pm @@ -165,6 +165,14 @@ sub parse_args { unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } + } elsif ($command eq "rsetboot") { + my $persistant; + GetOptions('p' => \$persistant); + return ([ 1, "Only one option is supported at the same time for $command" ]) if (@ARGV > 1); + $subcommand = "stat" if (!defined($ARGV[0])); + unless ($subcommand =~ /^net$|^hd$|^cd$|^def$|^default$|^stat$|^setup$|^floppy$/) { + return ([ 1, "Unsupported command: $command $subcommand" ]); + } } else { return ([ 1, "Unsupported command: $command" ]); } From dac5b6963e8d4651d2fdb931220ba3c1441981d0 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 9 Jan 2019 08:41:48 -0500 Subject: [PATCH 09/77] Fix issue 5933: xCAT-openbmc-py build failed --- xCAT-openbmc-py/debian/dirs | 3 ++- xCAT-openbmc-py/xCAT-openbmc-py.spec | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xCAT-openbmc-py/debian/dirs b/xCAT-openbmc-py/debian/dirs index 305257b08..91077fa40 100644 --- a/xCAT-openbmc-py/debian/dirs +++ b/xCAT-openbmc-py/debian/dirs @@ -2,4 +2,5 @@ opt/xcat/lib/python/agent opt/xcat/lib/python/agent/xcatagent opt/xcat/lib/python/agent/common opt/xcat/lib/python/agent/hwctl -opt/xcat/lib/python/agent/hwctl/executor +opt/xcat/lib/python/agent/hwctl/openbmc +opt/xcat/lib/python/agent/hwctl/redfish diff --git a/xCAT-openbmc-py/xCAT-openbmc-py.spec b/xCAT-openbmc-py/xCAT-openbmc-py.spec index e40044c0e..36f9342e9 100644 --- a/xCAT-openbmc-py/xCAT-openbmc-py.spec +++ b/xCAT-openbmc-py/xCAT-openbmc-py.spec @@ -36,12 +36,14 @@ install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl -install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/executor +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent install -m644 lib/python/agent/common/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common install -m644 lib/python/agent/hwctl/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl -install -m644 lib/python/agent/hwctl/executor/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/executor +install -m644 lib/python/agent/hwctl/openbmc/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc/ +install -m644 lib/python/agent/hwctl/redfish/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish/ %ifnos linux rm -rf $RPM_BUILD_ROOT/%{prefix}/lib/python/agent From 9864626131111b6af1d7acc3ff4c0edb75bfd0d0 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 10 Jan 2019 01:18:05 -0500 Subject: [PATCH 10/77] update cases for EXECUTEALWAYS will only execute syncfile in the syncfile list --- xCAT-test/autotest/testcase/updatenode/cases0 | 69 +++++++++++++++---- 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index f864c7ec2..3e30ba4f8 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -525,31 +525,74 @@ cmd:chtab key=xcatdebugmode site.value=0 check:rc==0 end -start:updatenode_syncfile_EXECUTEALWAYS_noderange_hierarchy +start:updatenode_syncfile_EXECUTE_EXECUTEALWAYS_noderange label:others,updatenode -description:this teast case is to verify bug #5755,synclist: EXECUTEALWAYS ignore noderange. This test case should be executed on mn with hierarchy environment, with at least 2 installed diskful cn.In this case, $$CN and $$C2 are the 2 compute nodes. -cmd:xdsh $$CN,$$C2 rm /tmp/file.post -cmd:xdsh $$CN,$$C2 rm /tmp/test -cmd:echo "echo hello >> /tmp/test" > /tmp/file.post +description:this teast case is to verify pr #5834. This test case should be executed on mn with hierarchy environment, with 2 comput nodes.In this case, $$CN and $$C2 are the 2 compute nodes. +cmd:xdsh $$CN,$$C2 rm /tmp/file.post1 /tmp/file.post2 +cmd:xdsh $$CN,$$C2 rm /tmp/test1 /tmp/test2 +cmd:echo "echo hello1 >> /tmp/test1" > /tmp/file.post1 check:rc==0 -cmd:chmod a+x /tmp/file.post -cmd:echo "/tmp/file.post -> ($$CN) /tmp/file.post" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "echo hello2 >> /tmp/test2" > /tmp/file.post2 +check:rc==0 +cmd:chmod a+x /tmp/file.post1 /tmp/file.post2 +cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__ +cmd:echo "/tmp/file.post1 -> ($$CN) /tmp/file.post1" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post2 -> ($$C2) /tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "/tmp/file.post" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist check:rc==0 cmd:updatenode $$CN -F +check:output=~File synchronization has completed check:rc==0 -cmd:xdsh $$CN "cat /tmp/test" +cmd:xdsh $$CN "cat /tmp/test1" check:rc==0 -check:output=~hello +check:output=~hello1 +cmd:xdsh $$CN "rm -rf /tmp/test1" +check:rc==0 +cmd:updatenode $$CN -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$CN "cat /tmp/test1" +check:rc!=0 cmd:updatenode $$C2 -F +check:output=~File synchronization has completed check:rc==0 -cmd:xdsh $$C2 ls /tmp/file.post +cmd:xdsh $$C2 ls /tmp/file.post2 +check:rc==0 +cmd:xdsh $$C2 "cat /tmp/test2" +check:rc==0 +check:output=~hello2 +cmd:xdsh $$C2 "rm -rf /tmp/test2" +check:rc==0 +cmd:updatenode $$C2 -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$C2 ls /tmp/file.post2 +check:rc==0 +cmd:xdsh $$C2 "cat /tmp/test2" +check:rc==0 +check:output=~hello2 +cmd:xdsh $$C2 rm -rf /tmp/file.post2 /tmp/test2 +cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1 -> ($$CN) /tmp/file.post1" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1 -> ($$C2) /tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +check:rc==0 +cmd:updatenode $$C2 -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$C2 ls /tmp/file.post2 check:rc!=0 -cmd:xdsh $$C2 "cat /tmp/test" +cmd:xdsh $$C2 "cat /tmp/test2" check:rc!=0 -check:output!=~hello +check:output!=~hello2 cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists= check:rc==0 cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist From ff17948b670b83bff0913f779d80ab0fae12cb18 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 11 Jan 2019 02:09:39 -0500 Subject: [PATCH 11/77] Add retry mechanism into makedhcp_remote_network test case to avoid makedhcp timing issue --- xCAT-test/autotest/testcase/makedhcp/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 818ca9173..c5848e7ed 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -213,7 +213,7 @@ cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; cmd:makedhcp testnode check:rc==0 cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then a="/var/lib/dhcp/db/dhcpd.leases"; elif [ -f "/var/lib/dhcp/dhcpd.leases" ]; then a="/var/lib/dhcp/dhcpd.leases";fi; ls -l $a; cat $a -cmd:makedhcp -q testnode +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q testnode);[ $? -ne 0 ] && exit 1;echo $output|grep testnode 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 check:output=~testnode: ip-address = 100.100.100.2 cmd:makedhcp -d testnode From de351fbd476b21bf5a9047f63fb57f7ecef87511 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 11 Jan 2019 02:43:12 -0500 Subject: [PATCH 12/77] Fix remoteshell compatibility with custom Match (#5936) If a user has a custom Match directive, remoteshell would create an invalid configuration. Fix by ensuring we are outside of a match context by doing Match all explicitly. --- xCAT/postscripts/remoteshell | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 0c266d9b6..1a8b1c2b5 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -59,6 +59,7 @@ then logger -t $log_label -p local4.info "remoteshell: setup /etc/ssh/sshd_config and ssh_config" cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG #delete all occurance of the attribute and then add xCAT settings + echo "Match all" >>/etc/ssh/sshd_config sed -i '/X11Forwarding /'d /etc/ssh/sshd_config echo "X11Forwarding yes" >>/etc/ssh/sshd_config sed -i '/MaxStartups /'d /etc/ssh/sshd_config From 739c19ab3f0b5867f6e909ac9317e1277a8debd2 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 11 Jan 2019 02:46:24 -0500 Subject: [PATCH 13/77] update to make the wait time longer --- xCAT-test/autotest/testcase/makedhcp/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index c5848e7ed..54fad0433 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -213,7 +213,7 @@ cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; cmd:makedhcp testnode check:rc==0 cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then a="/var/lib/dhcp/db/dhcpd.leases"; elif [ -f "/var/lib/dhcp/dhcpd.leases" ]; then a="/var/lib/dhcp/dhcpd.leases";fi; ls -l $a; cat $a -cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q testnode);[ $? -ne 0 ] && exit 1;echo $output|grep testnode 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +cmd:a=2;while true; do [ $a -eq 64 ] && exit 1;output=$(makedhcp -q testnode);[ $? -ne 0 ] && exit 1;echo $output|grep testnode 2>/dev/null && exit 0;a=$[$a*2];sleep $a;done check:rc==0 check:output=~testnode: ip-address = 100.100.100.2 cmd:makedhcp -d testnode From e2939f6605e00f7de36661cc97f3cb4e3af59a44 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 11 Jan 2019 02:53:29 -0500 Subject: [PATCH 14/77] implement a script to achieve retry mechanism against rinstall --- .../testcase/commoncmd/retry_install.sh | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 xCAT-test/autotest/testcase/commoncmd/retry_install.sh diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh new file mode 100755 index 000000000..176236dc2 --- /dev/null +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -0,0 +1,60 @@ +#!/bin/bash +echo "Try to retry rinstall 5 times ......" + +declare -i installsuccess=0 +declare -i a=0 +declare -i tryreinstall=1 +node=$1 +osimage=$2 + +for (( tryreinstall = 1 ; tryreinstall < 6 ; ++tryreinstall )) +do + echo "Try to install $node on the $tryreinstall time..." + + echo "rinstall $node osimage=$osimage" + rinstall $node osimage=$osimage + if [ $? != 0 ];then + echo "rinstall failed, double check xcat command rinstall to see if it is a bug..." + exit 1 + fi + + #sleep while for installation. + sleep 360 + while [ ! `lsdef -l $node|grep status|grep booted` ] + do + sleep 10 + echo "The status is not booted..." + a=++a + if [ $a -gt 400 ];then + a=0 + break + fi + done + + lsdef -l $node|grep status|grep booted + tobooted=$? + echo "The tobooted is $tobooted" + + ping -c 2 $node + pingable=$? + echo "The pingable is $pingable" + + xdsh $node date + canruncmd=$? + echo "The canruncmd is $canruncmd" + + if [[ $canruncmd -eq 0 && $tobooted -eq 0 && $pingable -eq 0 ]];then + echo "The provision succeed on the $tryreinstall time....." + installsuccess=1 + break + fi + +done + +if [ $installsuccess -eq 1 ];then + echo "The provision succeed......" + exit 0 +else + echo "The provision failed......" + exit 1 +fi From 7dbe381b5ab5e6b6958477fc533e882ff4f5b16f Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 11 Jan 2019 03:25:47 -0500 Subject: [PATCH 15/77] update script to add repeat times --- xCAT-test/autotest/testcase/commoncmd/retry_install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index 176236dc2..9b8652872 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -7,7 +7,15 @@ declare -i tryreinstall=1 node=$1 osimage=$2 -for (( tryreinstall = 1 ; tryreinstall < 6 ; ++tryreinstall )) +if [ $# -eq 3 ]; +then + times=$3+1 +else + times=6 +fi + + +for (( tryreinstall = 1 ; tryreinstall < $times ; ++tryreinstall )) do echo "Try to install $node on the $tryreinstall time..." From fd99d5b93bdd2603861cd6e48d80a2e2662bca95 Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 14 Jan 2019 01:40:42 -0500 Subject: [PATCH 16/77] add case nodeset_prescripts for Failed to parse the prescripts without action defined --- xCAT-test/autotest/testcase/nodeset/cases2 | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 xCAT-test/autotest/testcase/nodeset/cases2 diff --git a/xCAT-test/autotest/testcase/nodeset/cases2 b/xCAT-test/autotest/testcase/nodeset/cases2 new file mode 100644 index 000000000..a0473d976 --- /dev/null +++ b/xCAT-test/autotest/testcase/nodeset/cases2 @@ -0,0 +1,33 @@ +start:nodeset_prescripts +description:This case is to run test for prescripts actions. This test case should be tested on an provisioned compute node. +os:Linux +label:others +cmd:dir="/install/prescripts/";if [ ! -e "${dir}" ];then mkdir -p $dir; fi +cmd:echo "echo all" >> /install/prescripts/test_prescripts_all.sh;chmod a+x /install/prescripts/test_prescripts_all.sh +check:rc==0 +cmd:echo "echo boot" >> /install/prescripts/test_prescripts_boot.sh;chmod a+x /install/prescripts/test_prescripts_boot.sh +check:rc==0 +cmd:echo "echo osimage" >> /install/prescripts/test_prescripts_osimage.sh;chmod a+x /install/prescripts/test_prescripts_osimage.sh +check:rc==0 +cmd:pre=`lsdef -l $$CN |grep prescripts-begin|awk -F= '{print $2}'`;echo $pre >> /tmp/prescriptssave;chdef $$CN prescripts-begin="test_prescripts_all.sh|boot:test_prescripts_boot.sh|osimage:test_prescripts_osimage.sh" +check:rc==0 +cmd:nodeset $$CN install +check:output=~Running begin script test_prescripts_all.sh for nodes $$CN +check:output!=~test_prescripts_boot.sh +check:output!=~test_prescripts_osimage.sh +cmd:nodeset $$CN boot +check:rc==0 +check:output=~Running begin script test_prescripts_all.sh for nodes $$CN +check:output=~Running begin script test_prescripts_boot.sh for nodes $$CN +check:output!=~test_prescripts_osimage.sh +cmd:nodeset $$CN osimage +check:rc==0 +check:output=~Running begin script test_prescripts_all.sh for nodes $$CN +check:output=~Running begin script test_prescripts_osimage.sh for nodes $$CN +check:output!=~test_prescripts_boot.sh +cmd:rm -rf /install/prescripts/test_prescripts_all.sh /install/prescripts/test_prescripts_boot.sh /install/prescripts/test_prescripts_osimage.sh +cmd:pre=`cat /tmp/prescriptssave`;chdef $$CN prescripts-begin=$pre +check:rc==0 +cmd:rm -rf /tmp/prescriptssave +end + From 0e16c0c1ac475bf477a5ff500fef8ce81c5c09a2 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Mon, 14 Jan 2019 03:35:50 -0500 Subject: [PATCH 17/77] fix issue PR #5936 resulted in remoteshell failed in rhels6.10 #5944 --- xCAT/postscripts/remoteshell | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 1a8b1c2b5..378a7e386 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -59,12 +59,14 @@ then logger -t $log_label -p local4.info "remoteshell: setup /etc/ssh/sshd_config and ssh_config" cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG #delete all occurance of the attribute and then add xCAT settings - echo "Match all" >>/etc/ssh/sshd_config - sed -i '/X11Forwarding /'d /etc/ssh/sshd_config - echo "X11Forwarding yes" >>/etc/ssh/sshd_config sed -i '/MaxStartups /'d /etc/ssh/sshd_config echo "MaxStartups 1024" >>/etc/ssh/sshd_config + echo "Match Host *" >>/etc/ssh/sshd_config + sed -i '/X11Forwarding /'d /etc/ssh/sshd_config + echo "X11Forwarding yes" >>/etc/ssh/sshd_config + + if [ "$SETUPFORPCM" = "1" ]; then if [[ $OSVER == sle* ]];then sed -i '/PasswordAuthentication /'d /etc/ssh/sshd_config From 60686c7a755096e52d6075dee87e0162513eedee Mon Sep 17 00:00:00 2001 From: yangsong Date: Mon, 14 Jan 2019 17:44:19 +0800 Subject: [PATCH 18/77] refine xcat-inventory backend testcase (#5946) --- xCAT-test/autotest/testcase/xcat_inventory/cases.backend | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.backend b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend index b396448a4..029878e6f 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.backend +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend @@ -5,6 +5,7 @@ label:others,inventory_ci cmd: rm -rf /tmp/backend_test/ cmd:rm -rf ~/.xcatinv/inventory.cfg.bak.backend_init check: rc==0 +cmd: mkdir -p ~/.xcatinv/ cmd: [ -f ~/.xcatinv/inventory.cfg ] && mv ~/.xcatinv/inventory.cfg ~/.xcatinv/inventory.cfg.bak.backend_init cmd: cp /opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/templates/inventory.cfg ~/.xcatinv/inventory.cfg cmd: xcat-inventory init From d37f276389d7eb3187c5b57d76fddfd4bc733912 Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 15 Jan 2019 01:21:12 -0500 Subject: [PATCH 19/77] add test case for issue 3602: confignetwork cannot work when regular expression is used in nics table --- .../autotest/testcase/confignetwork/cases1 | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 xCAT-test/autotest/testcase/confignetwork/cases1 diff --git a/xCAT-test/autotest/testcase/confignetwork/cases1 b/xCAT-test/autotest/testcase/confignetwork/cases1 new file mode 100644 index 000000000..590215bbc --- /dev/null +++ b/xCAT-test/autotest/testcase/confignetwork/cases1 @@ -0,0 +1,46 @@ +start:confignetwork_secondarynic_third_regex_updatenode +description:this case is to verify if confignetwork could config serveral nics with regex patten.This case is to verify defect 3602. +label:others,network +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:mkdef -t network -o 30_0_0_0-255_255_0_0 net=30.0.0.0 mask=255.0.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:mkdef -t network -o 40_0_0_0-255_255_0_0 net=40.0.0.0 mask=255.0.0.0 mgtifname=$$THIRDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="|\D+\d+\D+\d+\D+\d+\D+(\d+)|30.0.0.(\$1/1000+9)|" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="30_0_0_0-255_255_0_0" +check:rc==0 +cmd:chdef $$CN nicips.$$THIRDNIC="|\D+\d+\D+\d+\D+\d+\D+(\d+)|40.0.0.(\$1/1000+8)|" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="40_0_0_0-255_255_0_0" +check:rc==0 +cmd:cp /etc/hosts /etc/hosts.bak +cmd:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~$$CN-$$SECONDNIC +check:output=~$$CN-$$THIRDNIC +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.0.0.9 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.0.0.9 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.0.0.9 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~30.0.0.9 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.0.0.8 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.0.0.8 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.0.0.8 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~40.0.0.8 +cmd:rmdef -t network -o 30_0_0_0-255_255_0_0 +cmd:rmdef -t network -o 40_0_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "ip addr del 30.0.0.9/8 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 40.0.0.8/8 dev $$THIRDNIC" +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +end + From 3fc938dea9ae482849f3cd687f9090e28cc46535 Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 15 Jan 2019 01:51:18 -0500 Subject: [PATCH 20/77] add lsdef to get more debug info --- xCAT-test/autotest/testcase/confignetwork/cases1 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/confignetwork/cases1 b/xCAT-test/autotest/testcase/confignetwork/cases1 index 590215bbc..735840e46 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases1 +++ b/xCAT-test/autotest/testcase/confignetwork/cases1 @@ -16,6 +16,7 @@ cmd:chdef $$CN nicips.$$SECONDNIC="|\D+\d+\D+\d+\D+\d+\D+(\d+)|30.0.0.(\$1/1000+ check:rc==0 cmd:chdef $$CN nicips.$$THIRDNIC="|\D+\d+\D+\d+\D+\d+\D+(\d+)|40.0.0.(\$1/1000+8)|" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="40_0_0_0-255_255_0_0" check:rc==0 +cmd:lsdef $$CN cmd:cp /etc/hosts /etc/hosts.bak cmd:rc==0 cmd:makehosts $$CN From 5d2f23a247fa7e14a91e99297d54bf4bba22aebd Mon Sep 17 00:00:00 2001 From: yangsong Date: Tue, 15 Jan 2019 17:15:26 +0800 Subject: [PATCH 21/77] Revert "fix issue PR #5936 resulted in remoteshell failed in rhels6.10 #5944" --- xCAT/postscripts/remoteshell | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 378a7e386..1a8b1c2b5 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -59,13 +59,11 @@ then logger -t $log_label -p local4.info "remoteshell: setup /etc/ssh/sshd_config and ssh_config" cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG #delete all occurance of the attribute and then add xCAT settings - sed -i '/MaxStartups /'d /etc/ssh/sshd_config - echo "MaxStartups 1024" >>/etc/ssh/sshd_config - - echo "Match Host *" >>/etc/ssh/sshd_config + echo "Match all" >>/etc/ssh/sshd_config sed -i '/X11Forwarding /'d /etc/ssh/sshd_config echo "X11Forwarding yes" >>/etc/ssh/sshd_config - + sed -i '/MaxStartups /'d /etc/ssh/sshd_config + echo "MaxStartups 1024" >>/etc/ssh/sshd_config if [ "$SETUPFORPCM" = "1" ]; then if [[ $OSVER == sle* ]];then From 3c95f2b7957ee858c33ceaee77e57ee8cc7a2394 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Tue, 15 Jan 2019 04:25:54 -0500 Subject: [PATCH 22/77] revert PR Fix remoteshell compatibility with custom Match #5936 --- xCAT/postscripts/remoteshell | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 1a8b1c2b5..0c266d9b6 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -59,7 +59,6 @@ then logger -t $log_label -p local4.info "remoteshell: setup /etc/ssh/sshd_config and ssh_config" cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG #delete all occurance of the attribute and then add xCAT settings - echo "Match all" >>/etc/ssh/sshd_config sed -i '/X11Forwarding /'d /etc/ssh/sshd_config echo "X11Forwarding yes" >>/etc/ssh/sshd_config sed -i '/MaxStartups /'d /etc/ssh/sshd_config From eac2932826d2cf62083dbc2fe60ecbce28342dfd Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 16 Jan 2019 02:43:34 -0500 Subject: [PATCH 23/77] Add test case for issue 4511 : rflash -d did not support relative paths --- .../autotest/testcase/rflash/rflash_openbmc.0 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 index e53d25715..0d247ac85 100644 --- a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 +++ b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 @@ -524,3 +524,23 @@ check:rc != 0 check:output =~~$$CN\s*:\s*(\[.*?\]: )?Error: Deleting currently active BMC firmware is not supported end +start:rflash_d_relative_path +description:this case is to check if -d support relative directory path. This case is for issue 4511. +os:Linux +hcp:openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd:lsdef testnode;if [ $? -eq 0 ]; then lsdef -l testnode -z >/tmp/testnode.standa ; rmdef testnode;fi +cmd:mkdef -t node -o testnode groups=all arch=ppc64le bmc=testnode-bmc bmcvlantag=11 cons=openbmc mgt=openbmc +check:rc == 0 +cmd:dir="/tmp/rflashdir";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi +cmd:mkdir -p /tmp/rflashdir;touch /tmp/rflashdir/witherspoon.pnor.squashfs.tar +cmd:cd /tmp;rflash testnode ./rflashdir -d +check:rc != 0 +check:output =~~testnode\s*:\s*Error:\s*Unable to resolved ip address for bmc:\s*testnode-bmc +cmd:dir="/tmp/rflashnotexist/";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi +cmd:cd /tmp;rflash testnode ./rflashnotexist -d +check:rc != 0 +check:output =~~testnode\s*:\s*Error:\s*Invalid option specified with -d:\s*./rflashnotexist +cmd:dir="/tmp/rflashnotexist"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi +cmd:dir="/tmp/rflashdir"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi +end From c76c3c0d451c42cae3c726e158cfebbfcc37e0bf Mon Sep 17 00:00:00 2001 From: tingtli Date: Wed, 16 Jan 2019 16:23:49 +0800 Subject: [PATCH 24/77] Refine cases rmdef_dynamic_group and lsdef_nics to reduce failure for environment (#5955) --- xCAT-test/autotest/testcase/lsdef/cases0 | 2 ++ xCAT-test/autotest/testcase/rmdef/cases0 | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/xCAT-test/autotest/testcase/lsdef/cases0 b/xCAT-test/autotest/testcase/lsdef/cases0 index dbd717f4f..7169dfa08 100644 --- a/xCAT-test/autotest/testcase/lsdef/cases0 +++ b/xCAT-test/autotest/testcase/lsdef/cases0 @@ -214,6 +214,7 @@ end start:lsdef_nics description:lsdef --nics label:mn_only,ci_test,db +cmd:lsdef testnode1;if [ $? -eq 0 ]; then lsdef -l testnode1 -z >/tmp/testnode1.standa ; rmdef testnode1;fi cmd:mkdef -t node -o testnode1 groups=all mgt=ipmi nicips.eth0=1.1.1.1 check:rc==0 cmd:lsdef testnode1 --nics @@ -223,6 +224,7 @@ cmd:rmdef testnode1 check:rc==0 cmd:lsdef testnode1 check:output=~Could not find +cmd:if [ -e /tmp/testnode1.standa ]; then cat /tmp/testnode1.standa | mkdef -z; rm -rf /tmp/testnode1.standa; fi end start:lsdef_template diff --git a/xCAT-test/autotest/testcase/rmdef/cases0 b/xCAT-test/autotest/testcase/rmdef/cases0 index 84c928cfc..e5bea9ce4 100644 --- a/xCAT-test/autotest/testcase/rmdef/cases0 +++ b/xCAT-test/autotest/testcase/rmdef/cases0 @@ -88,6 +88,8 @@ end start:rmdef_dynamic_group description:rmdef to remove dynamic node group label:mn_only,ci_test,db +cmd:lsdef testnode1;if [ $? -eq 0 ]; then lsdef -l testnode1 -z >/tmp/testnode1.standa ; rmdef testnode1;fi +cmd:lsdef testnode2;if [ $? -eq 0 ]; then lsdef -l testnode2 -z >/tmp/testnode2.standa ; rmdef testnode2;fi cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 cmd:mkdef -t group -o dyngrp -d -w mgt==hmc -w cons==hmc -w groups==all,systemp @@ -105,6 +107,8 @@ cmd:rmdef -t group -o dyngrp check:rc==0 cmd:lsdef -t group -o dyngrp check:output=~Could not find an object named 'dyngrp' of type 'group'. +cmd:if [ -e /tmp/testnode1.standa ]; then cat /tmp/testnode1.standa | mkdef -z; rm -rf /tmp/testnode1.standa; fi +cmd:if [ -e /tmp/testnode2.standa ]; then cat /tmp/testnode2.standa | mkdef -z; rm -rf /tmp/testnode2.standa; fi end #start:rmdef_f_all From 5c8b82cd49170531064203855207bb8c96a813d0 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 16 Jan 2019 21:29:19 -0500 Subject: [PATCH 25/77] update according to comments --- xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 index 0d247ac85..9c86c0bae 100644 --- a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 +++ b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 @@ -536,11 +536,15 @@ cmd:dir="/tmp/rflashdir";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi cmd:mkdir -p /tmp/rflashdir;touch /tmp/rflashdir/witherspoon.pnor.squashfs.tar cmd:cd /tmp;rflash testnode ./rflashdir -d check:rc != 0 -check:output =~~testnode\s*:\s*Error:\s*Unable to resolved ip address for bmc:\s*testnode-bmc +check:output =~Error:\s*\[.*?\]:\s*No BMC tar file found in ./rflashdir +check:output =~Error:\s*\[.*?\]:\s*No Host tar file found in ./rflashdir +check:output =~testnode\s*:\s*Error:\s*Unable to resolved ip address for bmc:\s*testnode-bmc cmd:dir="/tmp/rflashnotexist/";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi cmd:cd /tmp;rflash testnode ./rflashnotexist -d check:rc != 0 -check:output =~~testnode\s*:\s*Error:\s*Invalid option specified with -d:\s*./rflashnotexist +check:output =~testnode\s*:\s*Error:\s*Invalid option specified with -d:\s*./rflashnotexist cmd:dir="/tmp/rflashnotexist"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi cmd:dir="/tmp/rflashdir"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi +cmd:rmdef -t node -o testnode +check:rc == 0 end From be311ea8edd860f91847daec73e19d88e60f47f1 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Wed, 16 Jan 2019 21:48:55 -0500 Subject: [PATCH 26/77] remove xcat release info comment line from inventory json files --- .../cluster_invdir/osimage/test_myimage/definition.json | 1 - .../cluster_invdir/osimage/test_myimage2/definition.json | 1 - .../templates/environment/test.environments.osimage.update.json | 1 - .../autotest/testcase/xcat_inventory/templates/osimage.json | 1 - 4 files changed, 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json index 6f4a69076..124cb7e82 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json @@ -18,4 +18,3 @@ }, "schema_version": "1.0" } -#Version 2.14.1 (git commit ac941fd2501e8a581bfcc4c79b9301f6ec37ab93, built Mon May 21 06:15:46 EDT 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json index 9e983695c..f57231432 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json @@ -18,4 +18,3 @@ }, "schema_version": "1.0" } -#Version 2.14.1 (git commit ac941fd2501e8a581bfcc4c79b9301f6ec37ab93, built Mon May 21 06:15:46 EDT 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json index 92b5fa341..12fb845cb 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json @@ -50,4 +50,3 @@ }, "schema_version": "1.0" } -#Version 2.14.4 (git commit 722709b61e63feb7f6d3ee787afa8113eefbe27e, built Wed Sep 26 06:17:57 EDT 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json index 285eb92b1..5f4a4ded2 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json @@ -37,4 +37,3 @@ }, "schema_version": "2.0" } -#Version 2.14.5 (git commit e9d8db94e349c383a6686ecfd853536abe7a8c2b, built Wed Nov 21 06:17:14 EST 2018) From 7dcf289f7de26358af983cce4e981ac5ebb94077 Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 17 Jan 2019 13:46:54 +0800 Subject: [PATCH 27/77] show intermediate directory for debug (#5960) --- xCAT-test/autotest/testcase/xcat_inventory/cases.osimage | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage index 84347595a..476aaa4c1 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage @@ -1040,6 +1040,8 @@ cmd:dir="/opt/inventory/site/osimage";if [ -e "${dir}" ];then mv ${dir} ${dir}". cmd:xcat-inventory export -t osimage -o test_myimage1,test_myimage2 --format json -d /opt/inventory/site/osimage check:rc==0 check:output=~The osimage objects has been exported to directory /opt/inventory/site/osimage +cmd: tree /opt/inventory/site/osimage +check: output =~ site cmd:otherpkglist=`lsdef -t osimage -o test_myimage1 |grep otherpkglist|awk -F= '{print $2}'`;diff -y $otherpkglist /opt/inventory/site/osimage/test_myimage1$otherpkglist check:rc==0 cmd:synclists=`lsdef -t osimage -o test_myimage1 |grep synclists|awk -F= '{print $2}'`;diff -y $synclists /opt/inventory/site/osimage/test_myimage1$synclists From 7c7646a7d52890729a1e5d338a9ca86aae80dfdf Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 17 Jan 2019 14:22:22 +0800 Subject: [PATCH 28/77] refine export_import_multiple_osimages_by_dir to output debug message (#5961) --- xCAT-test/autotest/testcase/xcat_inventory/cases.osimage | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage index 476aaa4c1..efdca513d 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage @@ -1040,7 +1040,7 @@ cmd:dir="/opt/inventory/site/osimage";if [ -e "${dir}" ];then mv ${dir} ${dir}". cmd:xcat-inventory export -t osimage -o test_myimage1,test_myimage2 --format json -d /opt/inventory/site/osimage check:rc==0 check:output=~The osimage objects has been exported to directory /opt/inventory/site/osimage -cmd: tree /opt/inventory/site/osimage +cmd: ls -R /opt/inventory/site/osimage check: output =~ site cmd:otherpkglist=`lsdef -t osimage -o test_myimage1 |grep otherpkglist|awk -F= '{print $2}'`;diff -y $otherpkglist /opt/inventory/site/osimage/test_myimage1$otherpkglist check:rc==0 @@ -1073,7 +1073,8 @@ check:rc==0 cmd: rmdef -t osimage -o test_myimage1,test_myimage2 check:rc==0 cmd:rm -rf /tmp/otherpkglist /tmp/synclists /tmp/postinstall /tmp/exlist /tmp/partitionfile /tmp/pkglist /tmp/template -cmd: tree /opt/inventory/site +cmd: ls -R /opt/inventory/site +check: output =~ site cmd:xcat-inventory import -t osimage -o test_myimage1,test_myimage2 -d /opt/inventory/site check:rc==0 check:output=~The object test_myimage1 has been imported From bb0a82f91ed52faed04bf1cfed056eda80ed653f Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 17 Jan 2019 01:30:42 -0500 Subject: [PATCH 29/77] add node definition restore --- xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 index 9c86c0bae..5cbefb419 100644 --- a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 +++ b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 @@ -547,4 +547,5 @@ cmd:dir="/tmp/rflashnotexist"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; cmd:dir="/tmp/rflashdir"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi cmd:rmdef -t node -o testnode check:rc == 0 +cmd:if [ -e /tmp/testnode.standa ]; then cat /tmp/testnode.standa | mkdef -z; rm -rf /tmp/testnode.standa; fi end From 15bea19b90b5c9215fdb7b1500d29ab0a1178db8 Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 17 Jan 2019 16:44:09 +0800 Subject: [PATCH 30/77] fix test case (#5963) --- xCAT-test/autotest/testcase/xcat_inventory/cases.osimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage index efdca513d..cd6fb34ff 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage @@ -1075,7 +1075,7 @@ check:rc==0 cmd:rm -rf /tmp/otherpkglist /tmp/synclists /tmp/postinstall /tmp/exlist /tmp/partitionfile /tmp/pkglist /tmp/template cmd: ls -R /opt/inventory/site check: output =~ site -cmd:xcat-inventory import -t osimage -o test_myimage1,test_myimage2 -d /opt/inventory/site +cmd:xcat-inventory import -t osimage -o test_myimage1,test_myimage2 -d /opt/inventory/site/osimage check:rc==0 check:output=~The object test_myimage1 has been imported check:output=~The object test_myimage2 has been imported From a6284162948b48132df25fb4fad83f55768935ed Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 17 Jan 2019 21:58:52 -0500 Subject: [PATCH 31/77] refine test cases which were designed in flat originally to support hierarchy --- xCAT-test/autotest/testcase/chtab/cases0 | 2 +- xCAT-test/autotest/testcase/xdcp/cases1 | 10 +++++----- xCAT-test/autotest/testcase/xdsh/cases0 | 2 +- xCAT-test/autotest/testcase/xdsh/cases1 | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/xCAT-test/autotest/testcase/chtab/cases0 b/xCAT-test/autotest/testcase/chtab/cases0 index b0191bd38..68ad379e8 100644 --- a/xCAT-test/autotest/testcase/chtab/cases0 +++ b/xCAT-test/autotest/testcase/chtab/cases0 @@ -79,7 +79,7 @@ description:chtab with error table label:mn_only,ci_test,db cmd:chtab error=error site.comment=error check:rc!=0 -check:output=~no such column|column \"error\" does not exist +check:output=~no such column|column \"error\" does not exist|Unknown column \'error\' end diff --git a/xCAT-test/autotest/testcase/xdcp/cases1 b/xCAT-test/autotest/testcase/xdcp/cases1 index d2b9f9bf1..470f6f7ec 100644 --- a/xCAT-test/autotest/testcase/xdcp/cases1 +++ b/xCAT-test/autotest/testcase/xdcp/cases1 @@ -1,10 +1,10 @@ start:xdcp_nonroot_user label:cn_os_ready,parallel_cmds -cmd:useradd -m xyzzy +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "useradd -m xyzzy";else useradd -m xyzzy;fi check:rc==0 -cmd:bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )" +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "bash -c \"( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )\"";else bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";fi check:rc==0 -cmd:chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh";else chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh;fi check:rc==0 cmd:xdsh $$CN "useradd -m xyzzy" check:rc==0 @@ -12,12 +12,12 @@ cmd:xdsh $$CN "( cd ~ && tar cf - .ssh ) | ( cd ~xyzzy && tar xf - )" check:rc==0 cmd:xdsh $$CN "chown -R xyzzy ~xyzzy/.ssh" check:rc==0 -cmd:su -c "xdcp $$CN /etc/sysctl.conf /tmp/sysctl.conf" - xyzzy +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "su -c \"xdcp $$CN /etc/sysctl.conf /tmp/sysctl.conf\" - xyzzy";else su -c "xdcp $$CN /etc/sysctl.conf /tmp/sysctl.conf" - xyzzy;fi check:rc==0 cmd:xdsh $$CN "stat -c '%U' /tmp/sysctl.conf" check:output=~xyzzy cmd:xdsh $$CN "userdel xyzzy" check:rc==0 -cmd:userdel xyzzy +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "userdel xyzzy";else userdel xyzzy;fi check:rc==0 end diff --git a/xCAT-test/autotest/testcase/xdsh/cases0 b/xCAT-test/autotest/testcase/xdsh/cases0 index bab5e3f52..ff11646b8 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases0 +++ b/xCAT-test/autotest/testcase/xdsh/cases0 @@ -13,7 +13,7 @@ end start:xdsh_regular_command label:cn_os_ready,parallel_cmds -cmd:XCATBYPASS=1 xdsh $$CN "ps -ef" +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$CN "ps -ef";else XCATBYPASS=1 xdsh $$CN "ps -ef";fi check:rc==0 check:output=~$$CN:\s+UID\s+PID\s+PPID\s+C\s+STIME\s+TTY\s+TIME\s+CMD end diff --git a/xCAT-test/autotest/testcase/xdsh/cases1 b/xCAT-test/autotest/testcase/xdsh/cases1 index f097cc54f..5da4adaa9 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases1 +++ b/xCAT-test/autotest/testcase/xdsh/cases1 @@ -3,10 +3,10 @@ description: Test the exit code when command xdsh failed label:cn_os_ready,parallel_cmds cmd:xdsh $$CN date check:rc==0 -cmd:mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup;else mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup;fi check:rc==0 cmd:xdsh $$CN date check:rc!=0 -cmd:mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa;else mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa;fi check:rc==0 end From ac86d0a4fc86c5c9367039216e09603b4aac463a Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 18 Jan 2019 18:10:24 +0800 Subject: [PATCH 32/77] Don't do vpdupdate for updatenode (#5957) * Don't do vpdupdate for updatenode --- xCAT/postscripts/xcatdsklspost | 42 ++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 38ac8ca6a..a06539bbd 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -83,26 +83,6 @@ echolog() } - - - -update_VPD() -{ - if [ -f /usr/sbin/vpdupdate ]; then - vpdupdate - #logger -t xCAT -p local4.info "xcatdsklspost: updating VPD database" - echolog "info" "updating VPD database" - fi -} - -# Run updatevpd only when necessary -if [ -f /usr/sbin/lsvpd ]; then - /usr/sbin/lsvpd | grep -i -E 'cpu|processor' 2>&1 1>/dev/null - if [ "$?" = "1" ]; then - update_VPD - fi -fi - download_postscripts() { server=$1 @@ -304,6 +284,28 @@ else 3|6) MODE=$1;; esac fi + +update_VPD() +{ + if [ -f /usr/sbin/vpdupdate ]; then + echolog "info" "updating VPD database" + vpdupdate + #logger -t xCAT -p local4.info "xcatdsklspost: updating VPD database" + else + echolog "warning" "/usr/sbin/vpdupdate is not available, please check and do VPD update later" + fi +} + +if [ $NODE_DEPLOYMENT -eq 1 ] || [ "$MODE" = "4" ] || [ "$MODE" = "6" ]; then + # Run updatevpd only when necessary + if [ -f /usr/sbin/lsvpd ]; then + /usr/sbin/lsvpd | grep -i -E 'cpu|processor' 2>&1 1>/dev/null + if [ "$?" = "1" ]; then + update_VPD + fi + fi +fi + if [ $NODE_DEPLOYMENT -ne 1 ] && [ $MODE -ne 4 ] ; then echolog "info" "=============updatenode starting====================" fi From 09edffb75041a9376037d857488ed3a48d16ad67 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 23 Jan 2019 01:37:03 -0500 Subject: [PATCH 33/77] update cases to let rinstall try several times --- xCAT-test/autotest/testcase/commoncmd/retry_install.sh | 5 +++-- xCAT-test/autotest/testcase/confignetwork/cases0 | 6 +++--- .../autotest/testcase/installation/SN_diskless_setup_case | 2 +- xCAT-test/autotest/testcase/installation/SN_setup_case | 2 +- .../installation/reg_linux_diskfull_installation_flat | 2 +- .../reg_linux_diskfull_installation_flat_postscripts_failed | 2 +- .../installation/reg_linux_diskfull_installation_hierarchy | 2 +- .../installation/reg_linux_diskless_installation_flat | 2 +- .../reg_linux_diskless_installation_flat_postscripts_failed | 2 +- .../installation/reg_linux_diskless_installation_hierarchy | 2 +- .../installation/reg_linux_statelite_installation_flat | 4 ++-- .../reg_linux_statelite_installation_hierarchy_by_nfs | 2 +- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 2 +- .../installation/ubuntu_full_installation_vm_docker | 2 +- xCAT-test/autotest/testcase/migration/redhat_migration | 4 ++-- xCAT-test/autotest/testcase/migration/sles_migration | 4 ++-- .../autotest/testcase/migration/ubuntu_migration1_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm | 2 +- .../autotest/testcase/migration/ubuntu_migration2_p8le | 2 +- xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm | 2 +- xCAT-test/autotest/testcase/packimg/cases0 | 6 +++--- xCAT-test/autotest/testcase/runcmdinstaller/cases0 | 4 ++-- 22 files changed, 32 insertions(+), 31 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index 9b8652872..4986e344f 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -1,5 +1,4 @@ #!/bin/bash -echo "Try to retry rinstall 5 times ......" declare -i installsuccess=0 declare -i a=0 @@ -10,8 +9,10 @@ osimage=$2 if [ $# -eq 3 ]; then times=$3+1 + echo "Try to retry rinstall $3 times ......" else - times=6 + times=6 + echo "Try to retry rinstall 5 times ......" fi diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 9f9c45e6e..e3de2b730 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -22,7 +22,7 @@ cmd:copycds $$ISO check:rc==0 cmd:chdef $$CN postscripts="confignetwork -s" check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done @@ -70,7 +70,7 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:sleep 180 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done @@ -123,7 +123,7 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:sleep 180 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case index ee1517af5..e0bb70192 100644 --- a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case @@ -84,7 +84,7 @@ cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service check:rc==0 -cmd:rinstall $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service check:rc==0 check:output=~Provision node\(s\)\: $$SN diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 566600ba9..a12dd0112 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -57,7 +57,7 @@ check:rc==0 #cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkgdir="/install/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__" #check:rc==0 -cmd:rinstall $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service check:rc==0 check:output=~Provision node\(s\)\: $$SN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index ee6747707..448cb549a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -41,7 +41,7 @@ cmd:if ! ([[ "__GETNODEATTR($$CN,os)__" = "sles12.1" ]] || [[ "__GETNODEATTR($$C check:rc==0 cmd:lsdef -l $$CN check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed index 511a93fea..4525200de 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed @@ -41,7 +41,7 @@ cmd:chdef $$CN -p postscripts=test check:rc==0 cmd:lsdef -l $$CN check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN 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 b055cf563..4f0de6e43 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -42,7 +42,7 @@ cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ins check:rc==0 cmd:updatenode $$CN -f check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index f183bba92..298f28a3f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -43,7 +43,7 @@ cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index d29e28cd0..66e5e1cfe 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -47,7 +47,7 @@ cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 23354bf69..e8ef0c4e5 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -49,7 +49,7 @@ check:rc==0 cmd:updatenode $$CN -f check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 2b3c37a7b..a3657f637 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -55,7 +55,7 @@ check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -93,7 +93,7 @@ check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 7fdbd8707..e7520a355 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -75,7 +75,7 @@ check:rc==0 cmd:prsync /install $$SN:/ check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 822c68b58..6ad6160c4 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -69,7 +69,7 @@ cmd:prsync /install $$SN:/ check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker index c8e099502..f7a730b1b 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker @@ -21,7 +21,7 @@ cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu14.04" ]];then ver=`cat /etc/*-re check:rc==0 cmd: chdef $$CN -p postbootscripts="setupdockerhost mynet0=$$MYNET0VALUE@$$DOCKERHOSIP:$$NICNAME" check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-dockerhost +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-dockerhost check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index a11f1d807..9e6c618b1 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -32,7 +32,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 @@ -140,7 +140,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 76acbd859..2e429094e 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -31,7 +31,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 @@ -152,7 +152,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 81970abc3..5bd7ce898 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -17,7 +17,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index c980c0702..9171b01e6 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -16,7 +16,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 7fe2080ec..301d31f22 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -17,7 +17,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 300 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index ab47fd759..bd98c5e63 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -16,7 +16,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index a8d51ba00..af7e6e9e6 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -206,7 +206,7 @@ check:output=~archive method:tar check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -257,7 +257,7 @@ check:output=~archive method:tar check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -308,7 +308,7 @@ check:output=~archive method:tar check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/runcmdinstaller/cases0 b/xCAT-test/autotest/testcase/runcmdinstaller/cases0 index d81df8c25..f7d6427aa 100644 --- a/xCAT-test/autotest/testcase/runcmdinstaller/cases0 +++ b/xCAT-test/autotest/testcase/runcmdinstaller/cases0 @@ -10,7 +10,7 @@ description:runcmdinstaller label:others,postscripts cmd:chtab key=xcatdebugmode site.value="2" check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done @@ -25,7 +25,7 @@ description:get xcat post scripts loginfo label:others,postscripts cmd:chtab key=xcatdebugmode site.value="1" check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done From 2537d222e7d923d94dd9370bf8f4a0a0a97cea35 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 23 Jan 2019 02:02:02 -0500 Subject: [PATCH 34/77] refine some packimg cases --- xCAT-test/autotest/testcase/packimg/cases0 | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index af7e6e9e6..09ba0e5f7 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -72,10 +72,7 @@ check:output=~archive method:cpio check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi -check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -118,9 +115,7 @@ check:output=~archive method:cpio check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -160,9 +155,7 @@ check:output=~archive method:cpio check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 From 2efe65c24db497cd500efcf87fa83c939ee07107 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 23 Jan 2019 02:07:19 -0500 Subject: [PATCH 35/77] fix a typo --- xCAT-test/autotest/testcase/packimg/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index 09ba0e5f7..4689157e6 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -73,6 +73,7 @@ check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 From 78e32fadd66bdb35197eb7e2ce9bc0be9dc3ef56 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 23 Jan 2019 03:55:25 -0500 Subject: [PATCH 36/77] configeth support redhat8 --- xCAT/postscripts/configeth | 71 +++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 0dfe77213..e15a3ff8f 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -23,6 +23,15 @@ if [ -z "$UPDATENODE" ] || [ $UPDATENODE -ne 1 ] ; then reboot_nic_bool=0 fi fi +######################################################################## +# networkmanager_active=0: use network.service +# networkmanager_active=1: use NetworkManager +######################################################################## +networkmanager_active=0 +checkservicestatus NetworkManager > /dev/null +if [ $? -eq 0 ]; then + networkmanager_active=1 +fi function configipv4(){ str_if_name=$1 str_v4ip=$2 @@ -115,22 +124,30 @@ function configipv4(){ echo " vlan-raw-device ${parent_device}" >> $str_conf_file fi else + str_prefix=$(v4mask2prefix $str_v4mask) # Write the info to the ifcfg file for redhat + con_name="" str_conf_file="" - if [ $num_v4num -eq 0 ];then - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" - echo "DEVICE=${str_if_name}" > $str_conf_file - else - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}:${num_v4num}" - echo "DEVICE=${str_if_name}:${num_v4num}" > $str_conf_file + if [ $num_v4num -ne 0 ]; then + str_if_name=${str_if_name}:${num_v4num} + fi + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" + if [ $networkmanager_active -eq 1 ]; then + nmcli con show | grep ${str_if_name} + if [ $? -ne 0 ] ; then + nmcli con add type ethernet con-name ${str_if_name} ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} + else + con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^ *//') + nmcli con mod "${con_name}" ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} + fi + else + echo "DEVICE=${str_if_name}" > $str_conf_file + echo "BOOTPROTO=static" >> $str_conf_file + echo "NM_CONTROLLED=no" >> $str_conf_file + echo "IPADDR=${str_v4ip}" >> $str_conf_file + echo "NETMASK=${str_v4mask}" >> $str_conf_file + echo "ONBOOT=yes" >> $str_conf_file fi - - - echo "BOOTPROTO=static" >> $str_conf_file - echo "NM_CONTROLLED=no" >> $str_conf_file - echo "IPADDR=${str_v4ip}" >> $str_conf_file - echo "NETMASK=${str_v4mask}" >> $str_conf_file - echo "ONBOOT=yes" >> $str_conf_file if [ "$str_nic_mtu" != "$str_default_token" ]; then echo "MTU=${str_nic_mtu}" >> $str_conf_file fi @@ -519,7 +536,7 @@ elif [ "$1" = "-s" ];then log_info "configeth on $NODE: config install nic, can not find information from dhcp lease file, return." exit 1 fi - + str_inst_net=$(v4calcnet $str_inst_ip $str_inst_mask) num_index=1 while [ $num_index -le $NETWORKS_LINES ];do @@ -604,13 +621,26 @@ elif [ "$1" = "-s" ];then hostname $NODE echo $NODE > /etc/HOSTNAME else + #write ifcfg-* file for redhat + con_name="" + str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}" - echo "DEVICE=${str_inst_nic}" > $str_conf_file - echo "IPADDR=${str_inst_ip}" >> $str_conf_file - echo "NETMASK=${str_inst_mask}" >> $str_conf_file - echo "BOOTPROTO=static" >> $str_conf_file - echo "ONBOOT=yes" >> $str_conf_file - echo "HWADDR=${str_inst_mac}" >> $str_conf_file + if [ $networkmanager_active -eq 1 ]; then + nmcli con show | grep ${str_inst_nic} + if [ $? -ne 0 ] ; then + nmcli con add type ethernet con-name ${str_inst_nic} ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} + else + con_name=$(nmcli dev show ${str_inst_nic}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^ *//') + nmcli con mod "System ens3" ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} + fi + else + echo "DEVICE=${str_inst_nic}" > $str_conf_file + echo "IPADDR=${str_inst_ip}" >> $str_conf_file + echo "NETMASK=${str_inst_mask}" >> $str_conf_file + echo "BOOTPROTO=static" >> $str_conf_file + echo "ONBOOT=yes" >> $str_conf_file + echo "HWADDR=${str_inst_mac}" >> $str_conf_file + fi if [ -n "${str_inst_mtu}" ];then echo "MTU=${str_inst_mtu}" >> $str_conf_file fi @@ -893,7 +923,6 @@ else bool_modify_flag=0 str_nic_status='down' str_his_file=${str_cfg_dir}xcat_history_important - str_history=`ip addr show dev $str_nic_name | grep inet | grep -iv dynamic | grep -iv link | grep $str_nic_name | awk '{print $2}'` old_ifs=$IFS IFS=$'\n' From db9bee6b1a9a98522a34ba9a6f21716d5e394894 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 23 Jan 2019 05:40:18 -0500 Subject: [PATCH 37/77] polished --- xCAT/postscripts/configeth | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index e15a3ff8f..151d9766f 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -133,11 +133,10 @@ function configipv4(){ fi str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" if [ $networkmanager_active -eq 1 ]; then - nmcli con show | grep ${str_if_name} - if [ $? -ne 0 ] ; then + con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*$//g') + if [ "$con_name" == "--" ] ; then nmcli con add type ethernet con-name ${str_if_name} ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} else - con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^ *//') nmcli con mod "${con_name}" ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} fi else @@ -536,7 +535,6 @@ elif [ "$1" = "-s" ];then log_info "configeth on $NODE: config install nic, can not find information from dhcp lease file, return." exit 1 fi - str_inst_net=$(v4calcnet $str_inst_ip $str_inst_mask) num_index=1 while [ $num_index -le $NETWORKS_LINES ];do @@ -626,18 +624,17 @@ elif [ "$1" = "-s" ];then str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}" if [ $networkmanager_active -eq 1 ]; then - nmcli con show | grep ${str_inst_nic} - if [ $? -ne 0 ] ; then + con_name=$(nmcli dev show ${str_if_name}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*$//g') + if [ "$con_name" == "--" ] ; then nmcli con add type ethernet con-name ${str_inst_nic} ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} else - con_name=$(nmcli dev show ${str_inst_nic}|grep CONNECTION|awk -F: '{print $2}'|sed 's/^ *//') nmcli con mod "System ens3" ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} fi else echo "DEVICE=${str_inst_nic}" > $str_conf_file echo "IPADDR=${str_inst_ip}" >> $str_conf_file echo "NETMASK=${str_inst_mask}" >> $str_conf_file - echo "BOOTPROTO=static" >> $str_conf_file + echo "BOOTPROTO=none" >> $str_conf_file echo "ONBOOT=yes" >> $str_conf_file echo "HWADDR=${str_inst_mac}" >> $str_conf_file fi From 048847abd2e7e5be37033081bf235b9c04edbc0b Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 23 Jan 2019 05:47:38 -0500 Subject: [PATCH 38/77] polished --- xCAT/postscripts/configeth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 151d9766f..9133ea09a 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -141,7 +141,7 @@ function configipv4(){ fi else echo "DEVICE=${str_if_name}" > $str_conf_file - echo "BOOTPROTO=static" >> $str_conf_file + echo "BOOTPROTO=none" >> $str_conf_file echo "NM_CONTROLLED=no" >> $str_conf_file echo "IPADDR=${str_v4ip}" >> $str_conf_file echo "NETMASK=${str_v4mask}" >> $str_conf_file From f60a97dcb2a422e3b9994f5aaf16b597bdcfdb0e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 26 Jul 2018 16:03:47 -0400 Subject: [PATCH 39/77] Have dhcp.pm recognize OPA hwaddr --- xCAT-server/lib/xcat/plugins/dhcp.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 3e27ead5f..8bd8121bb 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -764,6 +764,8 @@ sub addnode $hostname = $1 . "-hf" . $count; } } + } elsif (length($mac) == 23) { + $hardwaretype = 32; } #syslog("local4|err", "Setting $node ($hname|$ip) to " . $mac); From efd8406757b6a937f83ec451244f06ad08a7658e Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 23 Jan 2019 22:27:40 -0500 Subject: [PATCH 40/77] refine cases to fix bug 5974,5975 --- xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle | 1 - .../installation/reg_linux_statelite_installation_flat | 2 +- xCAT-test/autotest/testcase/runcmdinstaller/cases0 | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle index 2ffd3fd2d..9f8403be7 100644 --- a/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle @@ -311,7 +311,6 @@ makentp_v makentp_h nodeset_check_warninginfo runcmdinstaller_h -runcmdinstaller_command get_xcat_postscripts_loginfo updatenode_postscripts_loginfo bmcdiscover_h diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index a3657f637..4858d75e5 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -93,7 +93,7 @@ check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/runcmdinstaller/cases0 b/xCAT-test/autotest/testcase/runcmdinstaller/cases0 index f7d6427aa..d81df8c25 100644 --- a/xCAT-test/autotest/testcase/runcmdinstaller/cases0 +++ b/xCAT-test/autotest/testcase/runcmdinstaller/cases0 @@ -10,7 +10,7 @@ description:runcmdinstaller label:others,postscripts cmd:chtab key=xcatdebugmode site.value="2" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done @@ -25,7 +25,7 @@ description:get xcat post scripts loginfo label:others,postscripts cmd:chtab key=xcatdebugmode site.value="1" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done From 59c1630e76f507680c8e12824cefe9cedc681777 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Thu, 24 Jan 2019 14:36:35 +0800 Subject: [PATCH 41/77] add dnsforwardmode for makedns (#5970) * add forwardmode for makedns * polished * polished * update site table man doc * polished * polished --- .../admin-guides/references/man5/site.5.rst | 5 ++++ perl-xCAT/xCAT/Schema.pm | 4 +++ xCAT-server/lib/xcat/plugins/ddns.pm | 29 ++++++++++++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index 7a3361399..d03af4847 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -135,6 +135,11 @@ site Attributes: service nodes will ignore this value and always be configured to forward to the management node. + dnsforwardmode: (first or only or no). This is to set forward value in named.conf options section. + "first": causes DNS requests to be forwarded before an attempt is made to resolve them via the root name servers. + "only": all requests are forwarded and none sent to the root name servers. + "no": no request will be forwarded. This is the default value if not specified. + emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. master: The hostname of the xCAT management node, as known by the nodes. diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 9ce4d16d7..e792677b8 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1059,6 +1059,10 @@ passed as argument rather than by table value', " requests it does not know to these servers. Note that the DNS servers on the\n" . " service nodes will ignore this value and always be configured to forward \n" . " to the management node.\n\n" . +" dnsforwardmode: (first or only or no). This is to set forward value in named.conf options section. \n" . +" \"first\": causes DNS requests to be forwarded before an attempt is made to resolve them via the root name servers. \n" . +" \"only\": all requests are forwarded and none sent to the root name servers.\n". +" \"no\": no request will be forwarded. This is the default value if not specified. \n\n" . " emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n" . " master: The hostname of the xCAT management node, as known by the nodes.\n\n" . " nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" . diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 229462157..556a217b8 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -785,7 +785,7 @@ sub process_request { "Update Named Conf dir $ctx->{dbdir} $ctx->{zonesdir}"; xCAT::MsgUtils->message("I", $rsp, $callback); } - + $ctx->{forwardmode} = get_forwardmode(); update_namedconf($ctx, $slave); unless ($slave) @@ -935,6 +935,27 @@ sub get_zonesdir { return "$ZonesDir"; } +sub get_forwardmode { + my $forwardmode; + my @entries = xCAT::TableUtils->get_site_attribute("dnsforwardmode"); + my $site_entry = $entries[0]; + if (defined($site_entry)) { + if ($site_entry =~ /^only$|^first$/) { + $forwardmode = $site_entry; + } elsif ($site_entry =~ /^no$/) { + $forwardmode = "" + }else { + my $rsp = {}; + $rsp->{data}->[0] = "forward mode $site_entry is not supported, supported value: only, first, no."; + xCAT::MsgUtils->message("S", "forward mode $site_entry is not supported, supported value: only, first, no."); + xCAT::MsgUtils->message("W", $rsp, $callback); + return; + } + } + return "$forwardmode"; +} + + sub get_conf { my $conf = "/etc/named.conf"; @@ -1114,6 +1135,8 @@ sub update_namedconf { push @newnamed, "\t\t" . $_ . ";\n"; } push @newnamed, "\t};\n"; + } elsif ($ctx->{forwardmode} and $line =~ /forward/) { + push @newnamed, "\tforward " . $ctx->{forwardmode} . ";\n"; } elsif ($ctx->{empty_zones_enable} and $line =~ /empty-zones-enable/) { push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; } elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) { @@ -1255,6 +1278,10 @@ sub update_namedconf { push @newnamed, "\t};\n"; } + if ($ctx->{forwardmode}){ + push @newnamed, "\tforward " . $ctx->{forwardmode} . ";\n"; + } + if ($ctx->{empty_zones_enable}){ push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; } From 7b25dd3c0463baf75a310cbd71cf5c404e2d56f4 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Thu, 24 Jan 2019 01:39:02 -0500 Subject: [PATCH 42/77] add osdistro type in cluster.yaml --- .../templates/testcluster_backend/cluster.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/cluster.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/cluster.yaml index 7b9b261b6..12bc75a13 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/cluster.yaml +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/cluster.yaml @@ -1,3 +1,11 @@ +osdistro: + ubuntu17.10-ppc64el: + arch: ppc64el + basename: ubuntu + dirpaths: /install/ubuntu17.10/ppc64el + majorversion: '17' + minorversion: '10' + type: Linux network: prov: basic_attr: From 3d5cb5ca53d1f00bfa071191cefca5e8b87f17fa Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 24 Jan 2019 03:21:20 -0500 Subject: [PATCH 43/77] update according to comments --- xCAT-test/autotest/testcase/xdcp/cases1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/xdcp/cases1 b/xCAT-test/autotest/testcase/xdcp/cases1 index 470f6f7ec..47c29fdd7 100644 --- a/xCAT-test/autotest/testcase/xdcp/cases1 +++ b/xCAT-test/autotest/testcase/xdcp/cases1 @@ -1,10 +1,10 @@ start:xdcp_nonroot_user label:cn_os_ready,parallel_cmds -cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "useradd -m xyzzy";else useradd -m xyzzy;fi +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "useradd -m xyzzy";useradd -m xyzzy;else useradd -m xyzzy;fi check:rc==0 -cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "bash -c \"( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )\"";else bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";fi +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "bash -c \"( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )\"";bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";else bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";fi check:rc==0 -cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh";else chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh;fi +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh";chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh;else chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh;fi check:rc==0 cmd:xdsh $$CN "useradd -m xyzzy" check:rc==0 @@ -12,12 +12,12 @@ cmd:xdsh $$CN "( cd ~ && tar cf - .ssh ) | ( cd ~xyzzy && tar xf - )" check:rc==0 cmd:xdsh $$CN "chown -R xyzzy ~xyzzy/.ssh" check:rc==0 -cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "su -c \"xdcp $$CN /etc/sysctl.conf /tmp/sysctl.conf\" - xyzzy";else su -c "xdcp $$CN /etc/sysctl.conf /tmp/sysctl.conf" - xyzzy;fi +cmd:su -c "xdcp $$CN /etc/sysctl.conf /tmp/sysctl.conf" - xyzzy check:rc==0 cmd:xdsh $$CN "stat -c '%U' /tmp/sysctl.conf" check:output=~xyzzy cmd:xdsh $$CN "userdel xyzzy" check:rc==0 -cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN "userdel xyzzy";else userdel xyzzy;fi +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "userdel xyzzy";userdel xyzzy;else userdel xyzzy;fi check:rc==0 end From 33c5c3cae17e79a9a1e31df63021608c72aa7496 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Thu, 24 Jan 2019 04:16:24 -0500 Subject: [PATCH 44/77] fix issue nodeset calculate wrong path for deploying sles when using "copycds -p" #5966 --- xCAT-server/lib/xcat/plugins/sles.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 79487429e..7054fb6b3 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -937,14 +937,12 @@ sub mkinstall # trim the "/" in /install/sles11.3/x86_64/ $pkgdir =~ s/\/$//; - if ($pkgdir =~ /^($installroot\/$os\/$arch)$/) { - if ( -d "$pkgdir/2") { - $srcdirs[0] = "$pkgdir/1,$pkgdir/2"; - }else{ - $srcdirs[0] = "$pkgdir/1"; - } - $tmppkgdir = join(",", @srcdirs); + if ( -d "$pkgdir/2") { + $srcdirs[0] = "$pkgdir/1,$pkgdir/2"; + }else{ + $srcdirs[0] = "$pkgdir/1"; } + $tmppkgdir = join(",", @srcdirs); #Call the Template class to do substitution to produce a kickstart file in the autoinst dir my $tmperr; From 1a4b89523bfb6b288f542cd9a157f211d6af122e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 24 Jan 2019 13:44:15 -0500 Subject: [PATCH 45/77] Allow IB/OPA addresses in mac table again The change blocked valid addresses. --- xCAT-server/lib/xcat/plugins/dhcp.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 8bd8121bb..35424a5d5 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -610,7 +610,7 @@ sub addnode $hname = $node; } #Default to hostname equal to nodename unless ($mac) { next; } #Skip corrupt format - if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/) + if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5,7}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5,7}$/) { $callback->( { From 7fbbfc310220b326a28126e39f973472611f54e6 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Fri, 25 Jan 2019 11:23:10 +0800 Subject: [PATCH 46/77] UT cases of functions in redfish_client for redfish python (#5939) * UT cases of login for redfish python and the fixing for found issues --- .../lib/python/agent/hwctl/redfish_client.py | 32 +- .../lib/python/agent/tests/__init__.py | 0 .../lib/python/agent/tests/unit/__init__.py | 0 .../tests/unit/json_data/bmc_action_rsp.json | 19 + .../tests/unit/json_data/chassis_rsp.json | 45 +++ .../unit/json_data/login_no_auth_rsp.json | 18 + .../agent/tests/unit/json_data/login_rsp.json | 10 + .../tests/unit/json_data/manager_rsp.json | 93 +++++ .../tests/unit/json_data/redfish_v1_rsp.json | 42 +++ .../tests/unit/json_data/systems_rsp.json | 86 +++++ .../tests/unit/json_data/with_error_rsp.json | 15 + .../agent/tests/unit/test_hwctl/__init__.py | 0 .../unit/test_hwctl/test_redfish_client.py | 355 ++++++++++++++++++ 13 files changed, 699 insertions(+), 16 deletions(-) create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/__init__.py create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/__init__.py create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/bmc_action_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/chassis_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_no_auth_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/redfish_v1_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/__init__.py create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index 53a35afe1..db9152309 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -32,10 +32,6 @@ POWER_RESET_TYPE = { 'on' : 'ForceOn', } -manager_reset_string = '#Manager.Reset' -system_reset_string = '#ComputerSystem.Reset' -reset_type_string = 'ResetType@Redfish.AllowableValues' - BOOTSOURCE_SET_STATE = { "cd" : "Cd", "def" : "None", @@ -55,6 +51,10 @@ BOOTSOURCE_GET_STATE = { "Pxe" : "Network", } +manager_reset_string = '#Manager.Reset' +system_reset_string = '#ComputerSystem.Reset' +reset_type_string = 'ResetType@Redfish.AllowableValues' + class RedfishRest(object): headers = {'Content-Type': 'application/json'} @@ -101,7 +101,7 @@ class RedfishRest(object): if data: if cmd == 'login': data = data.replace('"Password": "%s"' % self.password, '"Password": "xxxxxx"') - data = '-d \'%s\'' % data + data = '-d \'%s\'' % data msg += '%s %s -v' % (url, data) else: msg += url @@ -170,7 +170,7 @@ class RedfishRest(object): try: return data['Members'] except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) def get_bmc_state(self): @@ -180,7 +180,7 @@ class RedfishRest(object): try: return data['PowerState'] except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) def get_chassis_power_state(self): @@ -190,7 +190,7 @@ class RedfishRest(object): try: return data['PowerState'] except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) def get_systems_power_state(self): @@ -200,7 +200,7 @@ class RedfishRest(object): try: return data['PowerState'] except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) def _get_bmc_actions(self): @@ -211,7 +211,7 @@ class RedfishRest(object): actions = data['Actions'][manager_reset_string][reset_type_string] target_url = data['Actions'][manager_reset_string]['target'] except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) return (target_url, actions) @@ -219,7 +219,7 @@ class RedfishRest(object): target_url, actions = self._get_bmc_actions() if BMC_RESET_TYPE not in actions: - raise SelfClientException('Unsupported option: %s' % BMC_RESET_TYPE) + raise SelfClientException('Unsupported option: %s' % BMC_RESET_TYPE, 403) data = { "ResetType": BMC_RESET_TYPE } return self.request('POST', target_url, payload=data, cmd='set_bmc_state') @@ -233,7 +233,7 @@ class RedfishRest(object): actions = data['Actions'][system_reset_string][reset_type_string] target_url = data['Actions'][system_reset_string]['target'] except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) return (target_url, actions) @@ -241,7 +241,7 @@ class RedfishRest(object): target_url, actions = self._get_power_actions() if POWER_RESET_TYPE[state] not in actions: - raise SelfClientException('Unsupported option: %s' % state) + raise SelfClientException('Unsupported option: %s' % state, 403) data = { "ResetType": POWER_RESET_TYPE[state] } return self.request('POST', target_url, payload=data, cmd='set_power_state') @@ -258,7 +258,7 @@ class RedfishRest(object): bootsource = data['Boot']['BootSourceOverrideTarget'] return BOOTSOURCE_GET_STATE.get(bootsource, bootsource) except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) def _get_boot_actions(self): @@ -268,7 +268,7 @@ class RedfishRest(object): try: actions = data['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'] except KeyError as e: - raise SelfServerException('Get KeyError %s' % e.message) + raise SelfServerException('Get KeyError %s' % e.args) return (target_url, actions) @@ -277,7 +277,7 @@ class RedfishRest(object): target_url, actions = self._get_boot_actions() target_data = BOOTSOURCE_SET_STATE[state] if target_data not in actions: - raise SelfClientException('Unsupported option: %s' % state) + raise SelfClientException('Unsupported option: %s' % state, 403) boot_enable = 'Once' if persistant: diff --git a/xCAT-openbmc-py/lib/python/agent/tests/__init__.py b/xCAT-openbmc-py/lib/python/agent/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/__init__.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/bmc_action_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/bmc_action_rsp.json new file mode 100644 index 000000000..32739dada --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/bmc_action_rsp.json @@ -0,0 +1,19 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo", + "@odata.type": "#ActionInfo.v1_1_0.ActionInfo", + "@odata.id": "/redfish/v1/Managers/BMC/ResetActionInfo", + "Id": "ResetActionInfo", + "Name": "Reset Action Info", + "Parameters": [ + { + "Name": "ResetType", + "Required": true, + "DataType": "String", + "AllowableValues": [ + "ForceRestart", + "GracefulRestart" + ] + } + ], + "Oem": {} +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/chassis_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/chassis_rsp.json new file mode 100644 index 000000000..0538f74f1 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/chassis_rsp.json @@ -0,0 +1,45 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Chassis.Chassis", + "@odata.type": "#Chassis.v1_8_0.Chassis", + "@odata.id": "/redfish/v1/Chassis/Chassis0", + "Id": "Chassis0", + "Name": "OpenPOWER System Chassis", + "ChassisType": "RackMount", + "Manufacturer": "IBM", + "Model": "SYSTEM", + "SerialNumber": "C829UAE15A10564", + "PartNumber": "9006-22P", + "AssetTag": "", + "PowerState": "On", + "IndicatorLED": "Off", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "PhysicalSecurity": { + "IntrusionSensorNumber": 226, + "IntrusionSensor": "HardwareIntrusion", + "IntrusionSensorReArm": "Manual" + }, + "Thermal": { + "@odata.id": "/redfish/v1/Chassis/Chassis0/Thermal" + }, + "Power": { + "@odata.id": "/redfish/v1/Chassis/Chassis0/Power" + }, + "Assembly": { + "@odata.id": "/redfish/v1/Chassis/Chassis0/Assembly" + }, + "Links": { + "ComputerSystems": [ + { + "@odata.id": "/redfish/v1/Systems/Computer" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/BMC" + } + ] + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_no_auth_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_no_auth_rsp.json new file mode 100644 index 000000000..d87bf2998 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_no_auth_rsp.json @@ -0,0 +1,18 @@ +{ + "error": { + "code": "Base.1.4.0.GeneralError", + "message": "A general error has occurred. See Resolution for information on how to resolve the error.", + "@Message.ExtendedInfo": [ + { + "MessageId": "Base.1.4.0.ResourceAtUriUnauthorized", + "Severity": "Critical", + "Resolution": "Ensure that the appropriate access is provided for the service in order for it to access the URI.", + "Message": "While accessing the resource at /redfish/v1/SessionService/Sessions, the service received an authorization error unauthorized.", + "MessageArgs": [ + "/redfish/v1/SessionService/Sessions", + "unauthorized" + ] + } + ] + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_rsp.json new file mode 100644 index 000000000..2edae3953 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_rsp.json @@ -0,0 +1,10 @@ +{ + "@odata.type": "#Session.v1_1_1.Session", + "UserName": "ADMIN", + "Description": "Manager User Session", + "@odata.id": "/redfish/v1/SessionService/Sessions/a6cbc1e29e9cd559", + "@odata.context": "/redfish/v1/$metadata#Session.Session", + "Oem": {}, + "Id": "a6cbc1e29e9cd559", + "Name": "User Session" +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json new file mode 100644 index 000000000..1a03cc082 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json @@ -0,0 +1,93 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Manager.Manager", + "@odata.type": "#Manager.v1_5_0.Manager", + "@odata.id": "/redfish/v1/Managers/BMC", + "Id": "BMC", + "Description": "Aspeed BMC", + "Name": "Manager", + "ManagerType": "BMC", + "UUID": "00000000-0000-0000-0000-000000000", + "Model": "P9DSU 9006-22P", + "DateTime": "2019-01-22T06:22:55+00:00", + "DateTimeLocalOffset": "+00:00", + "FirmwareVersion": "2.04", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "PowerState": "On", + "SerialConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 1, + "ConnectTypesSupported": [ + "IPMI" + ] + }, + "CommandShell": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 0, + "ConnectTypesSupported": [ + "SSH" + ] + }, + "GraphicalConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 4, + "ConnectTypesSupported": [ + "KVMIP" + ] + }, + "EthernetInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/EthernetInterfaces" + }, + "SerialInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/SerialInterfaces" + }, + "NetworkProtocol": { + "@odata.id": "/redfish/v1/Managers/BMC/NetworkProtocol" + }, + "LogServices": { + "@odata.id": "/redfish/v1/Managers/BMC/LogServices" + }, + "VirtualMedia": { + "@odata.id": "/redfish/v1/Managers/BMC/VirtualMedia" + }, + "Links": { + "ManagerForServers": [ + { + "@odata.id": "/redfish/v1/Systems/Computer" + } + ], + "ManagerForChassis": [ + { + "@odata.id": "/redfish/v1/Chassis/Chassis0" + } + ], + "ManagerInChassis": { + "@odata.id": "/redfish/v1/Chassis/Chassis0" + } + }, + "Actions": { + "#Manager.Reset": { + "target": "/redfish/v1/Managers/BMC/Actions/Manager.Reset", + "ResetType@Redfish.AllowableValues": [ + "ForceRestart", + "GracefulRestart" + ] + } + }, + "Oem": { + "Supermicro": { + "@odata.type": "#SMCManager.v1_0_1.SMCManager", + "FanMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/FanMode" + }, + "MouseMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/MouseMode" + }, + "SMTP": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/SMTP" + } + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/redfish_v1_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/redfish_v1_rsp.json new file mode 100644 index 000000000..3f6e2f0ca --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/redfish_v1_rsp.json @@ -0,0 +1,42 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot", + "@odata.type": "#ServiceRoot.v1_4_0.ServiceRoot", + "@odata.id": "/redfish/v1", + "Id": "v1", + "Name": "Root Service", + "RedfishVersion": "1.6.0", + "UUID": "00000000-0000-0000-0000-0CC47AD55B4E", + "SessionService": { + "@odata.id": "/redfish/v1/SessionService" + }, + "AccountService": { + "@odata.id": "/redfish/v1/AccountService" + }, + "Registries": { + "@odata.id": "/redfish/v1/Registries" + }, + "JsonSchemas": { + "@odata.id": "/redfish/v1/JsonSchemas" + }, + "Chassis": { + "@odata.id": "/redfish/v1/Chassis" + }, + "Managers": { + "@odata.id": "/redfish/v1/Managers" + }, + "Systems": { + "@odata.id": "/redfish/v1/Systems" + }, + "UpdateService": { + "@odata.id": "/redfish/v1/UpdateService" + }, + "EventService": { + "@odata.id": "/redfish/v1/EventService" + }, + "Links": { + "Sessions": { + "@odata.id": "/redfish/v1/SessionService/Sessions" + } + }, + "Oem": {} +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json new file mode 100644 index 000000000..caee86e6b --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json @@ -0,0 +1,86 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem", + "@odata.type": "#ComputerSystem.v1_5_0.ComputerSystem", + "@odata.id": "/redfish/v1/Systems/Computer", + "Id": "Computer", + "Name": "OpenPOWER Computer System", + "Description": "OpenPOWER Computer System", + "Status": { + "State": "Enabled", + "Health": "Critical" + }, + "SerialNumber": "C829UAE15A10564", + "PartNumber": "9006-22P", + "Manufacturer": "IBM", + "Model": "SYSTEM", + "SystemType": "Physical", + "BiosVersion": "2.04 20190118", + "UUID": "00000000-0000-0000-0000-0000000000", + "ProcessorSummary": { + "Count": 2, + "Model": "POWER CPU", + "Status": { + "State": "Enabled", + "Health": "OK" + } + }, + "IndicatorLED": "Off", + "PowerState": "On", + "Boot": { + "BootSourceOverrideMode": "Legacy", + "BootSourceOverrideEnabled": "Once", + "BootSourceOverrideTarget": "None", + "BootSourceOverrideTarget@Redfish.AllowableValues": [ + "None", + "Pxe", + "Hdd", + "Diags", + "Cd", + "BiosSetup", + "Usb", + "Floppy" + ] + }, + "HostWatchdogTimer": { + "FunctionEnabled": true, + "WarningAction": "None", + "WarningAction@Redfish.AllowableValues": [ + "None" + ], + "TimeoutAction": "None", + "TimeoutAction@Redfish.AllowableValues": [ + "None", + "ResetSystem", + "PowerDown", + "PowerCycle" + ], + "Status": { + "State": "StandbyOffline" + } + }, + "Links": { + "Chassis": [ + { + "@odata.id": "/redfish/v1/Chassis/chassis0" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/BMC" + } + ] + }, + "Actions": { + "#ComputerSystem.Reset": { + "target": "/redfish/v1/Systems/Computer/Actions/ComputerSystem.Reset", + "ResetType@Redfish.AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "GracefulRestart", + "ForceRestart", + "ForceOn" + ] + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json new file mode 100644 index 000000000..e88ecd915 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json @@ -0,0 +1,15 @@ +{ + "@odata.context":"/redfish/v1/$metadata#ChassisCollection.ChassisCollection", + "@odata.type":"#ChassisCollection.ChassisCollection", + "@odata.id":"/redfish/v1/Chassis", + "error":{ + "Message": "Chassis Collection" + }, + "Description":"Chassis Collection", + "Members":[ + { + "@odata.id":"/redfish/v1/Chassis/Planar" + } + ], + "Members@odata.count":1 +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/__init__.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py new file mode 100644 index 000000000..bc98e66de --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py @@ -0,0 +1,355 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# + +import pytest +import mock +import json +import os +import logging +import time +import requests + +from hwctl import redfish_client as rf +from common.utils import Messager +from common.exceptions import SelfClientException, SelfServerException + +DATA_DIR = os.path.dirname(os.path.realpath(__file__)) + '/../json_data' +logging.basicConfig(level=logging.DEBUG) +REDFISH_URL = '/redfish/v1' + +class TestRedfishClient(object): + + nodeinfo_dict = {'bmc': 'testbmc', 'bmcip': '10.0.0.1', 'username': 'username', 'password': 'password'} + log = logging.getLogger('TestRedfishClient') + rf_rest = rf.RedfishRest(name='testnode', nodeinfo=nodeinfo_dict, messager=Messager(), + debugmode=True, verbose=False) + headers = {'Content-Type': 'application/json'} + with open("%s/redfish_v1_rsp.json" % DATA_DIR,'r') as load_f: + rf_v1 = json.load(load_f) + chassis_url = rf_v1['Chassis']['@odata.id'] + manager_url = rf_v1['Managers']['@odata.id'] + systems_url = rf_v1['Systems']['@odata.id'] + session_url = rf_v1['Links']['Sessions']['@odata.id'] + + def test__init__(self): + assert self.rf_rest.name == 'testnode' + assert self.rf_rest.bmc == 'testbmc' + assert self.rf_rest.bmcip == '10.0.0.1' + assert self.rf_rest.username == 'username' + assert self.rf_rest.password == 'password' + assert isinstance(self.rf_rest.messager, Messager) + assert self.rf_rest.verbose == True + assert self.rf_rest.root_url == 'https://10.0.0.1' + + def test__print_record_log(self): + self.rf_rest._print_record_log("test__print_record_log", "test") + assert self.rf_rest.messager.info + assert time.asctime + + def test__print_error_log(self): + self.rf_rest._print_record_log("test__print_error_log", "test") + assert self.rf_rest._print_record_log + + def test__log_request(self): + self.rf_rest._print_record_log = mock.Mock(return_value=True) + login_data = json.dumps({ "UserName": self.rf_rest.username, "Password": self.rf_rest.password }) + msg_data = login_data.replace('"Password": "%s"' % self.rf_rest.password, '"Password": "xxxxxx"') + test_data = json.dumps({ "Test": True }) + login_msg = 'curl -k -X POST -H "Content-Type: application/json" https://10.0.0.1%s -d \'%s\' -v' % (self.session_url, msg_data) + test_data_msg = 'curl -k -X POST -H "Content-Type: application/json" -H "X-Auth-Token: xxxxxx" https://10.0.0.1/redfish/v1/Managers -d \'%s\' -v' % test_data + get_msg = 'curl -k -X GET -H "Content-Type: application/json" -H "X-Auth-Token: xxxxxx" https://10.0.0.1/redfish/v1/Managers' + assert self.rf_rest._log_request('POST', self.rf_rest.root_url + self.session_url, self.headers, data=login_data, cmd='login') == login_msg + assert self.rf_rest._log_request('POST', self.rf_rest.root_url + self.manager_url, self.headers, data=test_data, cmd='test__log_request') == test_data_msg + assert self.rf_rest._log_request('GET', self.rf_rest.root_url + self.manager_url, self.headers, cmd='test__log_request') == get_msg + + def test_handle_response_not_ok(self): + test_rsp = requests.Response() + test_rsp.status_code = 401 + with open("%s/login_no_auth_rsp.json" % DATA_DIR,'r') as load_f: + test_rsp._content = json.dumps(json.load(load_f)) + with pytest.raises(SelfClientException) as excinfo: + data = self.rf_rest.handle_response(test_rsp, cmd='test_handle_response_not_ok') + assert excinfo.type == SelfClientException + assert 'the service received an authorization error unauthorized' in str(excinfo.value) + + def test_handle_response_no_auth(self): + test_rsp = requests.Response() + test_rsp.status_code = 201 + test_rsp.headers = {} + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + test_rsp._content = json.dumps(json.load(load_f)) + with pytest.raises(SelfServerException) as excinfo: + data = self.rf_rest.handle_response(test_rsp, cmd='login') + assert excinfo.type == SelfServerException + assert 'Login Failed: Did not get Session Token from response' in str(excinfo.value) + + def test_handle_response_name(self): + test_rsp = requests.Response() + test_rsp.status_code = 200 + test_rsp.headers = {'X-Auth-Token': 'abcdefghijklmn'} + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + file_data = json.load(load_f) + test_rsp._content = json.dumps(file_data) + data = self.rf_rest.handle_response(test_rsp, cmd='get_information') + assert data == file_data + + def test_handle_response_error(self): + test_rsp = requests.Response() + test_rsp.status_code = 200 + test_rsp.headers = {'X-Auth-Token': 'abcdefghijklmn'} + with open("%s/with_error_rsp.json" % DATA_DIR,'r') as load_f: + file_data = json.load(load_f) + test_rsp._content = json.dumps(file_data) + data = self.rf_rest.handle_response(test_rsp, cmd='get_information') + assert data == file_data + + def test_request_login_connect_failed(self): + login_data = { "UserName": self.rf_rest.username, "Password": self.rf_rest.password } + self.rf_rest.session.request = mock.Mock(side_effect=SelfServerException('Login to BMC failed: Can\'t connect to')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.request('POST', self.session_url, headers=self.headers, payload=login_data, cmd='login') + assert excinfo.type == SelfServerException + assert 'Login to BMC failed: Can\'t connect to' in str(excinfo.value) + + def test_request_connect_failed(self): + self.rf_rest.session.request = mock.Mock(side_effect=SelfServerException('BMC did not respond. Validate BMC configuration and retry the command.')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.request('GET', self.manager_url, headers=self.headers) + assert excinfo.type == SelfServerException + assert 'BMC did not respond. Validate BMC configuration and retry the command.' in str(excinfo.value) + + def test_request_value_error(self): + self.rf_rest.session.request = mock.Mock(return_value='Mock return value for value error') + self.rf_rest.handle_response = mock.Mock(side_effect=ValueError()) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.request('GET', self.manager_url, headers=self.headers) + assert excinfo.type == SelfServerException + assert 'Received wrong format response:' in str(excinfo.value) + + def test_request_login_success(self): + login_data = json.dumps({ "UserName": self.rf_rest.username, "Password": self.rf_rest.password }) + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + response = json.load(load_f) + self.rf_rest.session.request = mock.Mock(return_value=None) + self.rf_rest.handle_response = mock.Mock(return_value=response) + data = self.rf_rest.request('POST', self.session_url, headers=self.headers, payload=login_data, cmd='login') + assert self.rf_rest.session.request + assert data == response + + def test_login_success(self): + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + login_rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=login_rsp) + assert self.rf_rest.login() == None + + def test_login_not_respond(self): + self.rf_rest.request = mock.Mock(side_effect=SelfServerException('BMC did not respond. Validate BMC configuration and retry the command.')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.login() + assert excinfo.type == SelfServerException + assert 'BMC did not respond. Validate BMC configuration and retry the command.' in str(excinfo.value) + + def test_login_value_error(self): + self.rf_rest.request = mock.Mock(side_effect=SelfServerException('Received wrong format response: xxxxxx')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.login() + assert excinfo.type == SelfServerException + assert 'Received wrong format response:' in str(excinfo.value) + + def test__get_members(self): + resp_data = {"Members": [ {"@odata.id": self.manager_url + "/BMC"} ] } + self.rf_rest.request = mock.Mock(return_value=resp_data) + members = self.rf_rest._get_members(self.manager_url) + assert members == [ {"@odata.id": self.manager_url + "/BMC"} ] + + def test__get_members_keyerror(self): + self.rf_rest.request = mock.Mock(return_value={"key": "value"}) + with pytest.raises(SelfServerException) as excinfo: + members = self.rf_rest._get_members(self.manager_url) + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_get_bmc_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + "/BMC"} ]) + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_bmc_state() == "On" + + def test_get_bmc_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + "/BMC"} ]) + self.rf_rest.request = mock.Mock(return_value={"powerState": "Off"}) + with pytest.raises(SelfServerException) as excinfo: + resp_data = self.rf_rest.get_bmc_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_get_chassis_power_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.chassis_url + '/MotherBoard'} ]) + with open("%s/chassis_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_chassis_power_state() == 'On' + + def test_get_chassis_power_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.chassis_url + '/MotherBoard'} ]) + self.rf_rest.request = mock.Mock(return_value={"Powerstate": "On"}) + with pytest.raises(SelfServerException) as excinfo: + resp_data = self.rf_rest.get_chassis_power_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_get_systems_power_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_systems_power_state() == 'On' + + def test_get_systems_power_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + self.rf_rest.request = mock.Mock(return_value={"powerstate": "On"}) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.get_systems_power_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test__get_bmc_actions(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + reset_string = '#Manager.Reset' + assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues']) + + def test__get_bmc_actions_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + del rsp['Actions']['#Manager.Reset']['ResetType@Redfish.AllowableValues'] + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest._get_bmc_actions() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_reboot_bmc(self): + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest._get_bmc_actions = mock.Mock(return_value=(rsp['Actions']['#Manager.Reset']['target'], ['ForceRestart'])) + self.rf_rest.request = mock.Mock(return_value=None) + assert self.rf_rest.reboot_bmc() == None + assert self.rf_rest.request + + def test_reboot_bmc_unsupported(self): + self.rf_rest._get_bmc_actions = mock.Mock(return_value=(self.manager_url + '/BMC/Reset', ['forcerestart'])) + with pytest.raises(SelfClientException) as excinfo: + self.rf_rest.reboot_bmc() + assert excinfo.type == SelfClientException + assert 'Unsupported option:' in str(excinfo.value) + + def test__get_power_actions(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + reset_string = '#ComputerSystem.Reset' + assert self.rf_rest._get_power_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues']) + + def test__get_power_actions_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + del rsp['Actions']['#ComputerSystem.Reset']['target'] + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest._get_power_actions() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_set_power_state(self): + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + reset_string = '#ComputerSystem.Reset' + self.rf_rest._get_power_actions = mock.Mock(return_value=(rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues'])) + self.rf_rest.request = mock.Mock(return_value=None) + assert self.rf_rest.set_power_state('on') == None + assert self.rf_rest.request + + def test_set_power_state_unsupported(self): + self.rf_rest._get_power_actions = mock.Mock(return_value=(self.systems_url + '/Computer/Reset', ['ForceRestart', 'ForceOff'])) + with pytest.raises(SelfClientException) as excinfo: + self.rf_rest.set_power_state('on') + assert excinfo.type == SelfClientException + assert 'Unsupported option:' in str(excinfo.value) + + def test_get_boot_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_boot_state() == "boot override inactive" + rsp['Boot']['BootSourceOverrideTarget'] = 'Pxe' + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_boot_state() == 'Network' + rsp['Boot']['BootSourceOverrideEnabled'] = 'Disabled' + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_boot_state() == "boot override inactive" + + def test_get_boot_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + del rsp['Boot']['BootSourceOverrideEnabled'] + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.get_boot_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test__get_boot_actions(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest._get_boot_actions() == (self.systems_url + '/Computer', rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues']) + + def test__get_boot_actions_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + del rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'] + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest._get_boot_actions() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_set_boot_state(self): + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest._get_boot_actions = mock.Mock(return_value=(self.systems_url + '/Computer', rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'])) + self.rf_rest.request = mock.Mock(return_value=None) + assert self.rf_rest.set_boot_state(False, 'def') == None + assert self.rf_rest.request + assert self.rf_rest.set_boot_state(True, 'cd') == None + assert self.rf_rest.request + + def test_set_boot_state_unsupported(self): + allow_values = ['cd','def'] + self.rf_rest._get_boot_actions = mock.Mock(return_value=(self.systems_url + '/Computer', allow_values)) + with pytest.raises(SelfClientException) as excinfo: + self.rf_rest.set_boot_state(False, 'hd') + assert excinfo.type == SelfClientException + assert 'Unsupported option:' in str(excinfo.value) + +def test_init_no_bmcip(): + nodeinfo_dict = {'bmc': 'testbmc', 'username': 'username', 'password': 'password'} + rf_rest_new = rf.RedfishRest(name='testnode', nodeinfo=nodeinfo_dict, messager=Messager(), + debugmode=True, verbose=False) + + assert rf_rest_new.bmcip == 'testnode' From 8ef8e593bf79a8ec304c5df85182d0b40cdd81d9 Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 25 Jan 2019 02:29:41 -0500 Subject: [PATCH 47/77] add test case for issue 5888: EXECUTEALWAYS error when another line in the synclist references the same destination node --- xCAT-test/autotest/testcase/updatenode/cases0 | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index 3e30ba4f8..1a109bc53 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -598,3 +598,56 @@ check:rc==0 cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist check:rc==0 end + + +start:updatenode_syncfile_EXECUTEALWAYS_src_dst_diff +label:others,updatenode +description:this teast case is to verify pr #5888. +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -z >> /tmp/myimage.stanza +cmd:xdsh $$CN rm /tmp/h /tmp/script.sh /root/script2.sh /tmp/script2.sh /tmp/script3.sh +cmd:xdsh $$CN rm /tmp/test /tmp/test2 /root/test3 /root/test1 +cmd:echo "echo hello >> /tmp/test" > /tmp/script.sh +check:rc==0 +cmd:echo "echo hello2 >> /tmp/test2" > /tmp/script2.sh +check:rc==0 +cmd:echo "echo hello3 >> /tmp/test3" > /root/script3.sh +check:rc==0 +cmd:echo "echo hello1 >> /tmp/test1" > /root/script1.sh +check:rc==0 +cmd:chmod a+x /tmp/script.sh /tmp/script2.sh /root/script3.sh /root/script1.sh +cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__ +cmd:echo "/etc/hosts -> ($$CN) /tmp/h" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script.sh -> ($$CN) /tmp/script.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script1.sh -> ($$CN) /root/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script2.sh -> ($$CN) /tmp/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script3.sh -> ($$CN) /tmp/script3.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script3.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script1.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +check:rc==0 +cmd:updatenode $$CN -F +check:output=~File synchronization has completed for nodes:\s*"$$CN"\s* +check:rc==0 +cmd:xdsh $$CN ls /tmp/h +check:rc==0 +cmd:xdsh $$CN ls /tmp/test +check:rc==0 +cmd:xdsh $$CN ls /tmp/test2 +check:rc==0 +cmd:xdsh $$CN ls /tmp/test3 +check:rc==0 +cmd:xdsh $$CN ls /tmp/test1 +check:rc==0 +cmd:if [ -e /tmp/myimage.stanza ]; then rmdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute; cat /tmp/myimage.stanza | mkdef -z; rm -rf /tmp/myimage.stanza; fi +check:rc==0 +cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +check:rc==0 +end + + + + + From 6df30438b2f5bf8e619d80e9297721f79389964b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 25 Jan 2019 10:43:20 -0500 Subject: [PATCH 48/77] Add comments to explain the hwtype change --- xCAT-server/lib/xcat/plugins/dhcp.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 35424a5d5..a26c6e492 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -764,7 +764,9 @@ sub addnode $hostname = $1 . "-hf" . $count; } } - } elsif (length($mac) == 23) { + } elsif (length($mac) == 23) { # 8 bytes of mac address + # Currently the only thing that has 8 bytes is an infiniband + # or infiniband like device, which is type 32 (0x20). $hardwaretype = 32; } From 349f5f7b85466910bfe61928f49620c17c6620ef Mon Sep 17 00:00:00 2001 From: xuweibj Date: Sun, 27 Jan 2019 21:02:41 -0500 Subject: [PATCH 49/77] fix issue 5969, handle power actions info format on 2.04 --- .../lib/python/agent/hwctl/redfish_client.py | 23 ++++- .../tests/unit/json_data/manager_rsp.json | 5 +- .../unit/json_data/manager_rsp_v123.json | 93 +++++++++++++++++++ .../unit/json_data/system_action_rsp.json | 23 +++++ .../tests/unit/json_data/systems_rsp.json | 9 +- .../unit/json_data/systems_rsp_v123.json | 86 +++++++++++++++++ .../tests/unit/json_data/with_error_rsp.json | 18 +--- .../unit/test_hwctl/test_redfish_client.py | 28 +++++- 8 files changed, 251 insertions(+), 34 deletions(-) create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp_v123.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/system_action_rsp.json create mode 100644 xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp_v123.json diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index db9152309..0900f63bf 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -54,6 +54,7 @@ BOOTSOURCE_GET_STATE = { manager_reset_string = '#Manager.Reset' system_reset_string = '#ComputerSystem.Reset' reset_type_string = 'ResetType@Redfish.AllowableValues' +reset_action_string = '@Redfish.ActionInfo' class RedfishRest(object): @@ -156,7 +157,7 @@ class RedfishRest(object): if 'Name' in data: self._print_record_log('%s %s' % (code, data['Name']), cmd) elif 'error' in data: - self._print_record_log('%s %s' % (code, data['error']['Message']), cmd) + self._print_record_log('%s %s' % (code, data['error']['message']), cmd) return data def login(self): @@ -207,9 +208,15 @@ class RedfishRest(object): members = self._get_members(MANAGER_URL) target_url = members[0]['@odata.id'] data = self.request('GET', target_url, cmd='get_bmc_actions') + try: - actions = data['Actions'][manager_reset_string][reset_type_string] - target_url = data['Actions'][manager_reset_string]['target'] + actions_dict = data['Actions'][manager_reset_string] + target_url = actions_dict['target'] + if reset_action_string in actions_dict: + action_info = self.request('GET', actions_dict[reset_action_string], cmd='get_bmc_actions') + actions = action_info['Parameters'][0]['AllowableValues'] + else: + actions = actions_dict[reset_type_string] except KeyError as e: raise SelfServerException('Get KeyError %s' % e.args) @@ -229,9 +236,15 @@ class RedfishRest(object): members = self._get_members(SYSTEMS_URL) target_url = members[0]['@odata.id'] data = self.request('GET', target_url, cmd='get_power_actions') + try: - actions = data['Actions'][system_reset_string][reset_type_string] - target_url = data['Actions'][system_reset_string]['target'] + actions_dict = data['Actions'][system_reset_string] + target_url = actions_dict['target'] + if reset_action_string in actions_dict: + action_info = self.request('GET', actions_dict[reset_action_string], cmd='get_power_actions') + actions = action_info['Parameters'][0]['AllowableValues'] + else: + actions = actions_dict[reset_type_string] except KeyError as e: raise SelfServerException('Get KeyError %s' % e.args) diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json index 1a03cc082..99c1a768a 100644 --- a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json @@ -70,10 +70,7 @@ "Actions": { "#Manager.Reset": { "target": "/redfish/v1/Managers/BMC/Actions/Manager.Reset", - "ResetType@Redfish.AllowableValues": [ - "ForceRestart", - "GracefulRestart" - ] + "@Redfish.ActionInfo": "/redfish/v1/Managers/BMC/ResetActionInfo" } }, "Oem": { diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp_v123.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp_v123.json new file mode 100644 index 000000000..38c406265 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp_v123.json @@ -0,0 +1,93 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Manager.Manager", + "@odata.type": "#Manager.v1_5_0.Manager", + "@odata.id": "/redfish/v1/Managers/BMC", + "Id": "BMC", + "Description": "Aspeed BMC", + "Name": "Manager", + "ManagerType": "BMC", + "UUID": "006126AB-B608-E911-8000-0CC47AD55B4E", + "Model": "P9DSU 9006-22P", + "DateTime": "2019-01-22T06:22:55+00:00", + "DateTimeLocalOffset": "+00:00", + "FirmwareVersion": "2.04", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "PowerState": "On", + "SerialConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 1, + "ConnectTypesSupported": [ + "IPMI" + ] + }, + "CommandShell": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 0, + "ConnectTypesSupported": [ + "SSH" + ] + }, + "GraphicalConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 4, + "ConnectTypesSupported": [ + "KVMIP" + ] + }, + "EthernetInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/EthernetInterfaces" + }, + "SerialInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/SerialInterfaces" + }, + "NetworkProtocol": { + "@odata.id": "/redfish/v1/Managers/BMC/NetworkProtocol" + }, + "LogServices": { + "@odata.id": "/redfish/v1/Managers/BMC/LogServices" + }, + "VirtualMedia": { + "@odata.id": "/redfish/v1/Managers/BMC/VirtualMedia" + }, + "Links": { + "ManagerForServers": [ + { + "@odata.id": "/redfish/v1/Systems/Computer" + } + ], + "ManagerForChassis": [ + { + "@odata.id": "/redfish/v1/Chassis/Planar" + } + ], + "ManagerInChassis": { + "@odata.id": "/redfish/v1/Chassis/Planar" + } + }, + "Actions": { + "#Manager.Reset": { + "target": "/redfish/v1/Managers/BMC/Actions/Manager.Reset", + "ResetType@Redfish.AllowableValues": [ + "ForceRestart", + "GracefulRestart" + ] + } + }, + "Oem": { + "Supermicro": { + "@odata.type": "#SMCManager.v1_0_1.SMCManager", + "FanMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/FanMode" + }, + "MouseMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/MouseMode" + }, + "SMTP": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/SMTP" + } + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/system_action_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/system_action_rsp.json new file mode 100644 index 000000000..decbf8cac --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/system_action_rsp.json @@ -0,0 +1,23 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo", + "@odata.type": "#ActionInfo.v1_1_0.ActionInfo", + "@odata.id": "/redfish/v1/Systems/Computer/ResetActionInfo", + "Id": "ResetActionInfo", + "Name": "Reset Action Info", + "Parameters": [ + { + "Name": "ResetType", + "Required": true, + "DataType": "String", + "AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "GracefulRestart", + "ForceRestart", + "ForceOn" + ] + } + ], + "Oem": {} +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json index caee86e6b..eee81f42e 100644 --- a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json @@ -73,14 +73,7 @@ "Actions": { "#ComputerSystem.Reset": { "target": "/redfish/v1/Systems/Computer/Actions/ComputerSystem.Reset", - "ResetType@Redfish.AllowableValues": [ - "On", - "ForceOff", - "GracefulShutdown", - "GracefulRestart", - "ForceRestart", - "ForceOn" - ] + "@Redfish.ActionInfo": "/redfish/v1/Systems/Computer/ResetActionInfo" } } } diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp_v123.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp_v123.json new file mode 100644 index 000000000..caee86e6b --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp_v123.json @@ -0,0 +1,86 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem", + "@odata.type": "#ComputerSystem.v1_5_0.ComputerSystem", + "@odata.id": "/redfish/v1/Systems/Computer", + "Id": "Computer", + "Name": "OpenPOWER Computer System", + "Description": "OpenPOWER Computer System", + "Status": { + "State": "Enabled", + "Health": "Critical" + }, + "SerialNumber": "C829UAE15A10564", + "PartNumber": "9006-22P", + "Manufacturer": "IBM", + "Model": "SYSTEM", + "SystemType": "Physical", + "BiosVersion": "2.04 20190118", + "UUID": "00000000-0000-0000-0000-0000000000", + "ProcessorSummary": { + "Count": 2, + "Model": "POWER CPU", + "Status": { + "State": "Enabled", + "Health": "OK" + } + }, + "IndicatorLED": "Off", + "PowerState": "On", + "Boot": { + "BootSourceOverrideMode": "Legacy", + "BootSourceOverrideEnabled": "Once", + "BootSourceOverrideTarget": "None", + "BootSourceOverrideTarget@Redfish.AllowableValues": [ + "None", + "Pxe", + "Hdd", + "Diags", + "Cd", + "BiosSetup", + "Usb", + "Floppy" + ] + }, + "HostWatchdogTimer": { + "FunctionEnabled": true, + "WarningAction": "None", + "WarningAction@Redfish.AllowableValues": [ + "None" + ], + "TimeoutAction": "None", + "TimeoutAction@Redfish.AllowableValues": [ + "None", + "ResetSystem", + "PowerDown", + "PowerCycle" + ], + "Status": { + "State": "StandbyOffline" + } + }, + "Links": { + "Chassis": [ + { + "@odata.id": "/redfish/v1/Chassis/chassis0" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/BMC" + } + ] + }, + "Actions": { + "#ComputerSystem.Reset": { + "target": "/redfish/v1/Systems/Computer/Actions/ComputerSystem.Reset", + "ResetType@Redfish.AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "GracefulRestart", + "ForceRestart", + "ForceOn" + ] + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json index e88ecd915..95630660b 100644 --- a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json @@ -1,15 +1,7 @@ { - "@odata.context":"/redfish/v1/$metadata#ChassisCollection.ChassisCollection", - "@odata.type":"#ChassisCollection.ChassisCollection", - "@odata.id":"/redfish/v1/Chassis", - "error":{ - "Message": "Chassis Collection" - }, - "Description":"Chassis Collection", - "Members":[ - { - "@odata.id":"/redfish/v1/Chassis/Planar" - } - ], - "Members@odata.count":1 + "error": + { + "message": "Successfully Completed Request", + "code": "Base.1.4.0.Success" + } } diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py index bc98e66de..0318531c8 100644 --- a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py @@ -222,15 +222,24 @@ class TestRedfishClient(object): self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: rsp = json.load(load_f) + with open("%s/bmc_action_rsp.json" % DATA_DIR,'r') as load_f: + actioninfo = json.load(load_f) + self.rf_rest.request = mock.Mock(side_effect=[rsp, actioninfo]) + reset_string = '#Manager.Reset' + assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues']) + + def test__get_bmc_actions_v123(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) + with open("%s/manager_rsp_v123.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) self.rf_rest.request = mock.Mock(return_value=rsp) reset_string = '#Manager.Reset' - assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues']) + assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues']) def test__get_bmc_actions_keyerror(self): self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: rsp = json.load(load_f) - del rsp['Actions']['#Manager.Reset']['ResetType@Redfish.AllowableValues'] self.rf_rest.request = mock.Mock(return_value=rsp) with pytest.raises(SelfServerException) as excinfo: self.rf_rest._get_bmc_actions() @@ -256,6 +265,16 @@ class TestRedfishClient(object): self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: rsp = json.load(load_f) + with open("%s/system_action_rsp.json" % DATA_DIR,'r') as load_f: + actioninfo = json.load(load_f) + self.rf_rest.request = mock.Mock(side_effect=[rsp, actioninfo]) + reset_string = '#ComputerSystem.Reset' + assert self.rf_rest._get_power_actions() == (rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues']) + + def test__get_power_actions_v123(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp_v123.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) self.rf_rest.request = mock.Mock(return_value=rsp) reset_string = '#ComputerSystem.Reset' assert self.rf_rest._get_power_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues']) @@ -264,7 +283,6 @@ class TestRedfishClient(object): self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: rsp = json.load(load_f) - del rsp['Actions']['#ComputerSystem.Reset']['target'] self.rf_rest.request = mock.Mock(return_value=rsp) with pytest.raises(SelfServerException) as excinfo: self.rf_rest._get_power_actions() @@ -274,8 +292,10 @@ class TestRedfishClient(object): def test_set_power_state(self): with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: rsp = json.load(load_f) + with open("%s/system_action_rsp.json" % DATA_DIR,'r') as load_f: + actioninfo = json.load(load_f) reset_string = '#ComputerSystem.Reset' - self.rf_rest._get_power_actions = mock.Mock(return_value=(rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues'])) + self.rf_rest._get_power_actions = mock.Mock(return_value=(rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues'])) self.rf_rest.request = mock.Mock(return_value=None) assert self.rf_rest.set_power_state('on') == None assert self.rf_rest.request From 9e4ab19830387be9af90fc5f3ca470d28a53ae5f Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 28 Jan 2019 03:39:28 -0500 Subject: [PATCH 50/77] Add test case for issue 3542 : to ensure that CSM required info is not removed from /opt/xcat/xcatinfo --- .../installation/SN_diskless_setup_case | 5 ++++ .../testcase/installation/SN_setup_case | 4 +++ .../reg_linux_diskfull_installation_flat | 4 +++ .../reg_linux_diskfull_installation_hierarchy | 5 ++++ .../reg_linux_diskless_installation_flat | 5 ++++ .../reg_linux_diskless_installation_hierarchy | 6 +++++ xCAT-test/autotest/testcase/packimg/cases0 | 26 +++++++++++++++++++ 7 files changed, 55 insertions(+) diff --git a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case index e0bb70192..4b4f02075 100644 --- a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case @@ -107,6 +107,11 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$SN mount check:rc==0 check:output=~on / type tmpfs +cmd:xdsh $$SN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$SN +check:output=~IMAGENAME='__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' cmd:xdsh $$SN rpm -qa|grep "xCAT-openbmc-py" check:rc==0 check:output=~xCAT-openbmc-py-\d diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index a12dd0112..18a5e1f7d 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -91,6 +91,10 @@ check:output=~/install on /install cmd:xdsh $$SN "mount" check:rc==0 check:output=~/tftpboot on /tftpboot +cmd:xdsh $$SN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$SN +check:output=~IMAGENAME=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 448cb549a..0c48d0d89 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -58,6 +58,10 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute cmd:sleep 120 #comment for further discussion #cmd:if ! ([[ "__GETNODEATTR($$CN,os)__" = "sles12.1" ]] || [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" && "__GETNODEATTR($$CN,arch)__" = "x86_64" ]]) ;then xdsh $$CN service ntpd status;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 4f0de6e43..ba1184b2f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -66,6 +66,11 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:output=~SERVICEGROUP=$$SN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "cat /test.synclist" check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 298f28a3f..9c1b95a29 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -63,6 +63,11 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 check:output=~on / type tmpfs +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' cmd:sleep 120 cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index e8ef0c4e5..2b8252786 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -69,6 +69,12 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 check:output=~on / type tmpfs +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' +check:output=~SERVICEGROUP=$$SN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index 4689157e6..fcad6b946 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -370,3 +370,29 @@ cmd:rm -rf /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/ cmd:mv -f /rootimg.bak /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg end +start:packimage_uuid +os:Linux +description:this case is to verfy bug 3542,ensure that CSM required info is not removed from /opt/xcat/xcatinfo. +label:others,packaging +cmd:lsdef -z $$CN >> /tmp/node.stanza +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi +cmd:copycds $$ISO +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:cp /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg/opt/xcat/xcatinfo /tmp/uuid +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:uuid=`cat /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg/opt/xcat/xcatinfo |grep UUID|awk -F= '{print $2}'`;grep $uuid /tmp/uuid +check:rc!=0 +cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz +check:rc==0 +cmd:rm -rf /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz +cmd:mv -f /rootimg.cpio.gz.bak /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz +cmd:rm -rf /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg +cmd:mv -f /rootimg.bak /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg +cmd:if [ -e /tmp/node.stanza ]; then rmdef $$CN; cat /tmp/node.stanza | mkdef -z; rm -rf /tmp/node.stanza; fi +end + From b675245af7b2ede7cb723ca4f6fe5097fd3255d1 Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 29 Jan 2019 02:19:26 -0500 Subject: [PATCH 51/77] update case xdcp_nonroot_user --- xCAT-test/autotest/testcase/xdcp/cases1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-test/autotest/testcase/xdcp/cases1 b/xCAT-test/autotest/testcase/xdcp/cases1 index 47c29fdd7..1f26ef5da 100644 --- a/xCAT-test/autotest/testcase/xdcp/cases1 +++ b/xCAT-test/autotest/testcase/xdcp/cases1 @@ -1,5 +1,7 @@ start:xdcp_nonroot_user label:cn_os_ready,parallel_cmds +cmd:lsdef -t site -z clustersite > /tmp/site.stanza +cmd:chdef -t site SNsyncfiledir=/tmp cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "useradd -m xyzzy";useradd -m xyzzy;else useradd -m xyzzy;fi check:rc==0 cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "bash -c \"( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )\"";bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";else bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";fi @@ -20,4 +22,5 @@ cmd:xdsh $$CN "userdel xyzzy" check:rc==0 cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "userdel xyzzy";userdel xyzzy;else userdel xyzzy;fi check:rc==0 +cmd:if [ -e /tmp/site.standa ]; then cat /tmp/site.standa | mkdef -z -f; rm -rf /tmp/site.standa; fi end From c394e535c60120dd37d0ba056658e0d535a44702 Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 29 Jan 2019 21:57:19 -0500 Subject: [PATCH 52/77] Add test case for issue 2727 : run xCAT in XCATBYPASS mode and simply reload xCAT to check if there is any errors --- xCAT-test/autotest/testcase/xcatd/case0 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/xcatd/case0 b/xCAT-test/autotest/testcase/xcatd/case0 index 4a8203f15..8a0e113ce 100644 --- a/xCAT-test/autotest/testcase/xcatd/case0 +++ b/xCAT-test/autotest/testcase/xcatd/case0 @@ -160,4 +160,20 @@ cmd:chtab name=root policy.commands= policy.rule=allow check:rc==0 end - +start:reload_xcatd_with_XCATBYPASS +description:with XCATBYPASS=YES, there is no error when restart xcatd deamon. This case is add test case for issue 2727 : run xCAT in "XCATBYPASS" mode and simply reload xCAT to check if there is any errors. +label:mn_only,ci_test,xcatd +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service|xcatd.service +check:output=~xcatd service is running|active \(running\) +cmd:XCATBYPASS=YES lsxcatd -a +check:rc==0 +check:output!=~Error|ERROR +cmd:XCATBYPASS=YES service xcatd status +check:rc==0 +check:output!=~Error|ERROR +cmd:XCATBYPASS=YES service xcatd restart +check:rc==0 +check:output!=~Error|ERROR +end From 6ae463eec00702477e8fe92cec4386b819df8690 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 30 Jan 2019 00:56:13 -0500 Subject: [PATCH 53/77] update case xdsh_regular_command to remove XCATBYPASS --- xCAT-test/autotest/testcase/xdsh/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/xdsh/cases0 b/xCAT-test/autotest/testcase/xdsh/cases0 index ff11646b8..3166cbc8d 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases0 +++ b/xCAT-test/autotest/testcase/xdsh/cases0 @@ -13,7 +13,7 @@ end start:xdsh_regular_command label:cn_os_ready,parallel_cmds -cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$CN "ps -ef";else XCATBYPASS=1 xdsh $$CN "ps -ef";fi +cmd:xdsh $$CN "ps -ef" check:rc==0 check:output=~$$CN:\s+UID\s+PID\s+PPID\s+C\s+STIME\s+TTY\s+TIME\s+CMD end From 2180c28ff83d190d20487840cac672bf27655dbc Mon Sep 17 00:00:00 2001 From: Nick Buonarota Date: Wed, 6 Feb 2019 14:07:08 -0500 Subject: [PATCH 54/77] Change var "all_nodes" to "response" --- xCAT-server/xCAT-wsapi/xcatws-test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws-test.py b/xCAT-server/xCAT-wsapi/xcatws-test.py index 7fa06322a..723f152ad 100755 --- a/xCAT-server/xCAT-wsapi/xcatws-test.py +++ b/xCAT-server/xCAT-wsapi/xcatws-test.py @@ -77,20 +77,20 @@ except Exception as e: # # Send a request to get all nodes, passing in user and password # -all_nodes = requests.get(get_all_nodes + "?userName=" + username + "&userPW=" + password, verify=False) +response = requests.get(get_all_nodes + "?userName=" + username + "&userPW=" + password, verify=False) # Display returned data print "List of all nodes extracted with userid and password:" -print all_nodes.content +print response.content # # Send a request to get all nodes, passing in a token # user_data = {'userName': username,'userPW': password} token = requests.post(get_token, verify=False, headers={'Content-Type': 'application/json'}, data=json.dumps(user_data)) -all_nodes = requests.get(get_all_nodes, verify=False, headers={'X-Auth-Token': token.json()['token']['id']}) +response = requests.get(get_all_nodes, verify=False, headers={'X-Auth-Token': token.json()['token']['id']}) # Display returned data print "List of all nodes extracted with authentication token:" -print all_nodes.content +print response.content sys.exit(0) From 89ae21a719cc80657ba252a49bc046731727020a Mon Sep 17 00:00:00 2001 From: Nick Buonarota Date: Wed, 6 Feb 2019 14:09:42 -0500 Subject: [PATCH 55/77] change accessed attribute from content to text - content is "Content of the response, in bytes." - python is smart enough to print this - might be clearer to use "text" for someone new looking at this example. --- xCAT-server/xCAT-wsapi/xcatws-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws-test.py b/xCAT-server/xCAT-wsapi/xcatws-test.py index 723f152ad..2f37126cf 100755 --- a/xCAT-server/xCAT-wsapi/xcatws-test.py +++ b/xCAT-server/xCAT-wsapi/xcatws-test.py @@ -81,7 +81,7 @@ response = requests.get(get_all_nodes + "?userName=" + username + "&userPW=" + p # Display returned data print "List of all nodes extracted with userid and password:" -print response.content +print response.text # # Send a request to get all nodes, passing in a token # @@ -91,6 +91,6 @@ response = requests.get(get_all_nodes, verify=False, headers={'X-Auth-Token': to # Display returned data print "List of all nodes extracted with authentication token:" -print response.content +print response.text sys.exit(0) From a7f5abc1bfb680fc356b60d885badf307747c929 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 7 Feb 2019 09:27:45 -0500 Subject: [PATCH 56/77] Update cfg_partition.rst Get rid of the text "note" causing the markdown to not render correctly. --- .../manage_clusters/common/deployment/cfg_partition.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index 20836e356..1748b8675 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -2,7 +2,6 @@ By default, xCAT will install the operating system on the first disk and with default partitions layout in the node. However, you may choose to customize the disk partitioning during the install process and define a specific disk layout. You can do this in one of two ways: '**partition definition file**' or '**partition definition script**'. -**Notes** .. note:: ``partition definition file`` can be used for RedHat, SLES, and Ubuntu. Because disk configuraiton for Ubuntu is different from RedHat, there may be some special sections required for Ubuntu. .. warning:: ``partition definition script`` has only been tested on RedHat and Ubuntu, use at your own risk for SLES. From c296ee6cf55a359906c565578546728cab7fe858 Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 11 Feb 2019 00:39:16 -0500 Subject: [PATCH 57/77] update go_xcat cases to let cn could resolv hostname --- xCAT-test/autotest/testcase/go_xcat/case0 | 14 +++++++------- xCAT-test/autotest/testcase/go_xcat/case1 | 8 ++++---- xCAT-test/autotest/testcase/go_xcat/case2 | 8 ++++---- xCAT-test/autotest/testcase/go_xcat/case4 | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case0 b/xCAT-test/autotest/testcase/go_xcat/case0 index 7af2a8a04..5dd98c98a 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case0 +++ b/xCAT-test/autotest/testcase/go_xcat/case0 @@ -18,7 +18,7 @@ check:rc==0 cmd:xdsh $$CN "cd /xcat-core; ./mklocalrepo.sh" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -57,7 +57,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; tar -jxf /xcat-core.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -96,7 +96,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; bunzip2 /xcat-core.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -135,7 +135,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /xcat-dep.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -182,7 +182,7 @@ check:rc==0 cmd:xdsh $$CN "cd /xcat-core; ./mklocalrepo.sh" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -225,7 +225,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; tar -jxf /xcat-core.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -262,7 +262,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /xcat-dep.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/go_xcat/case1 b/xCAT-test/autotest/testcase/go_xcat/case1 index de11a1a6a..08541b525 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case1 +++ b/xCAT-test/autotest/testcase/go_xcat/case1 @@ -13,7 +13,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -48,7 +48,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -90,7 +90,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -125,7 +125,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/go_xcat/case2 b/xCAT-test/autotest/testcase/go_xcat/case2 index 058a19de3..cd533c148 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case2 +++ b/xCAT-test/autotest/testcase/go_xcat/case2 @@ -43,7 +43,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -79,7 +79,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -147,7 +147,7 @@ cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:dir="__GETNODEATTR($$CN,os)__"; if grep SUSE /etc/*release;then os=`echo $dir |cut -c 1-6` && xdsh $$CN "cd /xcat-dep/$os/__GETNODEATTR($$CN,arch)__/; ./mklocalrepo.sh" ; elif grep "Red Hat" /etc/*release;then os=`echo $dir |cut -c 1-2` && xdsh $$CN "cd /xcat-dep/$os`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/; ./mklocalrepo.sh"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cd /xcat-dep; ./mklocalrepo.sh"; else echo "Sorry,this is not supported os"; fi cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 @@ -183,7 +183,7 @@ check:rc==0 cmd:cp /xcat-dep-*.tar.bz2 /install/ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/go_xcat/case4 b/xCAT-test/autotest/testcase/go_xcat/case4 index c5603a64b..63852d9ba 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case4 +++ b/xCAT-test/autotest/testcase/go_xcat/case4 @@ -16,7 +16,7 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /xcat-dep.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 From cfc1c85a61f014427a655e946ba13c7ff2cb7013 Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 11 Feb 2019 03:10:07 -0500 Subject: [PATCH 58/77] update cases be refined to support run after hierarchy test --- .../testcase/installation/reg_linux_diskfull_installation_flat | 3 ++- .../testcase/installation/reg_linux_diskless_installation_flat | 2 ++ .../installation/reg_linux_statelite_installation_flat | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 0c48d0d89..ba055d3dd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -7,7 +7,8 @@ cmd:df -T cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:MINIISO=NUll;if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi check:rc==0 - +cmd:chdef $$SN -m groups=service +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 9c1b95a29..fe06ccc5f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -4,6 +4,8 @@ label:flat_cn_diskless,provision #stop:yes cmd:fdisk -l cmd:df -T +cmd:chdef $$SN -m groups=service +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 4858d75e5..0baacc6be 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -4,7 +4,8 @@ label:others,provision,statelite #stop:yes cmd:fdisk -l cmd:df -T - +cmd:chdef $$SN -m groups=service +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 From 5780e16ffedffaae76513f4aac5ebd53a2b40ce2 Mon Sep 17 00:00:00 2001 From: litingt Date: Mon, 11 Feb 2019 22:20:24 -0500 Subject: [PATCH 59/77] update according to comments --- .../testcase/installation/reg_linux_diskfull_installation_flat | 2 +- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- .../testcase/installation/reg_linux_statelite_installation_flat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index ba055d3dd..9d1311e7b 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -7,7 +7,7 @@ cmd:df -T cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:MINIISO=NUll;if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi check:rc==0 -cmd:chdef $$SN -m groups=service +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index fe06ccc5f..b07ed2f83 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -4,7 +4,7 @@ label:flat_cn_diskless,provision #stop:yes cmd:fdisk -l cmd:df -T -cmd:chdef $$SN -m groups=service +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 0baacc6be..5fef777be 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -4,7 +4,7 @@ label:others,provision,statelite #stop:yes cmd:fdisk -l cmd:df -T -cmd:chdef $$SN -m groups=service +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 From ca27ff256a6ebf7d9327ee013fba3f43725c8b67 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Tue, 12 Feb 2019 03:00:40 -0500 Subject: [PATCH 60/77] fix issue xdcp EXECUTE of .post script not working as expected #5987 --- perl-xCAT/xCAT/DSHCLI.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 4284b4ef0..0aacbb3c5 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -5936,6 +5936,11 @@ sub run_rsync_postscripts # return from rsync is tmp/file1 not /tmp/file1 substr($tmppostfile, 0, 1) = ""; + # now remove .post from the postscript file for the compare + # with the returned file name + my($tp,$post) = split(/\.post/,$tmppostfile); + $tmppostfile = $tp; + foreach my $line (@rsync_output) { my ($hostname, $ps) = split(/: /, $line); chomp $ps; @@ -5948,7 +5953,11 @@ sub run_rsync_postscripts } next; } - if ($tmppostfile eq $ps) { + + #the $postsfile .post will be run if: + # the is updated, or + # the .post file is updated + if ($ps eq $tmppostfile or $ps eq $tmppostfile.".post" ) { # build xdsh queue # build host and all scripts to execute From 79cb64605b34696c0829576b1fc2f88beaf54748 Mon Sep 17 00:00:00 2001 From: litingt Date: Tue, 12 Feb 2019 03:17:30 -0500 Subject: [PATCH 61/77] refine go-xcat test case to leverage local mirror --- xCAT-test/autotest/testcase/go_xcat/case0 | 14 +++++++------- xCAT-test/autotest/testcase/go_xcat/case1 | 8 ++++---- xCAT-test/autotest/testcase/go_xcat/case2 | 8 ++++---- xCAT-test/autotest/testcase/go_xcat/case4 | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case0 b/xCAT-test/autotest/testcase/go_xcat/case0 index 5dd98c98a..5578faac9 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case0 +++ b/xCAT-test/autotest/testcase/go_xcat/case0 @@ -20,7 +20,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep SUSE /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/zypp/repos.d/xCAT-core.repo -y install"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/yum.repos.d/xCAT-core.repo -y install"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/apt/sources.list.d/xcat-core.list -y install";else echo "Sorry,this is not supported os"; fi @@ -59,7 +59,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core -y install" @@ -98,7 +98,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core.tar -y install" @@ -137,7 +137,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core.tar.bz2 --xcat-dep=/xcat-dep.tar.bz2 -y install" @@ -184,7 +184,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep SUSE /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/zypp/repos.d/xCAT-core.repo --xcat-dep=/etc/zypp/repos.d/xCAT-dep.repo -y install"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/yum.repos.d/xCAT-core.repo --xcat-dep=/etc/yum.repos.d/xCAT-dep.repo -y install"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/apt/sources.list.d/xcat-core.list --xcat-dep=/etc/apt/sources.list.d/xcat-dep.list -y install"; else echo "Sorry,this is not supported os"; fi @@ -227,7 +227,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core --xcat-dep=/xcat-dep -y install" @@ -264,7 +264,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core.tar.bz2 --xcat-dep=/xcat-dep.tar.bz2 -y install" diff --git a/xCAT-test/autotest/testcase/go_xcat/case1 b/xCAT-test/autotest/testcase/go_xcat/case1 index 08541b525..134f0a843 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case1 +++ b/xCAT-test/autotest/testcase/go_xcat/case1 @@ -15,7 +15,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --yes install" @@ -50,7 +50,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat -x $migration_version -y install" @@ -92,7 +92,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" @@ -127,7 +127,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat --xcat-version=$migration_version -y install" diff --git a/xCAT-test/autotest/testcase/go_xcat/case2 b/xCAT-test/autotest/testcase/go_xcat/case2 index cd533c148..98bdef85b 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case2 +++ b/xCAT-test/autotest/testcase/go_xcat/case2 @@ -45,7 +45,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/apt/$$BRANCH/core-snap/";else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/yum/$$BRANCH/core-snap/ -y install"; fi @@ -81,7 +81,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Ubuntu/core-snap/core-debs-snap.tar.bz2";else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Linux/core-snap/core-rpms-snap.tar.bz2 -y install"; fi @@ -149,7 +149,7 @@ cmd:dir="__GETNODEATTR($$CN,os)__"; if grep SUSE /etc/*release;then os=`echo $di cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/apt/devel/core-snap/ --xcat-dep=http://xcat.org/files/xcat/repos/apt/xcat-dep/ -y install"; else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/yum/devel/core-snap/ --xcat-dep=http://xcat.org/files/xcat/repos/yum/xcat-dep/ -y install"; fi @@ -185,7 +185,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:dep=`ls /install/xcat-dep-*.tar.bz2`;if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Ubuntu/core-snap/core-debs-snap.tar.bz2 --xcat-dep=http://$$MN/$dep -y install"; else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Linux/core-snap/core-rpms-snap.tar.bz2 --xcat-dep=http://$$MN/$dep -y install"; fi diff --git a/xCAT-test/autotest/testcase/go_xcat/case4 b/xCAT-test/autotest/testcase/go_xcat/case4 index 63852d9ba..c214cb912 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case4 +++ b/xCAT-test/autotest/testcase/go_xcat/case4 @@ -18,7 +18,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=$$UBUNTU_MIGRATION2_CORE --xcat-dep=$$UBUNTU_MIGRATION2_DEP -y install";else xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION1_VERSION -y install";fi check:rc==0 From ee15e6b73bc4c7b3ef66184b470eae5ea7bd9f7d Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 13 Feb 2019 02:17:24 -0500 Subject: [PATCH 62/77] update case xcatconfig_c to make it to run on hierarchy environment --- xCAT-test/autotest/testcase/xcatconfig/case0 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index f66c6cb8b..8fd0dccc7 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -119,6 +119,10 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 cmd:mv -f /etc/xcat/cabak /etc/xcat/ca ;mv -f /etc/xcat/certbak /etc/xcat/cert check:rc==0 +cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi +check:rc==0 +cmd:if lsdef service > /dev/null 2>&1; then makedhcp -a;fi +check:rc==0 end start:xcatconfig_s From 214d3ea3967050acf39020ae5ab2b3531fffa4bb Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 13 Feb 2019 03:08:59 -0500 Subject: [PATCH 63/77] update test command for xcatconfig -c --- xCAT-test/autotest/testcase/xcatconfig/case0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index 8fd0dccc7..bb7f0b4dd 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -121,7 +121,7 @@ cmd:mv -f /etc/xcat/cabak /etc/xcat/ca ;mv -f /etc/xcat/certbak /etc/xcat/cert check:rc==0 cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi check:rc==0 -cmd:if lsdef service > /dev/null 2>&1; then makedhcp -a;fi +cmd:if lsdef service > /dev/null 2>&1; then xdsh $$CN date;fi check:rc==0 end From 37cde2963b827ab3ae5875abb1e13231d055e7a6 Mon Sep 17 00:00:00 2001 From: huweihua Date: Fri, 15 Feb 2019 01:06:14 -0500 Subject: [PATCH 64/77] refine some installation test cases --- .../installation/reg_linux_diskfull_installation_flat | 2 -- .../installation/reg_linux_diskfull_installation_hierarchy | 2 -- .../installation/reg_linux_diskless_installation_flat | 2 -- .../installation/reg_linux_diskless_installation_hierarchy | 2 -- .../installation/reg_linux_statelite_installation_flat | 7 ++----- .../reg_linux_statelite_installation_hierarchy_by_nfs | 2 -- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 2 -- 7 files changed, 2 insertions(+), 17 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 9d1311e7b..c82b55be7 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -46,8 +46,6 @@ cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$C check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN 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 ba1184b2f..cd76021a0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -53,8 +53,6 @@ cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc" ]]; then sleep 120;elif [[ "__GE #check:rc==0 #check:output!~booted -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done - cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index b07ed2f83..4ac192916 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -50,8 +50,6 @@ check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 2b8252786..12b3c6167 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -54,8 +54,6 @@ check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 5fef777be..f3900601b 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -51,6 +51,8 @@ check:rc==0 cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute rootfstype=nfs +check:rc==0 cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute @@ -61,9 +63,6 @@ check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done - cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN @@ -99,8 +98,6 @@ check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index e7520a355..049f802e7 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -80,8 +80,6 @@ check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 6ad6160c4..f9e6fbd32 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -74,8 +74,6 @@ check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 From 75521c33bf843438b843239f0935b557b42636bc Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 15 Feb 2019 01:32:17 -0500 Subject: [PATCH 65/77] refine some test cases --- .../reg_linux_diskfull_installation_flat_postscripts_failed | 2 +- .../reg_linux_diskless_installation_flat_postscripts_failed | 2 +- xCAT-test/autotest/testcase/xcatconfig/case0 | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed index 4525200de..511a93fea 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed @@ -41,7 +41,7 @@ cmd:chdef $$CN -p postscripts=test check:rc==0 cmd:lsdef -l $$CN check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +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/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index 66e5e1cfe..d29e28cd0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -47,7 +47,7 @@ cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index f66c6cb8b..d03d5a305 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -94,7 +94,6 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 end - start:xcatconfig_c description:To regenerate cretials label:mn_only @@ -117,7 +116,7 @@ check:rc!=0 #step4:restore test environment cmd:rm -rf /tmp/xcatconfig.test check:rc==0 -cmd:mv -f /etc/xcat/cabak /etc/xcat/ca ;mv -f /etc/xcat/certbak /etc/xcat/cert +cmd:rm -rf /etc/xcat/cabak /etc/xcat/certbak check:rc==0 end From 7a454892336be4d435b885ff37c2748d98c09bcf Mon Sep 17 00:00:00 2001 From: litingt Date: Fri, 15 Feb 2019 01:49:00 -0500 Subject: [PATCH 66/77] update case xcatconfig_c to support hierarchy --- xCAT-test/autotest/testcase/xcatconfig/case0 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index d03d5a305..2beb89f95 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -118,6 +118,10 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 cmd:rm -rf /etc/xcat/cabak /etc/xcat/certbak check:rc==0 +cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi +check:rc==0 +cmd:if lsdef service > /dev/null 2>&1; then xdsh $$CN date;fi +check:rc==0 end start:xcatconfig_s From b3a87af492c7036ff8d6f7cfe98718a69f052ca6 Mon Sep 17 00:00:00 2001 From: huweihua Date: Sun, 17 Feb 2019 21:02:30 -0500 Subject: [PATCH 67/77] add new bundles for daily and weekly regression --- .../autotest/bundle/rhels_ppc_daily.bundle | 303 +++++++++++++++++ .../autotest/bundle/rhels_ppc_weekly.bundle | 71 ++++ .../autotest/bundle/rhels_ppcle_daily.bundle | 305 ++++++++++++++++++ .../autotest/bundle/rhels_ppcle_weekly.bundle | 74 +++++ .../autotest/bundle/rhels_x86_daily.bundle | 304 +++++++++++++++++ .../autotest/bundle/rhels_x86_weekly.bundle | 74 +++++ .../autotest/bundle/sles_ppc_daily.bundle | 282 ++++++++++++++++ .../autotest/bundle/sles_ppc_weekly.bundle | 14 + .../autotest/bundle/sles_ppcle_daily.bundle | 250 ++++++++++++++ .../autotest/bundle/sles_ppcle_weekly.bundle | 21 ++ .../autotest/bundle/sles_x86_daily.bundle | 248 ++++++++++++++ .../autotest/bundle/sles_x86_weekly.bundle | 21 ++ .../autotest/bundle/ubuntu_ppcle_daily.bundle | 229 +++++++++++++ .../bundle/ubuntu_ppcle_weekly.bundle | 16 + .../autotest/bundle/ubuntu_x86_daily.bundle | 229 +++++++++++++ .../autotest/bundle/ubuntu_x86_weekly.bundle | 16 + 16 files changed, 2457 insertions(+) create mode 100644 xCAT-test/autotest/bundle/rhels_ppc_daily.bundle create mode 100644 xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle create mode 100644 xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle create mode 100644 xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle create mode 100644 xCAT-test/autotest/bundle/rhels_x86_daily.bundle create mode 100644 xCAT-test/autotest/bundle/rhels_x86_weekly.bundle create mode 100644 xCAT-test/autotest/bundle/sles_ppc_daily.bundle create mode 100644 xCAT-test/autotest/bundle/sles_ppc_weekly.bundle create mode 100644 xCAT-test/autotest/bundle/sles_ppcle_daily.bundle create mode 100644 xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle create mode 100644 xCAT-test/autotest/bundle/sles_x86_daily.bundle create mode 100644 xCAT-test/autotest/bundle/sles_x86_weekly.bundle create mode 100644 xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle create mode 100644 xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle create mode 100644 xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle create mode 100644 xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle new file mode 100644 index 000000000..ef275ad8e --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -0,0 +1,303 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +updatenode_P_script1 +updatenode_P_script1_script2 +updatenode_P_script2 +updatenode_diskful_syncfiles +updatenode_diskful_syncfiles_P_script1 +updatenode_diskful_syncfiles_dir +updatenode_diskful_syncfiles_failing +updatenode_diskful_syncfiles_multi_files +updatenode_diskful_syncfiles_rename +updatenode_f_incompatible_flags +updatenode_h +updatenode_k_incompatible_flags +updatenode_postscripts_loginfo +updatenode_script3 +updatenode_syncfile_APPEND +updatenode_syncfile_EXECUTE +updatenode_syncfile_EXECUTEALWAYS +updatenode_syncfile_MERGE +updatenode_v +updatenode_without_flag +updatenode_without_options +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +assign_certain_command_permission +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +getmacs_d +getmacs_f_D +getmacs_noderange +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_rhels73 +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_grub2 +nodeset_noderange +nodeset_yaboot +nodeset_stat +nodestat_err_node +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_all +rinv_bus +rinv_config +rinv_firm +rinv_model +rinv_serial +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_stat +rscan_noderange +rscan_w +rscan_x +rscan_x_w +rscan_z +rscan_z_w +run_command_with_XCATBYPASS +runcmdinstaller_h +rvitals_all +rvitals_lcds +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle new file mode 100644 index 000000000..f523dfe2f --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle @@ -0,0 +1,71 @@ +#INCLUDE:rhels_ppc_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +addkit_v +addkit_h +addkit_kit +addkit_i +addkit_multikit +addkit_p +addkitcomp_v +addkitcomp_h +addkitcomp_i +addkitcomp_f +buildkit_v +buildkit_h +buildkit_create +buildkit_create_l +buildkit_cleanrepo_all +buildkit_buildtar +chkkitcomp_v +chkkitcomp_h +chkkitcomp_V +lskit_v +lskit_h +lskit_F +lskit_K +lskit_R +lskit_C +lskitcomp_v +lskitcomp_h +lskitcomp_C +lskitcomp_S +lskitdeployparam_v +lskitdeployparam_h +lskitdeployparam_no_param +lskitdeployparam_k_1 +lskitdeployparam_c_1 +rmkit_v +rmkit_h +rmkit_t_no +rmkit_t_yes +rmkit_f +rmkit_V +rmkitcomp_v +rmkitcomp_h +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +confignetwork_static_installnic +get_xcat_postscripts_loginfo +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +rmimage_diskless +rpower_reset +runcmdinstaller_command +redhat_migration1 +redhat_migration2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle new file mode 100644 index 000000000..ac66a4213 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -0,0 +1,305 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +updatenode_P_script1 +updatenode_P_script1_script2 +updatenode_P_script2 +updatenode_diskful_syncfiles +updatenode_diskful_syncfiles_P_script1 +updatenode_diskful_syncfiles_dir +updatenode_diskful_syncfiles_failing +updatenode_diskful_syncfiles_multi_files +updatenode_diskful_syncfiles_rename +updatenode_f_incompatible_flags +updatenode_h +updatenode_k_incompatible_flags +updatenode_postscripts_loginfo +updatenode_script3 +updatenode_syncfile_APPEND +updatenode_syncfile_EXECUTE +updatenode_syncfile_EXECUTEALWAYS +updatenode_syncfile_MERGE +updatenode_v +updatenode_without_flag +updatenode_without_options +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +assign_certain_command_permission +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork__bridge_false +confignetwork_bond_eth2_eth3 +confignetwork_bond_false +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_rhels73 +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_disjointdhcps_petitboot +nodeset_errorcommand +nodeset_grub2 +nodeset_noderange +nodeset_petitboot +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_stat +run_command_with_XCATBYPASS +runcmdinstaller_h +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle new file mode 100644 index 000000000..52df8ce98 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -0,0 +1,74 @@ +#INCLUDE:rhels_ppcle_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +addkit_v +addkit_h +addkit_kit +addkit_i +addkit_multikit +addkit_p +addkitcomp_v +addkitcomp_h +addkitcomp_i +addkitcomp_f +buildkit_v +buildkit_h +buildkit_create +buildkit_create_l +buildkit_cleanrepo_all +buildkit_buildtar +chkkitcomp_v +chkkitcomp_h +chkkitcomp_V +lskit_v +lskit_h +lskit_F +lskit_K +lskit_R +lskit_C +lskitcomp_v +lskitcomp_h +lskitcomp_C +lskitcomp_S +lskitdeployparam_v +lskitdeployparam_h +lskitdeployparam_no_param +lskitdeployparam_k_1 +lskitdeployparam_c_1 +rmkit_v +rmkit_h +rmkit_t_no +rmkit_t_yes +rmkit_f +rmkit_V +rmkitcomp_v +rmkitcomp_h +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +confignetwork_static_installnic +get_xcat_postscripts_loginfo +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +rmimage_diskless +rpower_reset +runcmdinstaller_command +redhat_migration1 +redhat_migration2 diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle new file mode 100644 index 000000000..fe78b52d0 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -0,0 +1,304 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +updatenode_P_script1 +updatenode_P_script1_script2 +updatenode_P_script2 +updatenode_diskful_syncfiles +updatenode_diskful_syncfiles_P_script1 +updatenode_diskful_syncfiles_dir +updatenode_diskful_syncfiles_failing +updatenode_diskful_syncfiles_multi_files +updatenode_diskful_syncfiles_rename +updatenode_f_incompatible_flags +updatenode_h +updatenode_k_incompatible_flags +updatenode_postscripts_loginfo +updatenode_script3 +updatenode_syncfile_APPEND +updatenode_syncfile_EXECUTE +updatenode_syncfile_EXECUTEALWAYS +updatenode_syncfile_MERGE +updatenode_v +updatenode_without_flag +updatenode_without_options +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +assign_certain_command_permission +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork__bridge_false +confignetwork_bond_eth2_eth3 +confignetwork_bond_false +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_rhels73 +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_xnba +nodeset_noderange +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_noderange +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_stat +run_command_with_XCATBYPASS +runcmdinstaller_h +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle new file mode 100644 index 000000000..a06f89c06 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -0,0 +1,74 @@ +#INCLUDE:rhels_x86_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +addkit_v +addkit_h +addkit_kit +addkit_i +addkit_multikit +addkit_p +addkitcomp_v +addkitcomp_h +addkitcomp_i +addkitcomp_f +buildkit_v +buildkit_h +buildkit_create +buildkit_create_l +buildkit_cleanrepo_all +buildkit_buildtar +chkkitcomp_v +chkkitcomp_h +chkkitcomp_V +lskit_v +lskit_h +lskit_F +lskit_K +lskit_R +lskit_C +lskitcomp_v +lskitcomp_h +lskitcomp_C +lskitcomp_S +lskitdeployparam_v +lskitdeployparam_h +lskitdeployparam_no_param +lskitdeployparam_k_1 +lskitdeployparam_c_1 +rmkit_v +rmkit_h +rmkit_t_no +rmkit_t_yes +rmkit_f +rmkit_V +rmkitcomp_v +rmkitcomp_h +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +confignetwork_static_installnic +get_xcat_postscripts_loginfo +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +rmimage_diskless +rpower_reset +runcmdinstaller_command +redhat_migration1 +redhat_migration2 diff --git a/xCAT-test/autotest/bundle/sles_ppc_daily.bundle b/xCAT-test/autotest/bundle/sles_ppc_daily.bundle new file mode 100644 index 000000000..2a9377444 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppc_daily.bundle @@ -0,0 +1,282 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +getmacs_d +getmacs_f_D +getmacs_noderange +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_grub2 +nodeset_noderange +nodeset_stat +nodeset_yaboot +nodestat_err_node +nodestat_usage +packimage_h +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_all +rinv_bus +rinv_config +rinv_firm +rinv_model +rinv_noderange_err +rinv_serial +rmdef_null +rmdef_t_err +rmimage_diskless +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_reset +rpower_stat +rscan_noderange +rscan_w +rscan_x +rscan_x_w +rscan_z +rscan_z_w +rvitals_all +rvitals_lcds +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle new file mode 100644 index 000000000..898f66a67 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle @@ -0,0 +1,14 @@ +#INCLUDE:sles_ppc_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +sles_migration1 +sles_migration2 diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle new file mode 100644 index 000000000..bb7201f9c --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -0,0 +1,250 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_err_symble +chtab_err_table +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_disjointdhcps_petitboot +nodeset_errorcommand +nodeset_noderange +nodeset_shell_incorrectmasterip +nodeset_stat +nodeset_grub2 +nodeset_petitboot +nodestat_err_node +nodestat_noderange +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rmimage_diskless +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle new file mode 100644 index 000000000..08534fe14 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -0,0 +1,21 @@ +#INCLUDE:sles_ppcle_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +sles_migration1 +sles_migration2 diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle new file mode 100644 index 000000000..d90a2bfd5 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -0,0 +1,248 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_err_symble +chtab_err_table +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_noderange +nodeset_shell_incorrectmasterip +nodeset_stat +nodeset_xnba +nodestat_err_node +nodestat_noderange +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rmimage_diskless +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle new file mode 100644 index 000000000..f6928afe4 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -0,0 +1,21 @@ +#INCLUDE:sles_x86_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +sles_migration1 +sles_migration2 diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle new file mode 100644 index 000000000..b1cc64c19 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -0,0 +1,229 @@ +reg_linux_diskless_installation_flat +reg_linux_diskfull_installation_flat +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a_ubuntu +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns_d_node +makedns_n_noderange +makedns_ubuntu_n +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_errorcommand +nodeset_check_warninginfo +nodeset_grub2 +nodeset_noderange +nodeset_petitboot +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rmdef_null +rmdef_t_err +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_ubuntu +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle new file mode 100644 index 000000000..f45b09f29 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle @@ -0,0 +1,16 @@ +#INCLUDE:ubuntu_ppcle_daily.bundle# +nodeset_cmdline +nodeset_runimg +nodeset_shell +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +rmimage_diskless +ubuntu_migration2_p8le diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle new file mode 100644 index 000000000..52fc1f477 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -0,0 +1,229 @@ +reg_linux_diskless_installation_flat +reg_linux_diskfull_installation_flat +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a_ubuntu +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns_d_node +makedns_n_noderange +makedns_ubuntu_n +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_errorcommand +nodeset_check_warninginfo +nodeset_noderange +nodeset_xnba +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_usage +nodestat_noderange +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rmdef_null +rmdef_t_err +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_ubuntu +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle new file mode 100644 index 000000000..c25018857 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle @@ -0,0 +1,16 @@ +#INCLUDE:ubuntu_x86_daily.bundle# +nodeset_cmdline +nodeset_runimg +nodeset_shell +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +rmimage_diskless +ubuntu_migration2_vm From 2d380bdf81b5a709ed1f0d3b376e0ec3feabc3fa Mon Sep 17 00:00:00 2001 From: huweihua Date: Mon, 18 Feb 2019 01:31:12 -0500 Subject: [PATCH 68/77] refine test case makedhcp_remote_network and add stop label --- xCAT-test/autotest/testcase/makedhcp/cases0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 54fad0433..c7168b57b 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -194,6 +194,7 @@ end start:makedhcp_remote_network descriptiion:This case is to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. os:linux +stop:yes label:mn_only,dhcp cmd:mkdef -t network -o testnetwork net=100.100.100.0 mask=255.255.255.0 mgtifname='!remote!eth0' gateway=100.100.100.1 check:rc==0 @@ -213,7 +214,7 @@ cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; cmd:makedhcp testnode check:rc==0 cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then a="/var/lib/dhcp/db/dhcpd.leases"; elif [ -f "/var/lib/dhcp/dhcpd.leases" ]; then a="/var/lib/dhcp/dhcpd.leases";fi; ls -l $a; cat $a -cmd:a=2;while true; do [ $a -eq 64 ] && exit 1;output=$(makedhcp -q testnode);[ $? -ne 0 ] && exit 1;echo $output|grep testnode 2>/dev/null && exit 0;a=$[$a*2];sleep $a;done +cmd:a=2;while true; do [ $a -eq 64 ] && exit 1;output=$(makedhcp -q testnode);[ $? -ne 0 ] && exit 1;echo $output|grep testnode 2>/dev/null && exit 0;a=$[$a*2]; makedhcp testnode; sleep $a;done check:rc==0 check:output=~testnode: ip-address = 100.100.100.2 cmd:makedhcp -d testnode From 164002f8d0dfeeaf85df7be6fa45176efb923e0f Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Tue, 19 Feb 2019 18:01:18 +0800 Subject: [PATCH 69/77] refine test case run_command_with_XCATBYPASS for task #603 (#6010) * refine test case run_command_with_XCATBYPASS for task #603 --- xCAT-test/autotest/testcase/xcatd/case0 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcatd/case0 b/xCAT-test/autotest/testcase/xcatd/case0 index 8a0e113ce..a9f234c00 100644 --- a/xCAT-test/autotest/testcase/xcatd/case0 +++ b/xCAT-test/autotest/testcase/xcatd/case0 @@ -104,9 +104,11 @@ check:rc==0 cmd:service xcatd stop check:rc==0 cmd:sleep 3 +cmd:ps aux|tee /tmp/run_command_with_XCATBYPASS.log +cmd:awk '{print $11}' /tmp/run_command_with_XCATBYPASS.log|grep -E ^xcatd +check:rc!=0 +cmd:rm -rf /tmp/run_command_with_XCATBYPASS.log cmd:service xcatd status -check:output=~xcatd service|xcatd.service -check:output=~xcatd service is not running|inactive \(dead\) cmd:tabdump site check:rc!=0 cmd:XCATBYPASS=YES tabdump site From f27c62e954e0b58de5bb8963722dad31fe92684e Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Wed, 20 Feb 2019 12:47:31 +0800 Subject: [PATCH 70/77] refine test case makehost_n_r for task #604 (#6011) * refine test case makehost_n_r for task #604 --- xCAT-test/autotest/testcase/makehosts/cases0 | 100 +++++++++++-------- 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index dab769d08..d6dce15eb 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -141,6 +141,7 @@ start:makehost_n_r label:mn_only,dns,wait_fix 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:sed -i '/s01/d' /etc/hosts cmd:cat /etc/hosts cmd:lsdef s01;if [ $? -eq 0 ]; then lsdef -l s01 -z >/tmp/s01.standa ;rmdef s01;fi check:rc==0 @@ -149,56 +150,65 @@ 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 check:rc==0 cmd:lsdef -l s01,s01r1b01 -cmd:makehosts +cmd:makehosts check:rc==0 -cmd:cat /etc/hosts cmd:#!/bin/bash file="/etc/hosts" -for i in {1..5}; do - if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then - exit 0; - else - echo "Do not find s01 and s01r1b01 in $file, sleep $[i*2] seconds and try again" - sleep $[i*2] - fi -done -exit 1 +if (! grep "s01" $file 2>&1); then + echo "makehosts failed, try XCATBYPASS=YES makehosts again" + XCATBYPASS=YES makehosts + if (! grep "s01" $file 2>&1); then + echo "XCATBYPASS=YES makehosts failed either" + exit 1 + fi +fi +if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then + exit 0 +else + exit 1 +fi check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts s01 +cmd:sed -i '/s01/d' /etc/hosts +cmd:makehosts s01 check:rc==0 -cmd:cat /etc/hosts cmd:#!/bin/bash file="/etc/hosts" -for i in {1..5}; do - if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && ( ! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then - exit 0; - else - echo "sleep $[i*2] seconds and try again" - sleep $[i*2] +if (! grep "s01 " $file 2>&1); then + echo "makehosts s01 failed, try XCATBYPASS=YES makehosts s01 again" + XCATBYPASS=YES makehosts s01 + if (! grep "s01 " $file 2>&1); then + echo "XCATBYPASS=YES makehosts s01 failed either" + exit 1 fi -done -exit 1 +fi +if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && ( ! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then + exit 0; +else + exit 1 +fi check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts service +cmd:sed -i '/s01/d' /etc/hosts +cmd:makehosts service check:rc==0 -cmd:cat /etc/hosts cmd:#!/bin/bash file="/etc/hosts" -for i in {1..5}; do - if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then - exit 0; - else - echo "sleep $[i*2] seconds and try again" - sleep $[i*2] - fi -done -exit 1 +if (! grep "s01 " $file 2>&1); then + echo "makehosts service failed, try XCATBYPASS=YES makehosts service again" + XCATBYPASS=YES makehosts service + if (! grep "s01 " $file 2>&1); then + echo "XCATBYPASS=YES makehosts service failed either" + exit 1 + fi +fi +if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then + exit 0; +else + exit 1 +fi check:rc==0 cmd:makehosts -d s01 check:rc==0 -cmd:cat /etc/hosts +cmd:grep "s01" /etc/hosts cmd:#!/bin/bash file="/etc/hosts" for i in {1..5}; do @@ -211,13 +221,14 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts +cmd:sed -i '/s01/d' /etc/hosts +cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts check:rc==0 -cmd:cat /etc/hosts -cmd:makehosts -d service +cmd:grep "s01" /etc/hosts check:rc==0 -cmd:cat /etc/hosts +cmd:makehosts -d service +check:rc==0 +cmd:grep "s01" /etc/hosts cmd:#!/bin/bash file="/etc/hosts" for i in {1..5}; do @@ -230,13 +241,14 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts +cmd:sed -i '/s01/d' /etc/hosts +cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts +check:rc==0 +cmd:grep "s01" /etc/hosts check:rc==0 -cmd:cat /etc/hosts cmd:makehosts -d s01r1b01 check:rc==0 -cmd:cat /etc/hosts +cmd:grep "s01" /etc/hosts cmd:#!/bin/bash file="/etc/hosts" for i in {1..5}; do From 67d5caed3771353f791e2c3b74bf63815ddd8c30 Mon Sep 17 00:00:00 2001 From: yangsong Date: Wed, 20 Feb 2019 17:45:58 +0800 Subject: [PATCH 71/77] EXECUTE in sync list will not invoke post sync scripts if the script itself is updated (#6001) --- perl-xCAT/xCAT/DSHCLI.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 0aacbb3c5..bbf811e93 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -5956,8 +5956,7 @@ sub run_rsync_postscripts #the $postsfile .post will be run if: # the is updated, or - # the .post file is updated - if ($ps eq $tmppostfile or $ps eq $tmppostfile.".post" ) { + if ($ps eq $tmppostfile ) { # build xdsh queue # build host and all scripts to execute From a88db26d55d0b730f46dbb2e4a7eddfbdf714629 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Wed, 20 Feb 2019 22:20:46 -0500 Subject: [PATCH 72/77] fix issue PR #6001 resulted in test case updatenode_syncfile_EXECUTE failed #6016 --- xCAT-test/autotest/testcase/updatenode/cases0 | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index 1a109bc53..a225eadba 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -166,23 +166,33 @@ end start:updatenode_syncfile_EXECUTE label:others,updatenode -cmd:echo "echo hello > /tmp/test" > /tmp/file.post +cmd:mkdir -p /tmp/updatenode_syncfile_EXECUTE/ check:rc==0 -cmd:chmod a+x /tmp/file.post -cmd:echo "/tmp/file.post -> /tmp/file.post" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "/tmp/file.post" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:touch /tmp/updatenode_syncfile_EXECUTE/file +check:rc==0 +cmd:echo "echo hello > /tmp/test" > /tmp/updatenode_syncfile_EXECUTE/file.post +check:rc==0 +cmd:chmod a+x /tmp/updatenode_syncfile_EXECUTE/file.post +cmd:echo "/tmp/updatenode_syncfile_EXECUTE/file -> /tmp/file" > /tmp/updatenode_syncfile_EXECUTE/synclist +cmd:echo "EXECUTE:" >> /tmp/updatenode_syncfile_EXECUTE/synclist +cmd:echo "/tmp/updatenode_syncfile_EXECUTE/file.post" >> /tmp/updatenode_syncfile_EXECUTE/synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,provmethod)__ synclists=/tmp/updatenode_syncfile_EXECUTE/synclist check:rc==0 cmd:updatenode $$CN -F check:rc==0 cmd:xdsh $$CN "cat /tmp/test" check:rc==0 check:output=~hello -cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists= +cmd:xdsh $$CN "rm -rf /tmp/test" +cmd:updatenode $$CN -F check:rc==0 -cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:xdsh $$CN "cat /tmp/test" +check:rc!=0 +check:output=~No such file or directory +cmd:xdsh $$CN "rm -rf /tmp/test" +cmd:chdef -t osimage -o __GETNODEATTR($$CN,provmethod)__ synclists= check:rc==0 +cmd:rm -rf /tmp/updatenode_syncfile_EXECUTE/ end start:updatenode_syncfile_EXECUTEALWAYS From 8c9c3c600e08bfd1d28c0e3e90db9381771b06ef Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 21 Feb 2019 02:15:17 -0500 Subject: [PATCH 73/77] update xcatconfig_c case --- xCAT-test/autotest/testcase/xcatconfig/case0 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index 894446b4a..0e89ff286 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -118,13 +118,9 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 cmd:rm -rf /etc/xcat/cabak /etc/xcat/certbak check:rc==0 -cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi +cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;makeconservercf;fi check:rc==0 -cmd:if lsdef service > /dev/null 2>&1; then xdsh $$CN date;fi -check:rc==0 -cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi -check:rc==0 -cmd:if lsdef service > /dev/null 2>&1; then xdsh $$CN date;fi +cmd:if lsdef service > /dev/null 2>&1; then rpower $$CN stat;fi check:rc==0 end From 2de616520bf434f056319a95d636135fa41322f2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 21 Feb 2019 21:18:35 -0500 Subject: [PATCH 74/77] Synclist doc fixes (#6012) * Synclist doc fixes * Review fixes --- .../deployment/syncfile/syncfile_install.rst | 25 +- .../deployment/syncfile/syncfile_overview.rst | 20 +- .../syncfile/syncfile_periodically.rst | 15 +- .../syncfile/syncfile_synclist_file.rst | 41 +-- .../syncfile/syncfile_updatenode.rst | 8 +- .../deployment/syncfile/syncfile_xdcp.rst | 23 +- .../admin-guides/references/man1/lsdef.1.rst | 6 +- .../references/man1/updatenode.1.rst | 52 ++- .../admin-guides/references/man1/xdcp.1.rst | 325 +++++++----------- xCAT-client/pods/man1/updatenode.1.pod | 38 +- xCAT-client/pods/man1/xdcp.1.pod | 248 ++++--------- 11 files changed, 287 insertions(+), 514 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst index 5139616fa..08b000fca 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst @@ -1,9 +1,7 @@ Synchronizing Files during the installation process ----------------------------------------------------- +--------------------------------------------------- -The policy table must have the entry to allow syncfiles postscript to access the Management Node. Make sure this entry is in your table: - - ``tabdump policy`` :: +The **policy** table must have the entry to allow **syncfiles** postscript to access the Management Node. Make sure this entry is in your **policy** table: :: #priority,name,host,commands,noderange,parameters,time,rule,comments,disable . @@ -15,23 +13,21 @@ The policy table must have the entry to allow syncfiles postscript to access the Hierarchy and Service Nodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If using Service nodes to manage you nodes, you should make sure that the service nodes have been synchronized with the latest files from the Management Node before installing. If you have a group of compute nodes (compute) that are going to be installed that are serviced by SN1, then run the following before the install to sync the current files to SN1. Note: the noderange is the compute node names, updatenode will figure out which service nodes need updating. +If using Service nodes to manage you nodes, you should make sure that the service nodes have been synchronized with the latest files from the Management Node before installing. If you have a group of compute nodes **compute** that are going to be installed that are serviced by SN1, then run the following before the install to sync the current files to SN1.:: -``updatenode compute -f`` + updatenode compute -f + +.. note:: ``updatenode`` will figure out which service nodes need updating. Diskful installation ~~~~~~~~~~~~~~~~~~~~ - - -The 'syncfiles' postscript is in the defaults section of the postscripts table. To enable the syn files postscript to sync files to the nodes during install the user need to do the following: +The **syncfiles** postscript is in the defaults section of the **postscripts** table. To enable the **syncfiles** postscript to sync files to the nodes during install the user need to do the following: * Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label` ) * Put the synclist into the proper location for the node type (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`) -Make sure your postscripts table has the syncfiles postscript listed - -``tabdump postscripts`` :: +Make sure your **postscripts** table has the syncfiles postscript listed:: #node,postscripts,postbootscripts,comments,disable "xcatdefaults","syslog,remoteshell,syncfiles","otherpkgs",, @@ -39,9 +35,8 @@ Make sure your postscripts table has the syncfiles postscript listed Diskless Installation ~~~~~~~~~~~~~~~~~~~~~ -The diskless boot is similar with the diskful installation for the synchronizing files operation, except that the packimage commands will sync files to the root directories of image during the creating image process. +The diskless boot is similar with the diskful installation for the synchronizing files operation, except that the ``packimage`` command will sync files to the root directories of image during the creating image process. -Creating the synclist file as the steps in Diskful installation section, then the synced files will be synced to the os image during the packimage and mkdsklsnode commands running. +Creating the synclist file as the steps in Diskful installation section, then the synced files will be synced to the os image during the ``packimage`` and ``mkdsklsnode`` commands running. Also the files will always be re-synced during the booting up of the diskless node. - diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst index d0d18af6f..eeb5c3de6 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst @@ -1,24 +1,26 @@ Overview -------- -Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the new-deploying or deployed nodes. +Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the newly-deploying or deployed nodes. -This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. +This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc** directory, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the files to be synced in a configuration file, called "synclist". -The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the special one for a particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage. +The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the unique for each particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage. -``xdcp`` command supplies the basic Syncing File function. If the **'-F synclist'** option is specified in the ``xdcp`` command, it syncs files configured in the synclist to the nodes. If the **'-i PATH'** option is specified with **'-F synclist'**, it syncs files to the root image located in the PATH directory. (**Note: the '-i PATH' option is only supported for Linux nodes**) +``xdcp`` command supplies the basic Syncing File function. If the **-F synclist** option is specified in the ``xdcp`` command, it syncs files configured in the synclist to the nodes. If the **-i ** option is specified with **-F synclist**, it syncs files to the root image located in the directory. -``xdcp`` supports hierarchy where service nodes are used. If a node is serviced by a service node, ``xdcp`` will sync the files to the service node first, then sync the files from service node to the compute node. The files are place in an intermediate directory on the service node defined by the SNsyncfiledir attribute in the site table. The default is **/var/xcat/syncfiles**. +.. note:: The **-i ** option is only supported for Linux nodes + +``xdcp`` supports hierarchy where service nodes are used. If a node is serviced by a service node, ``xdcp`` will sync the files to the service node first, then sync the files from service node to the compute node. The files are placed in an intermediate directory on the service node defined by the **SNsyncfiledir** attribute in the **site** table. The default is **/var/xcat/syncfiles**. Since ``updatenode -F`` calls the ``xdcp`` to handle the Syncing File function, the ``updatenode -F`` also supports the hierarchy. -For a new-installing nodes, the Syncing File action will be triggered when performing the postscripts for the nodes. A special postscript named **'syncfiles'** is used to initiate the Syncing File process. +For a new-installing nodes, the Syncing File action will be triggered when running the postscripts for the nodes. A special postscript named **syncfiles** is used to initiate the Syncing File process. -The postscript **'syncfiles'** is located in the **/install/postscripts/**. When running, it sends a message to the xcatd on the management node or service node, then the xcatd figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node. +The postscript **syncfiles** is located in the **/install/postscripts/**. When running, it sends a message to the **xcatd** on the management node or service node, then the **xcatd** figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node. -**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes. You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** +If installing nodes in a hierarchical configuration, you must sync the service nodes first to make sure they are updated. The compute nodes will be synced from their service nodes. You can use the ``updatenode -f`` command to sync all the service nodes for range of compute nodes provided. -For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. If performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and classify the nodes which using same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes. +For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. While performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and groups the nodes which will be using the same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst index adaa6b332..b699f503f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst @@ -1,24 +1,15 @@ Run the Syncing File action periodically ------------------------------------------ +---------------------------------------- If the admins want to run the Syncing File action automatically or periodically, the ``xdcp -F``, ``xdcp -i -F`` and ``updatenode -F`` commands can be used in the script, crontab or FAM directly. For example: -Use the cron daemon to sync files in the **/install/custom///..synclist** to the nodegroup 'compute' every 10 minutes by the xdcp command by adding this to crontab. : :: +Use the **cron** daemon to sync files in the **/install/custom///..synclist** to the nodegroup **compute** every 10 minutes with the **xdcp** command by adding this to **crontab**. : :: */10 * * * * root /opt/xcat/bin/xdcp compute -F /install/custom///..synclist -Use the cron daemon to sync files for the nodegroup 'compute' every 10 minutes by updatenode command. :: +Use the **cron** daemon to sync files for the nodegroup **compute** every 10 minutes with ``updatenode`` command. :: */10 * * * * root /opt/xcat/bin/updatenode compute -F -** Related To do** -Add reference - - - - - - - diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst index 46213a9e5..3d2232995 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst @@ -33,15 +33,15 @@ sync file **/etc/file2** to the file **/etc/file3** on the node (with different /etc/file2 -> /etc/file3 -sync file **/etc/file4** to the file **/etc/tmp/file5** on the node( different file name and directory). The directory will be automatically created for you. :: +sync file **/etc/file4** to the file **/etc/tmp/file5** on the node (different file name and directory). The directory will be automatically created for you. :: /etc/file4 -> /etc/tmp/file5 -sync the multiple files **/etc/file1**, **/etc/file2**, **/etc/file3**, ... to the directory **/tmp/etc** (**/tmp/etc** must be a directory when multiple files are synced at one time). If the directory does not exist, **xdcp** will create it. :: +sync the multiple files **/etc/file1**, **/etc/file2**, **/etc/file3**, ... to the directory **/tmp/etc** (**/tmp/etc** must be a directory when multiple files are synced at one time). If the directory does not exist, it will be created. :: /etc/file1 /etc/file2 /etc/file3 -> /tmp/etc -sync file **/etc/file2** to the file /etc/file2 on the node :: +sync file **/etc/file2** to the file **/etc/file2** on the node :: /etc/file2 -> /etc/ @@ -49,7 +49,7 @@ sync all files in **/home/mikev** to directory **/home/mikev** on the node :: /home/mikev/* -> /home/mikev/ -Note: Don't try to sync files to the read only directory on the target node. +.. note:: Don't try to sync files to the read only directory on the target node. An example of synclist file ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -59,7 +59,7 @@ Sync the file **/etc/common_hosts** to the two places on the target node: put on /etc/common_hosts -> /etc/hosts /etc/common_hosts -> /tmp/etc/hosts -Sync files in the directory **/tmp/prog1** to the directory **/prog1** on the target node, and the postfix **'.tmpl'** needs to be removed on the target node. (directory **/tmp/prog1/** contains two files: **conf1.tmpl** and **conf2.tmpl**) Following configuration entries should be added :: +Sync files in the directory **/tmp/prog1** to the directory **/prog1** on the target node, and the postfix **.tmpl** needs to be removed on the target node. (directory **/tmp/prog1/** contains two files: **conf1.tmpl** and **conf2.tmpl**) Following configuration entries should be added :: /tmp/prog1/conf1.tmpl -> /prog1/conf1 /tmp/prog1/conf2.tmpl -> /prog1/conf2 @@ -78,7 +78,7 @@ Sample synclist file :: /tmp/* -> /tmp/ /etc/testfile -> /etc/ -If the above syncfile is used by the **updatenode/xdcp** commands, or used in a node installation process, the following files will exist on the target node with the following contents. :: +If the above syncfile is used by the ``updatenode``/``xdcp`` commands, or used in a node installation process, the following files will exist on the target node with the following contents. :: /etc/hosts(It has the same content with /etc/common_hosts on the MN) /tmp/etc/hosts(It has the same content with /etc/common_hosts on the MN) @@ -104,29 +104,24 @@ The noderange can have several formats. Following examples show that **/etc/host /etc/hosts -> (group1) /etc/hosts # The /etc/hosts file is synced to nodes in group1 /etc/hosts -> (group1,group2) /etc/hosts # The /etc/hosts file is synced to nodes in group1 and group2 -postscript support -~~~~~~~~~~~~~~~~~~ - -Putting the filename.post in the **rsyncfile** to ``rsync`` to the node is required for hierarchical clusters. It is optional for non-hierarchical cluster. - Advanced synclist file features ''''''''''''''''''''''''''''''' **EXECUTE** -The **EXECUTE** clause is used to list all the postscripts you would like to run after the files are sync'd, only if the file is updated. The files in this list must be added to the list of files to rsync. If noderange is used in the synclistfor the file listed in the **EXECUTE** clause, the script will only be exectuted on the nodes in that noderange. +The **EXECUTE** clause is used to list all the postsync scripts (.post) you would like to run after the files are synced, only if the file is updated. For hierarchical clusters, the postsync files in this list must also be added to the list of files to sync. It is optional for non-hierarchical clusters. If noderange is used in the synclist for the file listed in the **EXECUTE** clause, the postsync script will only be executed on the nodes in that noderange. The **EXECUTE** clause is not supported oif ``-r /usr/bin/scp`` option is used with ``xdcp`` or ``updatenode`` command. **EXECUTEALWAYS** -The **EXECUTEALWAYS** clause is used to list all the postscripts you would like to run after the files are sync'd, whether or not any file is actually updated. The files in this list must be added to the list of files to rsync. If noderange is used in the synclist for the file listed in the **EXECUTEALWAYS** clause, the script will only be exectuted on the nodes in that noderange. +The **EXECUTEALWAYS** clause is used to list all the postsync scripts you would like to run after the files are synced, whether or not any file is actually updated. The files in this list must be added to the list of files to sync. If noderange is used in the synclist for the file listed in the **EXECUTEALWAYS** clause, the script will only be exectuted on the nodes in that noderange. .. note:: The path to the file to EXECUTE or EXECUTEALWAYS, is the location of the file on the MN. -For example, your rsyncfile may look like this.:: +For example, your syncfile may look like this.:: /tmp/share/file2 -> /tmp/file2 /tmp/share/file2.post -> /tmp/file2.post (required for hierarchical clusters) - /tmp/share/file3 -> /tmp/file3 + /tmp/share/file3 -> /tmp/filex /tmp/share/file3.post -> /tmp/file3.post (required for hierarchical clusters) /tmp/myscript1 -> /tmp/myscript1 /tmp/myscript2 -> /tmp/myscript2 @@ -138,7 +133,7 @@ For example, your rsyncfile may look like this.:: /tmp/myscript1 /tmp/myscript2 -If **/tmp/file2** is updated on the node in **/tmp/file2**, then **/tmp/file2**.post is automatically run on that node. If **/tmp/file3** is updated on the node in **/tmp/filex**, then **/tmp/file3**.post is automatically run on that node. +If **/tmp/file2** is updated on the node in **/tmp/file2**, then **/tmp/file2.post** is automatically executed on that node. If **/tmp/file3** is updated on the node in **/tmp/filex**, then **/tmp/file3.post** is automatically executed on that node. **APPEND** @@ -163,11 +158,11 @@ For example, your synclist file may look like this: :: When you use the **APPEND** clause, the source file to the left of the arrow is appended to the file to the right of the arrow. In this example, **/etc/myappenddir/appendfile** is appended to **/etc/mysetup/setup** file, which must already exist on the node. The **/opt/xcat/share/xcat/scripts/xdcpappend.sh** is used to accomplish this. -The script creates a backup of the original file on the node in the directory defined by the site table `nodesyncfiledir` attribute, which is **/var/xcat/node/syncfiles** by default. To update the original file when using the function, you need to rsync a new original file to the node, removed the old original from the **/var/xcat/node/syncfiles/org** directory. If you want to cleanup all the files for the append function on the node, you can use ``xdsh -c`` flag. See man page for ``xdsh``. +The script creates a backup of the original file on the node in the directory defined by the **site** table **nodesyncfiledir** attribute, which is **/var/xcat/node/syncfiles** by default. To update the original file when using the function, you need to sync a new original file to the node, removed the old original from the **/var/xcat/node/syncfiles/org** directory. If you want to cleanup all the files for the append function on the node, you can use ``xdsh -c`` command. See man page for ``xdsh``. **MERGE** (supported on Linux only). -The **MERGE** clause is used to append the contents of the input file to either the **/etc/passwd**, **/etc/shadow** or **/etc/group** files. They are the only supported files. You must not put the **/etc/passwd**, **/etc/shadow**, **/etc/group** files in an **APPEND** clause if using a **MERGE** clause. For these three files you should use the **MERGE** clause. The **APPEND** will add the information to the end of the file. The **MERGE** will add or replace the information and insure that there are no duplicate entries in these files. +The **MERGE** clause is used to append the contents of the input file to either the **/etc/passwd**, **/etc/shadow** or **/etc/group** files. They are the only supported files. You must not put the **/etc/passwd**, **/etc/shadow**, **/etc/group** files in an **APPEND** clause if using a **MERGE** clause. For these three files you should use the **MERGE** clause. The **APPEND** will add the information to the end of the file. The **MERGE** will add or replace the information and ensure that there are no duplicate entries in these files. For example, your synclist file may look like this :: @@ -187,7 +182,7 @@ For example, your synclist file may look like this :: /etc/mydir/mergeshadow -> /etc/shadow /etc/mydir/mergegroup -> /etc/group -When you use the **MERGE** clause, the source file to the left of the arrow is merged into the file to the right of the arrow. It will replace any common userid's found in those files and add new userids. The **/opt/xcat/share/xcat/scripts/xdcpmerge.sh** is used to accomplish this. +When you use the **MERGE** clause, the source file to the left of the arrow is merged into the file to the right of the arrow. It will replace any common userids found in those files and add new userids. The **/opt/xcat/share/xcat/scripts/xdcpmerge.sh** is used to accomplish this. .. note:: no order of execution may be assumed by the order of **EXECUTE, EXECUTEALWAYS, APPEND and MERGE** clauses in the synclist file. @@ -198,7 +193,7 @@ The location of synclist file for updatenode and install process In the installation process or **updatenode** process, xCAT needs to figure out the location of the synclist file automatically, so the synclist should be put into the specified place with the proper name. -If the provisioning method for the node is an osimage name, then the path to the synclist will be read from the osimage definition `synclists` attribute. You can display this information by running the following command, supplying your osimage name. :: +If the provisioning method for the node is an osimage name, then the path to the synclist will be read from the osimage definition **synclists** attribute. You can display this information by running the following command, supplying your osimage name. :: lsdef -t osimage -l --netboot-compute @@ -216,7 +211,7 @@ If the provisioning method for the node is an osimage name, then the path to the rootimgdir=/install/netboot///compute **synclists=/install/custom/netboot/compute.synclist** -You can set the `synclist` path using the following command :: +You can set the synclist path using the following command :: chdef -t osimage -o --netboot-compute synclists="/install/custom/netboot/compute.synclist @@ -229,11 +224,11 @@ If the provisioning method for the node is `install`, or `netboot` then the path , and are what you set for the node For example: -The location of synclist file for the diskful installation of RedHat 7.5 with 'compute' as the profile :: +The location of synclist file for the diskful installation of RedHat 7.5 with **compute** as the profile :: /install/custom/install/rh/compute.rhels7.5.synclist -The location of synclist file for the diskless netboot of SLES 12.3 with 'service' as the profile :: +The location of synclist file for the diskless netboot of SLES 12.3 with **service** as the profile :: /install/custom/netboot/sles/service.sles12.3.synclist diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst index b7cda3461..6cfdc2d2a 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst @@ -1,7 +1,7 @@ Run the Syncing File action in the updatenode process ------------------------------------------------------- +----------------------------------------------------- -If run ``updatenode`` command with -F option, it syncs files which configured in the synclist to the nodes. ``updatenode`` does not sync images, use ``xdcp -i -F`` option to sync images. +Running ``updatenode`` command with **-F** option, will sync files configured in the synclist file to the nodes. ``updatenode`` does not sync images, use ``xdcp -i -F`` command to sync images. ``updatenode`` can be used to sync files to to diskful or diskless nodes. ``updatenode`` cannot be used to sync files to statelite nodes. @@ -9,7 +9,7 @@ Steps to make the Syncing File working in the ``updatenode -F`` command: #. Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label`) #. Put the synclist into the proper location (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`). - #. Run the ``updatenode node -F`` command to initiate the Syncing File action. + #. Run the ``updatenode -F`` command to initiate the Syncing File action. -Note: Since Syncing File action can be initiated by the ``updatenode -F`` flag, the ``updatenode -P`` does NOT support to re-run the **'syncfiles'** postscript, even if you specify the **'syncfiles'** postscript in the ``updatenode`` command line or set the **'syncfiles'** in the **postscripts.postscripts** attribute. +.. note:: Since Syncing File action can be initiated by the ``updatenode -F``, the ``updatenode -P`` does NOT support to re-run the **syncfiles** postscript, even if you specify the **syncfiles** postscript on the ``updatenode`` command line or set the **syncfiles** in the **postscripts.postscripts** attribute. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst index 20d1bb84c..41cc01990 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst @@ -1,30 +1,31 @@ Run xdcp command to perform Syncing File action ------------------------------------------------ -``xdcp`` command supplies three options **'-F' , -s, and '-i'** to support the Syncing File function. +``xdcp`` command supplies three options **-F** , **-s**, and **-i** to support the Syncing File function. - * -F|--File rsync input file + * -F|--File -Specifies the full path to the synclist file that will be used to build the ``rsync`` command +Specifies the full path to the synclist file - * -s + * -s -Specifies to rsync to the service nodes only for the input compute noderange. +Specifies to sync to the service nodes only for the input compute noderange. - * -i|--rootimg install image for Linux + * -i | --rootimg -Specifies the full path to the install image on the local node. By default, if the -F option is specified, the **'rsync'** command is used to perform the syncing file function. For the ``rsync`` in ``xdcp``, only the ***ssh** remote shell is supported for ``rsync``. ``xdcp`` uses the **'-Lpotz'** as the default flags to call the rsync command. More flags for rsync command can be specified by adding **'-o'** flag to the call to ``xdcp``. +Specifies the full path to the install image on the local node. -For example: :: +By default, if the **-F** option is specified, the ``rsync`` command is used to perform the syncing file function. Only the **ssh** remote shell is supported for ``rsync``. ``xdcp`` uses the **-Lpotz** as the default flags to call the ``rsync`` command. More flags for ``rsync`` command can be specified by adding **-o** flag to the call to ``xdcp``. + +For example you can use ``xdcp`` **-F** option to sync files which are listed in the **/install/custom/commonsyncfiles/.synclist** file to the node group named **compute**. If the node group **compute** is serviced by servicenodes, then the files will be automatically staged to the correct service nodes, and then synced to the compute nodes from those service nodes. The files will be stored in **/var/xcat/syncfiles** directory on the service nodes by default, or in the directory indicated in the **site.SNsyncfiledir** attribute. See **-s** option below. :: - Using xdcp '-F' option to sync files which are listed in the /install/custom/commonsyncfiles/.synclist directory to the node group named 'compute'. If the node group compute is serviced by servicenodes, then the files will be automatically staged to the correct service nodes, and then synced to the compute nodes from those service nodes. The files will be stored in /var/xcat/syncfiles directory on the service nodes by default, or in the directory indicated in the site.SNsyncfiledir attribute. See -s option below. xdcp compute -F /install/custom/commonsynfiles/.synclist -For Linux nodes, using **xdcp '-i'** option with **'-F'** to sync files created in the **/install/custom//.synclist** to the osimage in the directory **/install/////rootimg**: :: +For Linux nodes, you can use ``xdcp`` command **-i** option with **-F** to sync files specified in the **/install/custom//.synclist** file to the osimage in the directory **/install/////rootimg**: :: xdcp -i /install/////rootimg -F /install/custom///.synclist -Using the **xdcp '-s'** option to sync the files only to the service nodes for the node group named 'compute'. The files will be placed in the default **/var/xcat/syncfiles** directory or in the directory as indicated in the **site.SNsyncfiledir** attribute. If you want the files synched to the same directory on the service node that they come from on the Management Node, set **site.SNsyncfiledir=/**. This can be setup before a node install, to have the files available to be synced during the install: :: +You can use the ``xdcp`` **-s** option to sync the files only to the service nodes for the node group named **compute**. The files will be placed in the default **/var/xcat/syncfiles** directory or in the directory as indicated in the **site.SNsyncfiledir** attribute. If you want the files synched to the same directory on the service node that they come from on the Management Node, set **site.SNsyncfiledir=/** attribute. This can be setup before a node install, to have the files available to be synced during the install: :: xdcp compute -s -F /install/custom///.synclist diff --git a/docs/source/guides/admin-guides/references/man1/lsdef.1.rst b/docs/source/guides/admin-guides/references/man1/lsdef.1.rst index 624fc171c..0c20e42d0 100644 --- a/docs/source/guides/admin-guides/references/man1/lsdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsdef.1.rst @@ -22,12 +22,12 @@ SYNOPSIS \ **lsdef**\ [\ **-h | -**\ **-help**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-i**\ \ *attr-list*\ ] \ **lsdef**\ [\ **-V | -**\ **-verbose**\ ] [\ **-a | -**\ **-all**\ ] [\ **-S**\ ] -[\ **-t**\ \ *object-types*\ ] [\ **-o**\ \ *object-names*\ ] [\ **-z | -**\ **-stanza**\ ] [\ [\ **-i**\ \ *attr-list*\] | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]] +[\ **-t**\ \ *object-types*\ ] [\ **-o**\ \ *object-names*\ ] [\ **-z | -**\ **-stanza**\ ] [\ **-i**\ \ *attr-list*\ | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]] [\ **-c | -**\ **-compress**\ ] [\ **-**\ **-osimage**\ ] [\ **-**\ **-nics**\ ] [[\ **-w**\ \ *attr*\ ==\ *val*\ ] [\ **-w**\ \ *attr*\ =~\ *val*\ ] ...] [\ *noderange*\ ] \ **lsdef**\ [\ **-a | -**\ **-all**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-z | -**\ **-stanza**\ ] -[\ [\ **-i**\ \ *attr-list*\] | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]] [\ **-**\ **-template**\ [\ *template-object-name*\ ]] +[\ **-i**\ \ *attr-list*\ | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]] [\ **-**\ **-template**\ [\ *template-object-name*\ ]] *********** @@ -155,7 +155,7 @@ OPTIONS \ **-z|-**\ **-stanza**\ - Display output in stanza format. See the "xcatstanzafile" man page for details on using xCAT stanza files. + Display output in stanza format. See the "xcatstanzafile" man page for details on using xCAT stanza files. And default is to list complete object definition, use \ **-i**\ to specify the attribute scope. diff --git a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst index 48ed01138..57a821f0a 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **updatenode**\ \ *noderange*\ [\ **-V | -**\ **-verbose**\ ] [\ **-F | -**\ **-sync**\ ] [\ **-f | -**\ **-snsync**\ ] [\ **-r | -**\ **-node-rcp**\ [\ *full_path_to_remote_copy_command*\ ]] [\ **-S | -**\ **-sw**\ ] [\ **-l**\ \ *userID*\ ] [\ **-P | -**\ **-scripts**\ [\ *script1,script2...*\ ]] [\ **-s | -**\ **-sn**\ ] [\ **-A | -**\ **-updateallsw**\ ] [\ **-c | -**\ **-cmdlineonly**\ ] [\ **-d**\ \ *alt_source_dir*\ ] [\ **-**\ **-fanout**\ =\ *fanout_value*\ ] [\ **-t**\ \ *timeout*\ } [\ *attr=val*\ [\ *attr=val...*\ ]] [\ **-n | -**\ **-noverify**\ ] +\ **updatenode**\ \ *noderange*\ [\ **-V | -**\ **-verbose**\ ] [\ **-F | -**\ **-sync**\ ] [\ **-f | -**\ **-snsync**\ ] [\ **-r | -**\ **-node-rcp**\ [\ *node_remote_copy_command*\ ]] [\ **-S | -**\ **-sw**\ ] [\ **-l**\ \ *userID*\ ] [\ **-P | -**\ **-scripts**\ [\ *script1,script2...*\ ]] [\ **-s | -**\ **-sn**\ ] [\ **-A | -**\ **-updateallsw**\ ] [\ **-c | -**\ **-cmdlineonly**\ ] [\ **-d**\ \ *alt_source_dir*\ ] [\ **-**\ **-fanout**\ =\ *fanout_value*\ ] [\ **-t**\ \ *timeout*\ } [\ *attr=val*\ [\ *attr=val...*\ ]] [\ **-n | -**\ **-noverify**\ ] \ **updatenode**\ \ **noderange**\ [\ **-k | -**\ **-security**\ ] [\ **-t**\ \ *timeout*\ ] @@ -37,7 +37,7 @@ DESCRIPTION *********** -The updatenode command is run on the xCAT management node and can be used +The \ **updatenode**\ command is run on the xCAT management node and can be used to perform the following node updates: @@ -58,9 +58,9 @@ Update the ca and credentials for the service nodes. -The default behavior when no options are input to updatenode will be to run +The default behavior when no options are input to \ **updatenode**\ will be to run the following options \ **-S**\ , \ **-P**\ and \ **-F**\ options in this order. -If you wish to limit updatenode to specific +If you wish to limit \ **updatenode**\ to specific actions you can use combinations of the \ **-S**\ , \ **-P**\ , and \ **-F**\ flags. For example, If you just want to synchronize configuration file you could @@ -74,7 +74,7 @@ The flag \ **-f**\ (\ **-**\ **-snsync**\ ) can NOT be used together with \ **- Note: In a large cluster environment the updating of nodes in an ad hoc manner can quickly get out of hand, leaving the system administrator with -a very confusing environment to deal with. The updatenode command is +a very confusing environment to deal with. The \ **updatenode**\ command is designed to encourage users to handle cluster updates in a manner that is recorded and easily repeatable. @@ -93,14 +93,14 @@ The basic process for distributing and synchronizing nodes is: -\* Run the updatenode command to update the nodes. +\* Run the \ **updatenode**\ command to update the nodes. Files may be distributed and synchronized for both diskless and diskful nodes. Syncing files to NFS-based statelite nodes is not supported. -More information on using the synchronization file function is in the following doc: Using_Updatenode. +More information on using the synchronization file function is in the following document: Create the synclist file ------------------------ @@ -111,9 +111,7 @@ where the files should be synced to. In the synclist file, each line is an entry which describes the location of the source files and the destination location for the files on the target node. -For more information on creating your synclist files and where to put them, read: - -Sync-ing_Config_Files_to_Nodes +For more information on creating your synclist files and where to put them, read here: Run updatenode to synchronize the files @@ -382,12 +380,12 @@ OPTIONS \ **-F|-**\ **-sync**\ Specifies that file synchronization should be - performed on the nodes. rsync/scp and ssh must + performed on the nodes. \ **rsync/scp**\ and \ **ssh**\ must be installed and configured on the nodes. The function is not supported for NFS-based statelite installations. For NFS-based statelite installations to sync files, you should use the read-only option for files/directories listed in - litefile table with source location specified in the litetree table. + \ **litefile**\ table with source location specified in the \ **litetree**\ table. @@ -396,33 +394,33 @@ OPTIONS Specifies that file synchronization should be performed to the service nodes that service the nodes in the noderange. This updates the service - nodes with the data to sync to the nodes. rsync/scp and ssh must + nodes with the data to sync to the nodes. \ **rsync/scp**\ and \ **ssh**\ must be installed and configured on the service nodes. For hierarchy, this optionally can be done before syncing the files - to the nodes with the -F flag. If the -f flag is not used, then - the -F flag will sync the servicenodes before the nodes automatically. + to the nodes with the \ **-F**\ flag. If the \ **-f**\ flag is not used, then + the \ **-F**\ flag will sync the service nodes before the nodes automatically. When installing nodes in a hierarchical cluster, this flag should be used to sync the service nodes before the install, since the files will - be sync'd from the service node by the syncfiles postscript during the + be synced from the service node by the \ **syncfiles**\ postscript during the install. The function is not supported for NFS-based statelite installations. For statelite installations to sync files, you should use the read-only option for files/directories listed in - litefile table with source location specified in the litetree table. + \ **litefile**\ table with source location specified in the \ **litetree**\ table. -[\ **-r | -**\ **-node-rcp**\ [\ *full_path_to_remote_copy_command*\ ]] +[\ **-r | -**\ **-node-rcp**\ [\ *node_remote_copy_command*\ ]] - Specifies the full path of the remote copy command used for syncing files to node targets, such as "/usr/bin/rsync" or "/usr/bin/scp". If not specified, rsync will be used by default. + Specifies the full path of the remote copy command used for syncing files to node targets, such as \ **/usr/bin/rsync**\ or \ **/usr/bin/scp**\ . If not specified, \ **rsync**\ will be used by default. - Notice: The synclist for "-r /usr/bin/scp" has some differences with "-r /usr/bin/rsync": + Note: The synclist processing for \ **-r /usr/bin/scp**\ has some differences with \ **-r /usr/bin/rsync**\ : - 1) the \`\`EXECUTE\`\` clause is not supported in "-r /usr/bin/scp" + 1) the \ **EXECUTE**\ clause in synclist file is not supported with \ **-r /usr/bin/scp**\ flag - 2) if the destination directory specified in synclist is an existing file on target node, "updatenode -r /usr/bin/scp" will fail with \`\`scp: : Not a directory\`\` + 2) if the destination directory specified in synclist file is an existing file on target node, \ **updatenode -r /usr/bin/scp**\ will fail with "scp: : Not a directory" - 3) if the destination file specified in synclist is an existing directory on target node, "updatenode -r /usr/bin/scp" will fail with \`\`scp: : Is a directory\`\` + 3) if the destination file specified in synclist file is an existing directory on target node, \ **updatenode -r /usr/bin/scp**\ will fail with "scp: : Is a directory" @@ -461,8 +459,8 @@ OPTIONS \ **-P|-**\ **-scripts**\ Specifies that postscripts and postbootscripts should be run on the nodes. - updatenode -P syncfiles is not supported. The syncfiles postscript can only - be run during install. You should use updatenode -F instead. + File sync with \ **updatenode -P syncfiles**\ is not supported. The \ **syncfiles**\ postscript can only + be run during install. You should use \ **updatenode -F**\ instead. @@ -546,14 +544,14 @@ EXAMPLES -3. Running updatenode -P with the syncfiles postscript is not supported. You should use updatenode -F instead. +3. Running \ **updatenode -P**\ with the \ **syncfiles**\ postscript is not supported. You should use \ **updatenode -F**\ instead. Do not run: .. code-block:: perl - updatenode clstrno1 -P syncfiles + updatenode clstrn01 -P syncfiles Run: diff --git a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst index 7b1ea700d..fe9661d72 100644 --- a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst @@ -11,7 +11,7 @@ xdcp.1 ************ -\ **xdcp**\ - Concurrently copies files to or from multiple nodes. In addition, provides an option to use rsync to update the files on the nodes, or to an installation image on the local node. +\ **xdcp**\ - Concurrently copies files to or from multiple nodes. In addition, provides an option to use \ **rsync**\ to update the files on the managed nodes, or to an installation image on the local node. **************** @@ -19,13 +19,13 @@ xdcp.1 **************** -\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node_remote_shell*\ ] [\ **-R**\ ] [\ **-t**\ \ *timeout*\ ] [\ **-T**\ ] [\ **-v**\ ] [\ **-q**\ ] [\ **-X**\ \ *env_list*\ ] \ *sourcefile.... targetpath*\ +\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command] [\ \*\*-R\*\*\ ] [\ \*\*-t\*\*\ \ \*timeout\*\ ] [\ \*\*-T\*\*\ ] [\ \*\*-v\*\*\ ] [\ \*\*-q\*\*\ ] [\ \*\*-X\*\*\ \ \*env_list\*\ ] \ \*sourcefile.... targetpath\*\ *\ -\ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsync input file*\ ] +\ **xdcp**\ \ *noderange*\ [\ **-F**\ Irsynclist input file>] [\ **-r**\ \ *node remote copy command*\ ] -\ **xdcp**\ \ *computenoderange*\ [\ **-s**\ \ **-F**\ \ *rsync input file*\ ] +\ **xdcp**\ \ *computenoderange*\ [\ **-s**\ \ **-F**\ \ *synclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] -\ **xdcp**\ [\ **-i**\ \ *path to install image*\ ] [\ **-F**\ \ *rsync input file*\ ] +\ **xdcp**\ [\ **-i**\ \ *install image*\ ] [\ **-F**\ \ *synclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] \ **xdcp**\ [\ **-h**\ | \ **-V**\ | \ **-q**\ ] @@ -36,33 +36,32 @@ xdcp.1 The \ **xdcp**\ command concurrently copies files to or from remote target -nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the target_path with the name of the -remote node or device appended to the copied source_file name. The -/usr/bin/rcp command is the model for syntax and security. -If using hierarchy, then xdcp runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, SNsyncfiledir attribute, or the default path /var/xcat/syncfiles on the service node, if the attribute is not defined. The -P flag will not automatically copy +nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the \ *targetpath*\ with the name of the +remote node or device appended to the copied \ *sourcefile*\ name. The +\ **/usr/bin/rcp**\ command is the model for syntax and security. +If using hierarchy, then \ **xdcp**\ runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, \ **SNsyncfiledir**\ attribute, or the default path \ **/var/xcat/syncfiles**\ on the service node, if the attribute is not defined. The \ **-P**\ flag will not automatically copy the files from the compute node to the Management node, hierarchically. There is a two step process, see \ **-P**\ flag. -If the Management Node is target node, it must be defined in the xCAT database with nodetype=mn. When the \ **xdcp**\ command runs the Management Node as the target, it does not use remote commands but uses the local OS copy (\ **cp**\ ) command. +If the Management Node is target node, it must be defined in the xCAT database with \ **nodetype=mn**\ . When the \ **xdcp**\ command runs with the Management Node as the target, it does not use remote commands but uses the local OS copy (\ **cp**\ ) command. \ **REMOTE**\ \ **USER**\ : -A user_ID can be specified for the remote copy command. Remote user -specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands. See the \ **xdsh**\ -command for more information. +A user_ID can be specified for the remote copy command. Remote user +specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands. +See the \ **xdsh**\ command for more information. \ **REMOTE**\ \ **COMMAND**\ \ **COPY**\ : The \ **xdcp**\ command uses a configurable remote copy command to execute remote copies on remote targets. Support is explicitly provided for -Remote Shell rcp command, the OpenSSH scp command and the -/usr/bin/rsync command. +Remote Shell \ **rcp**\ command, the OpenSSH \ **scp**\ command and the +\ **/usr/bin/rsync**\ command. -For node targets, the remote copy command is determined by the follow- -ing order of precedence: +For node targets, the remote copy command is determined by the following order of precedence: 1. The \ **-r**\ flag. -2. The \ **/usr/bin/scp**\ command. +2. The \ **/usr/bin/rsync**\ command. \ **COMMAND**\ \ **EXECUTIONS**\ : @@ -75,10 +74,10 @@ appropriate. A timeout value for remote copy command execution can be specified with the \ **-t**\ flag or DSH_TIMEOUT environment variable. If any remote target -does not respond within the timeout value, the xdcp command displays an +does not respond within the timeout value, the \ **xdcp**\ command displays an error message and exits. -The \ **-T**\ flag provides diagnostic trace information for dcp command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. +The \ **-T**\ flag provides diagnostic trace information for \ **xdcp**\ command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. The \ **xdcp**\ command can be executed silently using the \ **-Q**\ flag; no target standard output or standard error is displayed. @@ -94,170 +93,45 @@ standard output or standard error is displayed. Specifies the complete path for the file to be copied to or from the target. Multiple files can be specified. When used - with the -R flag, only a single directory can be specified. - When used with the -P flag, only a single file can be specified. + with the \ **-R**\ flag, only a single directory can be specified. + When used with the \ **-P**\ flag, only a single file can be specified. \ *targetpath*\ - If one source_file file, then it specifies the file to copy the source_file - file to on the target. If multiple source_file files, it specifies - the directory to copy the source_file files to on the target. - If the -P flag is specified, the target_path is the local host location + If one source file, then it specifies the file to copy the source + file to on the target. If multiple source files, it specifies + the directory to copy the source files to on the target. + If the \ **-P**\ flag is specified, the \ *targetpath*\ is the local host location for the copied files. The remote file directory structure is recreated - under target_path and the remote target name is appended - to the copied source_file name in the target_path directory. - Note: the targetpath directory must exist. + under \ *targetpath*\ and the remote target name is appended + to the copied \ *sourcefile*\ name in the \ *targetpath*\ directory. + Note: the \ *targetpath*\ directory must exist. \ **-B | -**\ **-bypass**\ - Runs in bypass mode, use if the xcatd daemon is hung. + Runs in bypass mode, use if the \ **xcatd**\ daemon is not responding. \ **-f | -**\ **-fanout**\ \ *fanout_value*\ - Specifies a fanout value for the maximum number of concur- - rently executing remote shell processes. Serial execution + Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of \ **1**\ . If \ **-f**\ is not specified, a default fanout value of \ **64**\ is used. -\ **-F | -**\ **-File**\ \ *rsync input file*\ +\ **-F | -**\ **-File**\ \ *synclist input file*\ Specifies the path to the file that will be used to build the \ **rsync**\ command. - The format of the input file is as follows, each line contains: + The format of the input file is described here: - - .. code-block:: perl - - ... -> < path to destination file/directory> - - - or - - - .. code-block:: perl - - -> - - - or - - - .. code-block:: perl - - -> - - - For example: - - - .. code-block:: perl - - /etc/password /etc/hosts -> /etc - - /tmp/file2 -> /tmp/file2 - - /tmp/file2 -> /tmp/ - - /tmp/filex -> /tmp/source/filey - - /etc/* -> /etc/ - - - \ **Running postscripts after files are sync'd to the nodes**\ : - - After you define the files to rsync, you can add an \ **EXECUTE:**\ clause in the synclist file. The \ **EXECUTE:**\ clause will list all the postscripts that you would like to run after the files are sync'd to the node. - The postscript file must be of the form \ **filename.post**\ , where the - is the is the from , reside in the same - directory as \ **filename**\ , and be executable. - If the file \ **filename**\ is rsync'd to the node, then the \ **filename.post**\ - will automatically be run on the node. - If the file \ **filename**\ is not updated on the node, the \ **filename.post**\ will not be run. - - Putting the \ **filename.post**\ in the file list to rsync to the node is required - for hierarchical clusters. It is optional for non-hierarchical clusters. - - Another option is the \ **EXECUTEALWAYS:**\ clause in the synclist file. The \ **EXECUTEALWAYS:**\ will list all the postscripts that you would like to run after the files are sync'd to the nodes. These scripts will run whether or not any files are sync'd to the nodes. The scripts have no special format, but must contain the fully qualified path. - - The scripts must be also added to the file list to rsync to the node for hierarchical clusters. It is optional for non-hierarchical clusters. - - For example, your rsynclist file may look like this: - - - .. code-block:: perl - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - - - If /tmp/file2 and /tmp/file3 update /tmp/file2 and /tmp/filex on the node, then the postscripts /tmp/file2.post and /tmp/file3.post are automatically run on - the node. /tmp/myscript will always be run on the node. - - Another option is the \ **APPEND:**\ clause in the synclist file. The \ **APPEND:**\ clause is used to append the contents of the input file to an existing file on the node. The file to append \ **must**\ already exist on the node and not be part of the synclist that contains the \ **APPEND:**\ clause. - - For example, your rsynclist file may look like this: - - - .. code-block:: perl - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /etc/myappenddir/appendfile -> /etc/mysetup/setup - /etc/myappenddir/appendfile2 -> /etc/mysetup/setup2 - - - When you use the append script, the file (left) of the arrow is appended to the file right of the arrow. In this example, /etc/myappenddir/appendfile is appended to /etc/mysetup/setup file, which must already exist on the node. The /opt/xcat/share/xcat/scripts/xdcpappend.sh is used to accomplish this. - - Another option is the \ **MERGE:**\ clause in the synclist file. The \ **MERGE:**\ clause is used to append the contents of the input file to /etc/passwd, /etc/group, or /etc/shadow on a Linux node. It is only supported for those files and only on Linux. You must not use both the APPEND and MERGE funcion for these three files. The processing could end up not creating the file you desire. The MERGE function is the preferred method, because APPEND only adds to the file. MERGE will add to the file but also insure there are no duplicate entries. - - For example, your rsynclist file may look like this: - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /custom/mypasswd -> /etc/passwd - /custom/mygroups -> /etc/group - /custom/myshadow -> /etc/shadow - - Note: no order can be assumed by the order that the EXECUTE,EXECUTEALWAYS and APPEND clause fall in the synclist file. - - For more information on syncing files to node, read Sync-ing_Config_Files_to_Nodes - - On Linux rsync always uses ssh remoteshell. On AIX, ssh or rsh is used depending on the site.useSSHonAIX attribute. + On Linux \ **rsync**\ always uses ssh remoteshell. On AIX, \ **ssh**\ or \ **rsh**\ is used depending on the \ **site.useSSHonAIX**\ table attribute. @@ -269,7 +143,7 @@ standard output or standard error is displayed. \ **-i | -**\ **-rootimg**\ \ *install image*\ - Specifies the path to the install image on the local Linux node. + Specifies the path to the install image on the local Linux node. @@ -277,7 +151,7 @@ standard output or standard error is displayed. Specifies options to pass to the remote shell command for node targets. The options must be specified within double - quotation marks ("") to distinguish them from \ **xdsh**\ options. + quotation marks ("") to distinguish them from \ **xdcp**\ options. @@ -291,14 +165,14 @@ standard output or standard error is displayed. \ **-P | -**\ **-pull**\ Pulls (copies) the files from the targets and places them in - the target_path directory on the local host. The target_path + the \ *targetpath*\ directory on the local host. The \ *targetpath*\ must be a directory. Files pulled from remote machines have - ._target appended to the file name to distinguish between - them. When the \ **-P**\ flag is used with the \ **-R**\ flag, ._target is + \ **._target**\ appended to the file name to distinguish between + them. When the \ **-P**\ flag is used with the \ **-R**\ flag, \ **._target**\ is appended to the directory. Only one file per invocation of the - xdcp pull command can be pulled from the specified targets. - Hierarchy is not automatically support yet. You must first pull - the file to the Service Node and then pull the file to the Management + \ **xdcp**\ pull command can be pulled from the specified targets. + In hierarchy, you must first pull + the file to the service node and then pull the file to the management node. @@ -313,10 +187,17 @@ standard output or standard error is displayed. -\ **-r | -**\ **-node-rcp**\ \ *node_remote_copy*\ +\ **-r | -**\ **-node-rcp**\ \ *node remote copy command*\ - Specifies the full path of the remote copy command used - for remote command execution on node targets. + Specifies the full path of the remote copy command used for syncing files to node targets, such as \ **/usr/bin/rsync**\ or \ **/usr/bin/scp**\ . If not specified, \ **rsync**\ will be used by default. + + Note: The synclist processing for \ **-r /usr/bin/scp**\ has some differences with \ **-r /usr/bin/rsync**\ : + + 1) the \ **EXECUTE**\ clause in synclist file is not supported with \ **-r /usr/bin/scp**\ flag + + 2) if the destination directory specified in synclist file is an existing file on target node, \ **xdcp -r /usr/bin/scp**\ will fail with "scp: : Not a directory" + + 3) if the destination file specified in synclist file is an existing directory on target node, \ **xdcp -r /usr/bin/scp**\ will fail with "scp: : Is a directory" @@ -325,8 +206,7 @@ standard output or standard error is displayed. Recursively copies files from a local directory to the remote targets, or when specified with the \ **-P**\ flag, recursively pulls (copies) files from a remote directory to the local host. A - single source directory can be specified using the source_file - parameter. + single source directory can be specified using the \ *sourcefile*\ parameter. @@ -334,8 +214,8 @@ standard output or standard error is displayed. Will only sync the files listed in the synclist (\ **-F**\ ), to the service nodes for the input compute node list. The files will be placed in the - directory defined by the site.SNsyncfiledir attribute, or the default - /var/xcat/syncfiles directory. + directory defined by the \ **site.SNsyncfiledir**\ table attribute, or the default + \ **/var/xcat/syncfiles**\ directory. @@ -447,9 +327,8 @@ standard output or standard error is displayed. \ **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. @@ -463,13 +342,12 @@ Exit values for each remote copy command execution are displayed in messages from the xdcp command, if the remote copy command exit value is non-zero. A non-zero return code from a remote copy command indicates that an error was encountered during the remote copy. If a remote copy -command encounters an error, execution of the remote copy on that tar- -get is bypassed. +command encounters an error, execution of the remote copy on that target is bypassed. -The xdcp command exit code is 0, if the xdcp command executed without +The \ **xdcp**\ command exit code is 0, if the \ **xdcp**\ command executed without errors and all remote copy commands finished with exit codes of 0. If -internal xdcp errors occur or the remote copy commands do not complete -successfully, the xdcp command exit value is greater than 0. +internal \ **xdcp**\ errors occur or the remote copy commands do not complete +successfully, the \ **xdcp**\ command exit value is greater than 0. **************** @@ -530,7 +408,7 @@ host as /var/log._target, enter: -3. To copy /localnode/smallfile and /tmp/bigfile to /tmp on node1 +3. To copy /localnode/smallfile and /tmp/bigfile to B/tmp on node1 using rsync and input -t flag to rsync, enter: @@ -587,15 +465,23 @@ from the local host to node1 in the cluster, enter: 8. To rsync the /etc/hosts file to your compute nodes: - Create a rsync file /tmp/myrsync, with this line: + First create a syncfile /tmp/myrsync, with this line: + + + .. code-block:: perl + + /etc/hosts -> /etc/hosts - /etc/hosts -> /etc/hosts or - /etc/hosts -> /etc/ (last / is required) - Run: + .. code-block:: perl + + /etc/hosts -> /etc/ (last / is required) + + + Then run: .. code-block:: perl @@ -607,11 +493,15 @@ from the local host to node1 in the cluster, enter: 9. To rsync all the files in /home/mikev to the compute nodes: - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: - /home/mikev/\* -> /home/mikev/ (last / is required) - Run: + .. code-block:: perl + + /home/mikev/* -> /home/mikev/ (last / is required) + + + Then run: .. code-block:: perl @@ -621,18 +511,25 @@ from the local host to node1 in the cluster, enter: -10. To rsync to the compute nodes, using service nodes, the command will first -rsync the files to the /var/xcat/syncfiles directory on the service nodes and then rsync the files from that directory to the compute nodes. The /var/xcat/syncfiles default directory on the service nodes, can be changed by putting a directory value in the site table SNsyncfiledir attribute. +10. To rsync to the compute nodes, using service nodes: - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: + + + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc - /etc/hosts /etc/passwd -> /etc or - /etc/hosts /etc/passwd -> /etc/ - Run: + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc/ + + + Then run: .. code-block:: perl @@ -640,18 +537,20 @@ rsync the files to the /var/xcat/syncfiles directory on the service nodes and t xdcp compute -F /tmp/myrsync - to update the Compute Nodes - 11. To rsync to the service nodes in preparation for rsyncing the compute nodes during an install from the service node. - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: - /etc/hosts /etc/passwd -> /etc - Run: + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc + + + Then run: .. code-block:: perl @@ -659,19 +558,21 @@ during an install from the service node. xdcp compute -s -F /tmp/myrsync - to sync the service node for compute - 12. To rsync the /etc/file1 and file2 to your compute nodes and rename to filex and filey: - Create a rsync file /tmp/myrsync, with these line: + First create a rsync file /tmp/myrsync, with these line: - /etc/file1 -> /etc/filex - /etc/file2 -> /etc/filey + .. code-block:: perl - Run: + /etc/file1 -> /etc/filex + + /etc/file2 -> /etc/filey + + + Then run: .. code-block:: perl @@ -685,11 +586,15 @@ during an install from the service node. 13. To rsync files in the Linux image at /install/netboot/fedora9/x86_64/compute/rootimg on the MN: - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: - /etc/hosts /etc/passwd -> /etc - Run: + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc + + + Then run: .. code-block:: perl diff --git a/xCAT-client/pods/man1/updatenode.1.pod b/xCAT-client/pods/man1/updatenode.1.pod index dbfd3cb24..782722996 100644 --- a/xCAT-client/pods/man1/updatenode.1.pod +++ b/xCAT-client/pods/man1/updatenode.1.pod @@ -18,7 +18,7 @@ B [B<-h>|B<--help>] [B<-v>|B<--version>] =head1 DESCRIPTION -The updatenode command is run on the xCAT management node and can be used +The B command is run on the xCAT management node and can be used to perform the following node updates: =over 3 @@ -38,9 +38,9 @@ Update the ca and credentials for the service nodes. =back -The default behavior when no options are input to updatenode will be to run +The default behavior when no options are input to B will be to run the following options B<-S>, B<-P> and B<-F> options in this order. -If you wish to limit updatenode to specific +If you wish to limit B to specific actions you can use combinations of the B<-S>, B<-P>, and B<-F> flags. For example, If you just want to synchronize configuration file you could @@ -55,7 +55,7 @@ The flag B<-f> (B<--snsync>) can NOT be used together with B<-S>, B<-P>, and B<- Note: In a large cluster environment the updating of nodes in an ad hoc manner can quickly get out of hand, leaving the system administrator with -a very confusing environment to deal with. The updatenode command is +a very confusing environment to deal with. The B command is designed to encourage users to handle cluster updates in a manner that is recorded and easily repeatable. @@ -72,14 +72,14 @@ Create a synclist file. Indicate the location of the synclist file. =item * -Run the updatenode command to update the nodes. +Run the B command to update the nodes. =back Files may be distributed and synchronized for both diskless and diskful nodes. Syncing files to NFS-based statelite nodes is not supported. -More information on using the synchronization file function is in the following doc: Using_Updatenode. +More information on using the synchronization file function is in the following document: =head3 Create the synclist file @@ -88,9 +88,7 @@ where the files should be synced to. In the synclist file, each line is an entry which describes the location of the source files and the destination location for the files on the target node. -For more information on creating your synclist files and where to put them, read: - -Sync-ing_Config_Files_to_Nodes +For more information on creating your synclist files and where to put them, read here: =head3 Run updatenode to synchronize the files @@ -289,12 +287,12 @@ Used to specify a source directory other than the standard lpp_source directory =item B<-F|--sync> Specifies that file synchronization should be -performed on the nodes. rsync/scp and ssh must +performed on the nodes. B and B must be installed and configured on the nodes. The function is not supported for NFS-based statelite installations. For NFS-based statelite installations to sync files, you should use the read-only option for files/directories listed in -litefile table with source location specified in the litetree table. +B table with source location specified in the B table. =item B<-f|--snsync> @@ -302,19 +300,19 @@ litefile table with source location specified in the litetree table. Specifies that file synchronization should be performed to the service nodes that service the nodes in the noderange. This updates the service -nodes with the data to sync to the nodes. rsync/scp and ssh must +nodes with the data to sync to the nodes. B and B must be installed and configured on the service nodes. For hierarchy, this optionally can be done before syncing the files -to the nodes with the -F flag. If the -f flag is not used, then -the -F flag will sync the servicenodes before the nodes automatically. +to the nodes with the B<-F> flag. If the B<-f> flag is not used, then +the B<-F> flag will sync the service nodes before the nodes automatically. When installing nodes in a hierarchical cluster, this flag should be used to sync the service nodes before the install, since the files will -be sync'd from the service node by the syncfiles postscript during the +be synced from the service node by the B postscript during the install. The function is not supported for NFS-based statelite installations. For statelite installations to sync files, you should use the read-only option for files/directories listed in -litefile table with source location specified in the litetree table. +B table with source location specified in the B table. =item [B<-r>|B<--node-rcp> [I]] @@ -359,8 +357,8 @@ See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. =item B<-P|--scripts> Specifies that postscripts and postbootscripts should be run on the nodes. -updatenode -P syncfiles is not supported. The syncfiles postscript can only -be run during install. You should use updatenode -F instead. +File sync with B is not supported. The B postscript can only +be run during install. You should use B instead. =item B<-S|--sw> @@ -417,11 +415,11 @@ To run postscripts,postbootscripts and file synchronization only on the node "cl updatenode clstrn01 -F -P =item 3. -Running updatenode -P with the syncfiles postscript is not supported. You should use updatenode -F instead. +Running B with the B postscript is not supported. You should use B instead. Do not run: - updatenode clstrno1 -P syncfiles + updatenode clstrn01 -P syncfiles Run: diff --git a/xCAT-client/pods/man1/xdcp.1.pod b/xCAT-client/pods/man1/xdcp.1.pod index a4f2fc9db..665823e79 100644 --- a/xCAT-client/pods/man1/xdcp.1.pod +++ b/xCAT-client/pods/man1/xdcp.1.pod @@ -1,6 +1,6 @@ =head1 B -B - Concurrently copies files to or from multiple nodes. In addition, provides an option to use rsync to update the files on the nodes, or to an installation image on the local node. +B - Concurrently copies files to or from multiple nodes. In addition, provides an option to use B to update the files on the managed nodes, or to an installation image on the local node. =head1 B @@ -11,7 +11,7 @@ B I [B<-F> I] B I [B<-s> B<-F> I] -B [B<-i> I] [B<-F> I] +B [B<-i> I] [B<-F> I] B [B<-h> | B<-V> | B<-q>] @@ -20,29 +20,28 @@ B [B<-h> | B<-V> | B<-q>] =head1 B The B command concurrently copies files to or from remote target -nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the target_path with the name of the -remote node or device appended to the copied source_file name. The -/usr/bin/rcp command is the model for syntax and security. -If using hierarchy, then xdcp runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, SNsyncfiledir attribute, or the default path /var/xcat/syncfiles on the service node, if the attribute is not defined. The -P flag will not automatically copy +nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the I with the name of the +remote node or device appended to the copied I name. The +B command is the model for syntax and security. +If using hierarchy, then B runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, B attribute, or the default path B on the service node, if the attribute is not defined. The B<-P> flag will not automatically copy the files from the compute node to the Management node, hierarchically. There is a two step process, see B<-P> flag. -If the Management Node is target node, it must be defined in the xCAT database with nodetype=mn. When the B command runs the Management Node as the target, it does not use remote commands but uses the local OS copy (B) command. +If the Management Node is target node, it must be defined in the xCAT database with B. When the B command runs with the Management Node as the target, it does not use remote commands but uses the local OS copy (B) command. B B: -A user_ID can be specified for the remote copy command. Remote user -specification is identical for the B and B commands. See the B -command for more information. +A user_ID can be specified for the remote copy command. Remote user +specification is identical for the B and B commands. +See the B command for more information. B B B: The B command uses a configurable remote copy command to execute remote copies on remote targets. Support is explicitly provided for -Remote Shell rcp command, the OpenSSH scp command and the -/usr/bin/rsync command. +Remote Shell B command, the OpenSSH B command and the +B command. -For node targets, the remote copy command is determined by the follow- -ing order of precedence: +For node targets, the remote copy command is determined by the following order of precedence: 1. The B<-r> flag. @@ -60,10 +59,10 @@ appropriate. A timeout value for remote copy command execution can be specified with the B<-t> flag or DSH_TIMEOUT environment variable. If any remote target -does not respond within the timeout value, the xdcp command displays an +does not respond within the timeout value, the B command displays an error message and exits. -The B<-T> flag provides diagnostic trace information for dcp command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. +The B<-T> flag provides diagnostic trace information for B command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. The B command can be executed silently using the B<-Q> flag; no target standard output or standard error is displayed. @@ -76,28 +75,27 @@ standard output or standard error is displayed. Specifies the complete path for the file to be copied to or from the target. Multiple files can be specified. When used -with the -R flag, only a single directory can be specified. -When used with the -P flag, only a single file can be specified. +with the B<-R> flag, only a single directory can be specified. +When used with the B<-P> flag, only a single file can be specified. =item I -If one source_file file, then it specifies the file to copy the source_file -file to on the target. If multiple source_file files, it specifies -the directory to copy the source_file files to on the target. -If the -P flag is specified, the target_path is the local host location +If one source file, then it specifies the file to copy the source +file to on the target. If multiple source files, it specifies +the directory to copy the source files to on the target. +If the B<-P> flag is specified, the I is the local host location for the copied files. The remote file directory structure is recreated -under target_path and the remote target name is appended -to the copied source_file name in the target_path directory. -Note: the targetpath directory must exist. +under I and the remote target name is appended +to the copied I name in the I directory. +Note: the I directory must exist. =item B<-B>|B<--bypass> -Runs in bypass mode, use if the xcatd daemon is hung. +Runs in bypass mode, use if the B daemon is not responding. =item B<-f>|B<--fanout> I -Specifies a fanout value for the maximum number of concur- -rently executing remote shell processes. Serial execution +Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of B<1>. If B<-f> is not specified, a default fanout value of B<64> is used. @@ -105,110 +103,9 @@ If B<-f> is not specified, a default fanout value of B<64> is used. Specifies the path to the file that will be used to build the B command. -The format of the input file is as follows, each line contains: +The format of the input file is described here: - ... -> < path to destination file/directory> - -or - - -> - -or - - -> - -For example: - - /etc/password /etc/hosts -> /etc - - /tmp/file2 -> /tmp/file2 - - /tmp/file2 -> /tmp/ - - /tmp/filex -> /tmp/source/filey - - /etc/* -> /etc/ - -B: - -After you define the files to rsync, you can add an B clause in the synclist file. The B clause will list all the postscripts that you would like to run after the files are sync'd to the node. -The postscript file must be of the form B, where the -is the is the from , reside in the same -directory as B, and be executable. -If the file B is rsync'd to the node, then the B -will automatically be run on the node. -If the file B is not updated on the node, the B will not be run. - -Putting the B in the file list to rsync to the node is required -for hierarchical clusters. It is optional for non-hierarchical clusters. - -Another option is the B clause in the synclist file. The B will list all the postscripts that you would like to run after the files are sync'd to the nodes. These scripts will run whether or not any files are sync'd to the nodes. The scripts have no special format, but must contain the fully qualified path. - -The scripts must be also added to the file list to rsync to the node for hierarchical clusters. It is optional for non-hierarchical clusters. - -For example, your rsynclist file may look like this: - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - -If /tmp/file2 and /tmp/file3 update /tmp/file2 and /tmp/filex on the node, then the postscripts /tmp/file2.post and /tmp/file3.post are automatically run on -the node. /tmp/myscript will always be run on the node. - - -Another option is the B clause in the synclist file. The B clause is used to append the contents of the input file to an existing file on the node. The file to append B already exist on the node and not be part of the synclist that contains the B clause. - -For example, your rsynclist file may look like this: - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /etc/myappenddir/appendfile -> /etc/mysetup/setup - /etc/myappenddir/appendfile2 -> /etc/mysetup/setup2 - -When you use the append script, the file (left) of the arrow is appended to the file right of the arrow. In this example, /etc/myappenddir/appendfile is appended to /etc/mysetup/setup file, which must already exist on the node. The /opt/xcat/share/xcat/scripts/xdcpappend.sh is used to accomplish this. - -Another option is the B clause in the synclist file. The B clause is used to append the contents of the input file to /etc/passwd, /etc/group, or /etc/shadow on a Linux node. It is only supported for those files and only on Linux. You must not use both the APPEND and MERGE funcion for these three files. The processing could end up not creating the file you desire. The MERGE function is the preferred method, because APPEND only adds to the file. MERGE will add to the file but also insure there are no duplicate entries. - -For example, your rsynclist file may look like this: - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /custom/mypasswd -> /etc/passwd - /custom/mygroups -> /etc/group - /custom/myshadow -> /etc/shadow - -Note: no order can be assumed by the order that the EXECUTE,EXECUTEALWAYS and APPEND clause fall in the synclist file. - -For more information on syncing files to node, read Sync-ing_Config_Files_to_Nodes - -On Linux rsync always uses ssh remoteshell. On AIX, ssh or rsh is used depending on the site.useSSHonAIX attribute. +On Linux B always uses ssh remoteshell. On AIX, B or B is used depending on the B table attribute. =item B<-h>|B<--help> @@ -218,15 +115,14 @@ Displays usage information. =item B<-i>|B<--rootimg> I -Specifies the path to the install image on the local Linux node. - +Specifies the path to the install image on the local Linux node. =item B<-o>|B<--node-options> I Specifies options to pass to the remote shell command for node targets. The options must be specified within double -quotation marks ("") to distinguish them from B options. +quotation marks ("") to distinguish them from B options. =item B<-p>|B<--preserve> @@ -236,14 +132,14 @@ the configured remote copy command. =item B<-P>|B<--pull> Pulls (copies) the files from the targets and places them in -the target_path directory on the local host. The target_path +the I directory on the local host. The I must be a directory. Files pulled from remote machines have -._target appended to the file name to distinguish between -them. When the B<-P> flag is used with the B<-R> flag, ._target is +B<._target> appended to the file name to distinguish between +them. When the B<-P> flag is used with the B<-R> flag, B<._target> is appended to the directory. Only one file per invocation of the -xdcp pull command can be pulled from the specified targets. -Hierarchy is not automatically support yet. You must first pull -the file to the Service Node and then pull the file to the Management +B pull command can be pulled from the specified targets. +In hierarchy, you must first pull +the file to the service node and then pull the file to the management node. =item B<-q>|B<--show-config> @@ -266,16 +162,15 @@ for remote command execution on node targets. Recursively copies files from a local directory to the remote targets, or when specified with the B<-P> flag, recursively pulls (copies) files from a remote directory to the local host. A -single source directory can be specified using the source_file -parameter. +single source directory can be specified using the I parameter. =item B<-s> I Will only sync the files listed in the synclist (B<-F>), to the service nodes for the input compute node list. The files will be placed in the -directory defined by the site.SNsyncfiledir attribute, or the default -/var/xcat/syncfiles directory. +directory defined by the B table attribute, or the default +B directory. =item B<-t>|B<--timeout> I @@ -361,9 +256,8 @@ 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. =back @@ -374,13 +268,12 @@ Exit values for each remote copy command execution are displayed in messages from the xdcp command, if the remote copy command exit value is non-zero. A non-zero return code from a remote copy command indicates that an error was encountered during the remote copy. If a remote copy -command encounters an error, execution of the remote copy on that tar- -get is bypassed. +command encounters an error, execution of the remote copy on that target is bypassed. -The xdcp command exit code is 0, if the xdcp command executed without +The B command exit code is 0, if the B command executed without errors and all remote copy commands finished with exit codes of 0. If -internal xdcp errors occur or the remote copy commands do not complete -successfully, the xdcp command exit value is greater than 0. +internal B errors occur or the remote copy commands do not complete +successfully, the B command exit value is greater than 0. @@ -424,7 +317,7 @@ host as /var/log._target, enter: xdcp NodeGroup1 -f 12 -RP /var/log/testlogdir /var/log =item 3. -To copy /localnode/smallfile and /tmp/bigfile to /tmp on node1 +To copy /localnode/smallfile and /tmp/bigfile to B/tmp on node1 using rsync and input -t flag to rsync, enter: xdcp node1 -r /usr/bin/rsync -o "-t" /localnode/smallfile /tmp/bigfile /tmp @@ -456,72 +349,67 @@ To copy the /etc/hosts file from node1 and node2 to the =item 8. To rsync the /etc/hosts file to your compute nodes: -Create a rsync file /tmp/myrsync, with this line: +First create a syncfile /tmp/myrsync, with this line: -/etc/hosts -> /etc/hosts + /etc/hosts -> /etc/hosts or -/etc/hosts -> /etc/ (last / is required) + /etc/hosts -> /etc/ (last / is required) -Run: +Then run: xdcp compute -F /tmp/myrsync =item 9. To rsync all the files in /home/mikev to the compute nodes: -Create a rsync file /tmp/myrsync, with this line: +First create a rsync file /tmp/myrsync, with this line: -/home/mikev/* -> /home/mikev/ (last / is required) + /home/mikev/* -> /home/mikev/ (last / is required) -Run: +Then run: xdcp compute -F /tmp/myrsync =item 10. -To rsync to the compute nodes, using service nodes, the command will first -rsync the files to the /var/xcat/syncfiles directory on the service nodes and then rsync the files from that directory to the compute nodes. The /var/xcat/syncfiles default directory on the service nodes, can be changed by putting a directory value in the site table SNsyncfiledir attribute. +To rsync to the compute nodes, using service nodes: +First create a rsync file /tmp/myrsync, with this line: -Create a rsync file /tmp/myrsync, with this line: - -/etc/hosts /etc/passwd -> /etc + /etc/hosts /etc/passwd -> /etc or -/etc/hosts /etc/passwd -> /etc/ + /etc/hosts /etc/passwd -> /etc/ -Run: +Then run: xdcp compute -F /tmp/myrsync -to update the Compute Nodes - =item 11. To rsync to the service nodes in preparation for rsyncing the compute nodes during an install from the service node. -Create a rsync file /tmp/myrsync, with this line: +First create a rsync file /tmp/myrsync, with this line: -/etc/hosts /etc/passwd -> /etc + /etc/hosts /etc/passwd -> /etc -Run: +Then run: xdcp compute -s -F /tmp/myrsync -to sync the service node for compute =item 12. To rsync the /etc/file1 and file2 to your compute nodes and rename to filex and filey: -Create a rsync file /tmp/myrsync, with these line: +First create a rsync file /tmp/myrsync, with these line: -/etc/file1 -> /etc/filex + /etc/file1 -> /etc/filex -/etc/file2 -> /etc/filey + /etc/file2 -> /etc/filey -Run: +Then run: xdcp compute -F /tmp/myrsync @@ -530,11 +418,11 @@ to update the Compute Nodes =item 13. To rsync files in the Linux image at /install/netboot/fedora9/x86_64/compute/rootimg on the MN: -Create a rsync file /tmp/myrsync, with this line: +First create a rsync file /tmp/myrsync, with this line: -/etc/hosts /etc/passwd -> /etc + /etc/hosts /etc/passwd -> /etc -Run: +Then run: xdcp -i /install/netboot/fedora9/x86_64/compute/rootimg -F /tmp/myrsync From 56c21edd380cf55b988b9e82f2f512c0bcab0610 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Fri, 22 Feb 2019 17:41:31 +0800 Subject: [PATCH 75/77] fix diskless issue (#6029) --- xCAT/postscripts/configeth | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 9133ea09a..a71b7b293 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -628,7 +628,7 @@ elif [ "$1" = "-s" ];then if [ "$con_name" == "--" ] ; then nmcli con add type ethernet con-name ${str_inst_nic} ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} else - nmcli con mod "System ens3" ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} + nmcli con mod "System ${str_inst_nic}" ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} fi else echo "DEVICE=${str_inst_nic}" > $str_conf_file @@ -674,7 +674,7 @@ elif [ "$1" = "-s" ];then fi fi - if [ "$UPDATENODE" = "1" ] || grep "REBOOT=TRUE" /opt/xcat/xcatinfo >/dev/null 2>&1; then + if [ "$UPDATENODE" = "1" ] || [ "$NODESETSTATE" = "netboot" ] || [ "$NODESETSTATE" = "statelite" ] || grep "REBOOT=TRUE" /opt/xcat/xcatinfo >/dev/null 2>&1; then if [ "$str_os_type" = "debian" ];then ifdown --force $str_inst_nic else From 3576d780fccb9b164404cdd685d6cf15e1090d97 Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Mon, 25 Feb 2019 18:08:08 -0800 Subject: [PATCH 76/77] doc: use pkill instead of ps | grep | awk | xargs (#6034) pkill is provided by the same procps package as ps, so should be present wherever ps is. --- docs/source/guides/admin-guides/references/man5/site.5.rst | 2 +- perl-xCAT/xCAT/Schema.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index d03af4847..33f4ac5e3 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -406,7 +406,7 @@ site Attributes: dbtracelevel: The trace level for the database access log. To activate this setting, please. restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: . - ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print $2}' | xargs kill -HUP + pkill -f -HUP 'xcatd: DB Access' Currrent support values: 0: disable the trace log for db 1: trace the calls of database subroutines diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index e792677b8..6bd2dad63 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1266,7 +1266,7 @@ passed as argument rather than by table value', " delimiter, to specify delimiter for those columns as format of 'column:delimiter'.\n\n" . " dbtracelevel: The trace level for the database access log. To activate this setting, please. \n". " restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: .\n". -" ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print \$2}' | xargs kill -HUP \n". +" pkill -f -HUP 'xcatd: DB Access' \n". " Currrent support values: \n" . " 0: disable the trace log for db \n" . " 1: trace the calls of database subroutines \n" . From 8a0abf9565320606c579e3239f9f023fc2908c92 Mon Sep 17 00:00:00 2001 From: cxhong Date: Tue, 26 Feb 2019 00:04:51 -0500 Subject: [PATCH 77/77] modify enablesnmp postscript to show 'net' command (#6030) --- xCAT/postscripts/enablesnmp | 40 +++++++++---------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/xCAT/postscripts/enablesnmp b/xCAT/postscripts/enablesnmp index c4b51df49..127876272 100755 --- a/xCAT/postscripts/enablesnmp +++ b/xCAT/postscripts/enablesnmp @@ -18,10 +18,7 @@ fi #get snmp attribute #NOTE: the length of SNMP Password has to be min=8 -xCATSettingsSTART="xCAT settings START" -xCATSettingsEND="xCAT settings END" -xCATSettingsOID="xCAT customized" -xCATSettingsInfo="Entries between the START and END lines will be replaced each time by running enablesnmp" +xCATSettingsOID="xCAT setting" snmpversion=$SNMPVERSION snmpuser=$SNMPUSER snmppwd=$SNMPPASSWD @@ -36,21 +33,8 @@ if [ $? -eq 0 ]; then cp ${snmp_conf}.cumulus $snmp_conf fi -grep "$xCATSettingsSTART" $snmp_conf 2>&1 1> /dev/null -if [ $? -eq 0 ]; then - #remove the previous snmp rule generated by xCAT - sed -i "/$xCATSettingsSTART/,/$xCATSettingsEND/ d" $snmp_conf -else - sed -i "/^\s*agentAddress/s/^/#/" $snmp_conf - sed -i '/agentAddress udp\:161\,udp6\:\[\:\:1\]\:161/s/^#//' $snmp_conf - sed -i "/view\s*systemonly\s*included\s*.1.3.6.1.2.1.17/s/^#//" $snmp_conf - sed -i "/pass_persist\s*.1.3.6.1.2.1.17\s*\/usr\/share\/snmp\/bridge_pp.py/s/^#//" $snmp_conf -fi - - -# Mark the start of xCAT section -echo "# $xCATSettingsSTART" >> $snmp_conf -echo "# $xCATSettingsInfo" >> $snmp_conf +# config snmpd to all the listening address +net add snmp-server listening-address all if [[ "$snmpversion" =~ "3" ]]; then #set up snmp version 3 @@ -58,21 +42,17 @@ if [[ "$snmpversion" =~ "3" ]]; then len=${#snmppwd} if [ $len -lt 8 ]; then echo "SNMP v3 specification requires password to have a minimum of 8 characters" - echo "# $xCATSettingsEND" >> $snmp_conf exit -1 fi - snmpauth=`echo $snmpauth | tr '[a-z]' '[A-Z]'` + snmpauth=`echo $snmpauth | awk '{print tolower($0)}'` if [ -n "$snmppriv" ]; then - snmppriv=`echo $snmppriv | tr '[a-z]' '[A-Z]'` - echo "createUser $snmpuser $snmpauth $snmppwd $snmppriv $snmppwd" >> $snmp_conf - echo "rwuser $snmpuser" >> $snmp_conf + snmppriv=`echo $snmppriv | awk '{print tolower($0)}'` + net add snmp-server username $snmpuser auth-$snmpauth $snmppwd encrypt-$snmppriv $snmppwd else - echo "createUser $snmpuser $snmpauth $snmppwd" >> $snmp_conf - echo "rouser $snmpuser" >> $snmp_conf + net add snmp-server username $snmpuser auth-$snmpauth $snmppwd fi else echo "Please define user/password/auth for SNMP v3 specification" - echo "# $xCATSettingsEND" >> $snmp_conf exit -1 fi elif [ -n "$snmppwd" ]; then @@ -81,10 +61,8 @@ elif [ -n "$snmpc" ]; then community=$snmpc fi -echo "rocommunity $community default" >> $snmp_conf -echo "rocommunity $community default -V systemonly" >> $snmp_conf - -echo "# $xCATSettingsEND" >> $snmp_conf +net add snmp-server readonly-community $community access any +net commit #create snmpd restart conf file mkdir -p /etc/systemd/system/snmpd.service.d