From 1c4793ab776b3fa7cc06f98297c253310f7b32cd Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 13 Feb 2018 02:55:14 -0500 Subject: [PATCH 001/161] Add test cases for configration management first version --- .../testcase/xcat-inventory/cases.common | 146 ++ .../testcase/xcat-inventory/cases.node | 1787 +++++++++++++++++ .../testcase/xcat-inventory/cases.osimage | 926 +++++++++ .../testcase/xcat-inventory/cases.site | 1364 +++++++++++++ 4 files changed, 4223 insertions(+) create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.common create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.node create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.osimage create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.site diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.common b/xCAT-test/autotest/testcase/xcat-inventory/cases.common new file mode 100644 index 000000000..875682e20 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.common @@ -0,0 +1,146 @@ +start:xcat_inventory_option_h +description:This case is used to test xcat-inventory usage information +cmd:xcat-inventory -h +check:ouptut=~usage: xcat-inventory +check:ouptut!~usage: xcat-inventory export +check:ouptut!~usage: xcat-inventory import +check:rc==0 +cmd:xcat-inventory help +check:ouptut=~usage: xcat-inventory +check:ouptut!~usage: xcat-inventory export +check:ouptut!~usage: xcat-inventory import +check:rc==0 +cmd:xcat-inventory help export +check:ouptut=~usage: xcat-inventory export +check:rc==0 +cmd:xcat-inventory help import +check:output=~usage: xcat-inventory import +check:rc==0 +cmd:xcat-inventory help help +check:output=~usage: xcat-inventory help +check:rc==0 +end + + +start:xcat_inventory_option_V +description:This case is used to test xcat-inventory option V which used to get version information +cmd:xcat-inventory -V +check:ouptut=~\d\.\d +check:rc==0 +end + +start:xcat_inventory_invalid_subcmd +description:This case is used to test xcat-inventory export subcommand to handle invalid subcommand. The vaild subcommand are export and import. +cmd:xcat-inventory aaa +check:output=~ xcat-inventory: error: argument : invalid choice: +check:output=~ usage: +check:rc!=0 +end + +start:xcat_inventory_export_option_t_invalid_type +description:This case is used to test xcat-inventory export subcommand to handle invalid type for option t +cmd:xcat-inventory export -t aaa +check:output=~Invalid object type +check:output!~Traceback (most recent call last): +check:rc!=0 +end + +start:xcat_inventory_export_option_format_invalid_type +description:This case is used to test xcat-inventory export subcommand to handle invalid type for option format +cmd:xcat-inventory export --format aaa +check:output=~Invalid exporting format: aaa +check:output!~Traceback (most recent call last): +check:rc!=0 +end + +#start:xcat_inventory_export_option_f_invalid_file +#description:This case is used to test xcat-inventory export subcommand to handle invalid file for option f +#cmd:xcat-inventory export -f aaa +#check:output=~The specified path does not exist +#check:output !~Traceback +#check:rc!=0 +#end + +start:xcat_inventory_import_option_f_invalid_file +description:This case is used to test xcat-inventory import subcommand to handle invalid file for option f +cmd:mkdir -p /tmp/xcat_inventory_import_option_f_invalid_file +check:rc==0 +#to handle a non-existed file +cmd:xcat-inventory import -f aaa +check:output=~The specified path does not exist +check:output !~Traceback +check:rc!=0 +#To handle a invalid json file +cmd:#!/usr/bin/bash +echo "{ + "node": { + "bogusnode": { + "device_type": "server", + "obj_info": { + "groups": "test" + }, + "obj_type": "node", + "role": "compute" + } + } +" > /tmp/xcat_inventory_import_option_f_invalid_file/invaild_json +check:rc==0 +cmd:cat /tmp/xcat_inventory_import_option_f_invalid_file/invaild_json +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_import_option_f_invalid_file/invaild_json +check:output =~ Error: failed to load file +check:output !~Traceback +check:rc!=0 +#To handle a invalid yaml file +cmd:#!/usr/bin/bash +echo "node: + device_type: server + obj_info: + groups: test + obj_type: node + role: compute +" > /tmp/xcat_inventory_import_option_f_invalid_file/invaild_yaml +check:rc==0 +cmd:cat /tmp/xcat_inventory_import_option_f_invalid_file/invaild_yaml +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_import_option_f_invalid_file/invaild_yaml +check:output =~ Error: failed to load file +check:output !~Traceback +check:rc!=0 +cmd:rm -rf /tmp/xcat_inventory_import_option_f_invalid_file +check:rc==0 +end + + +start:xcat_inventory_import_option_t_invalid_type +description:This case is used to test xcat-inventory import subcommand to handle invalid type for option t +cmd:xcat-inventory import -t aaa +check:output=~Invalid object type +check:output!~Traceback (most recent call last): +check:rc!=0 +end + + +start:xcat_inventory_import_miss_option +description:This case is used to test xcat-inventory import subcommand to handle missing -t or -o option +cmd:mkdir -p /tmp/export_import_nodes_delimited_with_comma_by_json +check:rc==0 +cmd:#!/usr/bin/bash +echo "{ + "node": { + "test": { + "device_type": "server", + "obj_info": { + "groups": "testgroup" + }, + "obj_type": "node", + "role": "compute" + } + } +}" > /tmp/export_import_nodes_delimited_with_comma_by_json/aaa +cmd:xcat-inventory import -f /tmp/export_import_nodes_delimited_with_comma_by_json/aaa -o aaa +check:output=~Missing object type for object +check:rc!=0 +cmd:rm -rf /tmp/export_import_nodes_delimited_with_comma_by_json +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.node b/xCAT-test/autotest/testcase/xcat-inventory/cases.node new file mode 100644 index 000000000..92d8d8177 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.node @@ -0,0 +1,1787 @@ +start:export_import_single_ppc_by_json +description:This case is used to test xcat-inventory export and import one ppc definition by json between 2 exact same MNs. This case can cover hmc,lpar. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_ppc_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_ppc_by_json_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_ppc_by_json/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_ppc_by_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_ppc_by_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_ppc_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=hmc nodetype=ppc,osi addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou parent=parent password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power pprofile=pprofile prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_ppc_by_json/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_import_single_ppc_by_json/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_import_single_ppc_by_json/bogusnode_json.inv $$DSTMN:/tmp/export_import_single_ppc_by_json_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_ppc_by_json_$$DSTMN/bogusnode_json.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_ppc_by_json_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_ppc_by_json_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_ppc_by_json/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_ppc_by_json/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_ppc_by_json/srcbogusnode.stanza /tmp/export_import_single_ppc_by_json/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_ppc_by_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_ppc_by_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_ppc_by_json/bogusgroup.stanza ]]; then cat /tmp/export_import_single_ppc_by_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_ppc_by_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_ppc_by_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_ppc_by_json_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_ppc_by_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_ppc_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_ppc_by_json +check:rc==0 +end + + +start:export_import_single_ppc_by_yaml +description:This case is used to test xcat-inventory export and import one ppc definition by yaml between 2 exact same MNs. This case can cover hmc,lpar. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_ppc_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_ppc_by_yaml_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_ppc_by_yaml/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_ppc_by_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=hmc nodetype=ppc,osi addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou parent=parent password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power pprofile=pprofile prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_ppc_by_yaml/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_import_single_ppc_by_yaml/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_single_ppc_by_yaml/bogusnode_yaml.inv $$DSTMN:/tmp/export_import_single_ppc_by_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_ppc_by_yaml_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_ppc_by_yaml_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_ppc_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_ppc_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_ppc_by_yaml/srcbogusnode.stanza /tmp/export_import_single_ppc_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_ppc_by_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_single_ppc_by_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_ppc_by_yaml/bogusgroup.stanza ]]; then cat /tmp/export_import_single_ppc_by_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_ppc_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_ppc_by_yaml +check:rc==0 +end + + +start:export_import_single_kvm_by_json +description:This case is used to test xcat-inventory export and import one kvm definition by json between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_kvm_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_kvm_by_json_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_kvm_by_json/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_kvm_by_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_kvm_by_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_kvm_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=kvm addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmcpus=vmcpus vmhost=vmhost vmmanager=vmmanager vmmaster=vmmaster vmmemory=vmmemory vmnicnicmodel=vmnicnicmodel vmnics=vmnics vmothersetting=vmothersetting vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_kvm_by_json/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_import_single_kvm_by_json/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_import_single_kvm_by_json/bogusnode_json.inv $$DSTMN:/tmp/export_import_single_kvm_by_json_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_kvm_by_json_$$DSTMN/bogusnode_json.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_kvm_by_json_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_kvm_by_json_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_kvm_by_json/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_kvm_by_json/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_kvm_by_json/srcbogusnode.stanza /tmp/export_import_single_kvm_by_json/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_kvm_by_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_kvm_by_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_kvm_by_json/bogusgroup.stanza ]]; then cat /tmp/export_import_single_kvm_by_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_kvm_by_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_kvm_by_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_kvm_by_json_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_kvm_by_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_kvm_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_kvm_by_json +check:rc==0 +end + + + +start:export_import_single_kvm_by_yaml +description:This case is used to test xcat-inventory export and import one kvm definition by yaml between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_kvm_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_kvm_by_yaml_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_kvm_by_yaml/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_kvm_by_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=kvm addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmcpus=vmcpus vmhost=vmhost vmmanager=vmmanager vmmaster=vmmaster vmmemory=vmmemory vmnicnicmodel=vmnicnicmodel vmnics=vmnics vmothersetting=vmothersetting vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_kvm_by_yaml/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_import_single_kvm_by_yaml/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_single_kvm_by_yaml/bogusnode_yaml.inv $$DSTMN:/tmp/export_import_single_kvm_by_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_kvm_by_yaml_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_kvm_by_yaml_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_kvm_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_kvm_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_kvm_by_yaml/srcbogusnode.stanza /tmp/export_import_single_kvm_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_kvm_by_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_single_kvm_by_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_kvm_by_yaml/bogusgroup.stanza ]]; then cat /tmp/export_import_single_kvm_by_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_kvm_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_kvm_by_yaml +check:rc==0 +end + + + +start:export_import_single_pdu_by_json +description:This case is used to test xcat-inventory export and import one pdu definition by json between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_pdu_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_pdu_by_json_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_pdu_by_json/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_pdu_by_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=arch authdomain=authdomain authkey=authkey authtype=authtype cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=privtype productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=seclevel serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_json/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_import_single_pdu_by_json/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_import_single_pdu_by_json/bogusnode_json.inv $$DSTMN:/tmp/export_import_single_pdu_by_json_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusnode_json.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_pdu_by_json_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_pdu_by_json_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_pdu_by_json/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_pdu_by_json/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_pdu_by_json/srcbogusnode.stanza /tmp/export_import_single_pdu_by_json/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_pdu_by_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_pdu_by_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_pdu_by_json/bogusgroup.stanza ]]; then cat /tmp/export_import_single_pdu_by_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_pdu_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_pdu_by_json +check:rc==0 +end + + +start:export_import_single_pdu_by_yaml +description:This case is used to test xcat-inventory export and import one pdu definition by yaml between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_pdu_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_pdu_by_yaml_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_pdu_by_yaml/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=arch authdomain=authdomain authkey=authkey authtype=authtype cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=privtype productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=seclevel serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_yaml/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_import_single_pdu_by_yaml/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_single_pdu_by_yaml/bogusnode_yaml.inv $$DSTMN:/tmp/export_import_single_pdu_by_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_pdu_by_yaml_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_pdu_by_yaml_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_pdu_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_pdu_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_pdu_by_yaml/srcbogusnode.stanza /tmp/export_import_single_pdu_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_pdu_by_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_single_pdu_by_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_pdu_by_yaml/bogusgroup.stanza ]]; then cat /tmp/export_import_single_pdu_by_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_pdu_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_pdu_by_yaml +check:rc==0 +end + + +start:export_import_single_boston_by_yaml +description:This case is used to test xcat-inventory export and import one boston node definition by yaml between 2 exact same MNs. This case can also cover p8 physical node, x86 physical node. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_boston_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_boston_by_yaml_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_boston_by_yaml/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_boston_by_yaml/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_import_single_boston_by_yaml/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_single_boston_by_yaml/bogusnode_yaml.inv $$DSTMN:/tmp/export_import_single_boston_by_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_boston_by_yaml_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_boston_by_yaml_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_boston_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_boston_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_boston_by_yaml/srcbogusnode.stanza /tmp/export_import_single_boston_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_boston_by_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_single_boston_by_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_boston_by_yaml/bogusgroup.stanza ]]; then cat /tmp/export_import_single_boston_by_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_boston_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_boston_by_yaml +check:rc==0 +end + +start:export_import_single_boston_by_json +description:This case is used to test xcat-inventory export and import one boston node definition by json between 2 exact same MNs. This case can also cover p8 physical node, x86 physical node. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_boston_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_boston_by_json_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_boston_by_json/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_boston_by_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_boston_by_json/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_import_single_boston_by_json/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_import_single_boston_by_json/bogusnode_json.inv $$DSTMN:/tmp/export_import_single_boston_by_json_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_boston_by_json_$$DSTMN/bogusnode_json.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_boston_by_json_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_boston_by_json_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_boston_by_json/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_boston_by_json/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_boston_by_json/srcbogusnode.stanza /tmp/export_import_single_boston_by_json/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_boston_by_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_boston_by_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_boston_by_json/bogusgroup.stanza ]]; then cat /tmp/export_import_single_boston_by_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_boston_by_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_boston_by_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_boston_by_json_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_boston_by_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_boston_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_boston_by_json +check:rc==0 +end + +start:export_import_single_witherspoon_by_yaml +description:This case is used to test xcat-inventory export and import one witherspoon node definition by yaml between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_witherspoon_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_witherspoon_by_yaml/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_witherspoon_by_yaml/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_import_single_witherspoon_by_yaml/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_single_witherspoon_by_yaml/bogusnode_yaml.inv $$DSTMN:/tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_witherspoon_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_witherspoon_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_witherspoon_by_yaml/srcbogusnode.stanza /tmp/export_import_single_witherspoon_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_witherspoon_by_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_witherspoon_by_yaml/bogusgroup.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_witherspoon_by_yaml +check:rc==0 +end + +start:export_import_single_witherspoon_by_json +description:This case is used to test xcat-inventory export and import one witherspoon node definition by json between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_witherspoon_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_witherspoon_by_json_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_witherspoon_by_json/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_witherspoon_by_json/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_import_single_witherspoon_by_json/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_import_single_witherspoon_by_json/bogusnode_json.inv $$DSTMN:/tmp/export_import_single_witherspoon_by_json_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusnode_json.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_witherspoon_by_json_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_witherspoon_by_json_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_witherspoon_by_json/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_witherspoon_by_json/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_witherspoon_by_json/srcbogusnode.stanza /tmp/export_import_single_witherspoon_by_json/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_witherspoon_by_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_witherspoon_by_json/bogusgroup.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_witherspoon_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_witherspoon_by_json +check:rc==0 +end + + +start:export_import_single_switch_by_json +description:This case is used to test xcat-inventory export and import one switch node definition by json between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_switch_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_switch_by_json_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_switch_by_json/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_switch_by_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=protocol provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpauth=snmpauth snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_json/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_import_single_switch_by_json/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_import_single_switch_by_json/bogusnode_json.inv $$DSTMN:/tmp/export_import_single_switch_by_json_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_switch_by_json_$$DSTMN/bogusnode_json.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_switch_by_json_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_switch_by_json_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_switch_by_json/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_switch_by_json/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_switch_by_json/srcbogusnode.stanza /tmp/export_import_single_switch_by_json/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_switch_by_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_switch_by_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_switch_by_json/bogusgroup.stanza ]]; then cat /tmp/export_import_single_switch_by_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_switch_by_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_switch_by_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_switch_by_json_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_switch_by_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_switch_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_switch_by_json +check:rc==0 +end + +start:export_import_single_switch_by_yaml +description:This case is used to test xcat-inventory export and import one switch node definition by yaml between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_switch_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_switch_by_yaml_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_switch_by_yaml/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=protocol provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpauth=snmpauth snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +check:rc==0 +cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_yaml/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_import_single_switch_by_yaml/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_single_switch_by_yaml/bogusnode_yaml.inv $$DSTMN:/tmp/export_import_single_switch_by_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_import_single_switch_by_yaml_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_switch_by_yaml_$$DSTMN/dstbogusnode.stanza /tmp/export_import_single_switch_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_switch_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_switch_by_yaml/srcbogusnode.stanza /tmp/export_import_single_switch_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_switch_by_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_single_switch_by_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_switch_by_yaml/bogusgroup.stanza ]]; then cat /tmp/export_import_single_switch_by_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_switch_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_switch_by_yaml +check:rc==0 +end + + +start:export_import_nodes_delimited_with_comma_by_yaml +description:This case is used to test xcat-inventory export and import the definition of nodes delimited with comma by yaml between 2 exact same MNs.Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_nodes_delimited_with_comma_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/' +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusnode.stanza ;rmdef bogusnode$i;fi; done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode$i;fi; done' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef bogusnode[1-3] groups=bogusgroup mgt=openbmc cons=openbmc netboot=petitboot +check:rc==0 +cmd:lsdef bogusnode[1-3] -z|sort -t'=' -k1 |tee /tmp/export_import_nodes_delimited_with_comma_by_yaml/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode1,bogusnode2,bogusnode3 |tee /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusnode_yaml.inv $$DSTMN:/tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode1,bogusnode2,bogusnode3' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode[1-3] -z|sort -t'=' -k1 |tee /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/dstbogusnode.stanza /tmp/export_import_nodes_delimited_with_comma_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_nodes_delimited_with_comma_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_nodes_delimited_with_comma_by_yaml/srcbogusnode.stanza /tmp/export_import_nodes_delimited_with_comma_by_yaml/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode[1-3]' +check:rc==0 +cmd:if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusgroup.stanza ]];then cat /tmp/export_import_nodes_delimited_with_comma_by_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/bogusgroup.stanza ]];then cat /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_nodes_delimited_with_comma_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_nodes_delimited_with_comma_by_yaml +check:rc==0 +end + +start:export_import_nodes_delimited_with_comma_by_json +description:This case is used to test xcat-inventory export and import the definition of nodes delimited with comma by json between 2 exact same MNs.Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_nodes_delimited_with_comma_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/' +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_nodes_delimited_with_comma_by_json/bogusnode.stanza ;rmdef bogusnode$i;fi; done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_nodes_delimited_with_comma_by_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode$i;fi; done' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef bogusnode[1-3] groups=bogusgroup mgt=openbmc cons=openbmc netboot=petitboot +check:rc==0 +cmd:lsdef bogusnode[1-3] -z|sort -t'=' -k1 |tee /tmp/export_import_nodes_delimited_with_comma_by_json/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode1,bogusnode2,bogusnode3 |tee /tmp/export_import_nodes_delimited_with_comma_by_json/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_import_nodes_delimited_with_comma_by_json/bogusnode_json.inv $$DSTMN:/tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/bogusnode_json.inv -t node -o bogusnode1,bogusnode2,bogusnode3' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode[1-3] -z|sort -t'=' -k1 |tee /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/dstbogusnode.stanza /tmp/export_import_nodes_delimited_with_comma_by_json/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_import_nodes_delimited_with_comma_by_json/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_nodes_delimited_with_comma_by_json/srcbogusnode.stanza /tmp/export_import_nodes_delimited_with_comma_by_json/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode[1-3]' +check:rc==0 +cmd:if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_json/bogusnode.stanza ]]; then cat /tmp/export_import_nodes_delimited_with_comma_by_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_json/bogusgroup.stanza ]];then cat /tmp/export_import_nodes_delimited_with_comma_by_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/bogusgroup.stanza ]];then cat /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_nodes_delimited_with_comma_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_nodes_delimited_with_comma_by_json +check:rc==0 +end + + +start:xcat_inventory_try_to_export_nonexisted_node +description:This case is used to test xcat-inventory export a nonexisted node +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_nonexisted_node +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/xcat_inventory_try_to_export_nonexisted_node/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd: xcat-inventory export --format=json -t node -o bogusnode +check:output=~Error: cannot find objects: bogusnode! +check:rc!=0 +cmd: xcat-inventory export --format=yaml -t node -o bogusnode +check:output=~Error: cannot find objects: bogusnode! +check:rc!=0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_nonexisted_node/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_nonexisted_node/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_nonexisted_node +check:rc==0 +end + +start:xcat_inventory_try_to_import_nonexisted_node +description:This case is used to test xcat-inventory import a nonexisted node +cmd:mkdir -p /tmp/xcat_inventory_try_to_import_nonexisted_node +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/xcat_inventory_try_to_import_nonexisted_node/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=test +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/xcat_inventory_try_to_import_nonexisted_node/json +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_nonexisted_node/json -t node -o bogusnode1 +check:output=~Error: cannot find objects: bogusnode1! +check:rc!=0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/xcat_inventory_try_to_import_nonexisted_node/yaml +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_nonexisted_node/yaml -t node -o bogusnode1 +check:output=~Error: cannot find objects: bogusnode1! +check:rc!=0 +cmd:rmdef bogusnode +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_nonexisted_node/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_nonexisted_node/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_import_nonexisted_node +check:rc==0 +end + +start:xcat_inventory_try_to_export_all_type_is_node_default_format +description:This case is used to test xcat-inventory export all definition which type is node by default format. I.e, do not specify the format of export. +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:mkdef -t group bogusgroup +check:rc==0 +cmd:mkdef bogusnode[1-3] groups=bogusgroup +check:rc==0 +cmd:lsdef -t node|tee /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db +check:rc==0 +cmd:lsdef -t group -i grouptype -c|grep "grouptype=static" |tee /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db +check:rc==0 +#To test if "xcat-inventory export -t node" works correctly +cmd:xcat-inventory export -t node |tee /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node +check:rc==0 +cmd: grep " \"xcatdefaults\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd: grep " \"service\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db|wc -l);dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db |wc -l);((da=$dn+$dg+2));ia=$(grep " \"obj_type\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node|wc -l); if [[ $da -eq $ia ]];then exit 0; else exit 1;fi +check:rc==0 +cmd:a=0;for i in `awk -F':' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db`; do grep -E " \"$i\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db|wc -l);if [[ $a -eq $dg ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db`;do grep -E " \"$i\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db |wc -l); if [[ $dn -eq $a ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd:rmdef -t group bogusgroup +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/bogusgroup.stanza ]];then cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format +check:rc==0 +end + + +start:xcat_inventory_try_to_export_all_type_is_node_yaml_format +description:This case is used to test xcat-inventory export all definition which type is node by yaml format. +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:mkdef -t group bogusgroup +check:rc==0 +cmd:mkdef bogusnode[1-3] groups=bogusgroup +check:rc==0 +cmd:lsdef -t node|tee /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/node_in_xcat_db +check:rc==0 +cmd: lsdef -t group -i grouptype -c|grep "grouptype=static"| tee /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/group_in_xcat_db +check:rc==0 +#To test if "xcat-inventory export --format=yaml -t node |tee /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/export_all_node +cmd:xcat-inventory export --format=yaml -t node |tee /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/export_all_node +check:rc==0 +cmd: grep " xcatdefaults:" /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd: grep " service:" /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/node_in_xcat_db|wc -l);dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/group_in_xcat_db |wc -l);((da=$dn+$dg+2));ia=$(grep " obj_type: " /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/export_all_node|wc -l); if [[ $da -eq $ia ]];then exit 0; else exit 1;fi +check:rc==0 +cmd:a=0;for i in `awk -F':' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/group_in_xcat_db`; do grep -E " $i:" /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/group_in_xcat_db|wc -l);if [[ $a -eq $dg ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/node_in_xcat_db`;do grep -E " $i:" /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/node_in_xcat_db |wc -l); if [[ $dn -eq $a ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd:rmdef -t group bogusgroup +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/bogusgroup.stanza ]];then cat /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_node_yaml_format +check:rc==0 +end + + +start:xcat_inventory_try_to_export_all_type_is_node_json_format +description:This case is used to test xcat-inventory export all definition which type is node by json format. +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:mkdef -t group bogusgroup +check:rc==0 +cmd:mkdef bogusnode[1-3] groups=bogusgroup +check:rc==0 +cmd:lsdef -t node|tee /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/node_in_xcat_db +check:rc==0 +cmd:lsdef -t group -i grouptype -c|grep "grouptype=static" |tee /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/group_in_xcat_db +check:rc==0 +cmd:xcat-inventory export --format=json -t node |tee /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node +check:rc==0 +cmd: grep " \"xcatdefaults\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd: grep " \"service\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/node_in_xcat_db|wc -l);dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/group_in_xcat_db |wc -l);((da=$dn+$dg+2));ia=$(grep " \"obj_type\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node|wc -l); if [[ $da -eq $ia ]];then exit 0; else exit 1;fi +check:rc==0 +cmd:a=0;for i in `awk -F':' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/group_in_xcat_db`; do grep " \"$i\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/group_in_xcat_db|wc -l);if [[ $a -eq $dg ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/node_in_xcat_db`;do grep -E " \"$i\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/node_in_xcat_db |wc -l); if [[ $dn -eq $a ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd:rmdef -t group bogusgroup +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/bogusgroup.stanza ]];then cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format +check:rc==0 +end + +start:xcat_inventory_try_to_import_all_type_is_node_yaml_format +description:This case is used to test xcat-inventory import all definition which type is node from a yaml file. +cmd:mkdir -p /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:#!/usr/bin/bash +echo "network: + 10_0_0_0-255_0_0_0: + basic_attr: + gateway: 10.0.0.103 + mask: 255.0.0.0 + mgtifname: eth0 + mtu: '1500' + net: 10.0.0.0 + service: + tftpserver: +node: + bogusgroup: + device_type: server + engines: + console_engine: + engine_type: openbmc + hardware_mgt_engine: + engine_info: + openbmc_info: + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot + network_info: + primarynic: + ip: '|\D+(\d+)|10.100.100.(\$1)|' + obj_info: + grouptype: static + obj_type: group + role: compute + bogusnode1: + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute + bogusnode2: + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute + bogusnode3: + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute + service: + device_type: server + engines: + netboot_engine: + engine_info: + postscripts: servicenode + obj_type: group + role: compute + xcatdefaults: + device_type: server + engines: + netboot_engine: + engine_info: + postbootscripts: otherpkgs + postscripts: syslog,remoteshell,syncfiles + obj_type: group + role: compute +osimage: + rhels7.4-ppc64le-install-compute: + basic_attributes: + arch: ppc64le + distribution: rhels7.4 + osdistro: rhels7.4-ppc64le + osname: Linux + imagetype: linux + package_selection: + otherpkgdir: /install/post/otherpkgs/rhels7.4/ppc64le + pkgdir: /install/rhels7.4/ppc64le + pkglist: /opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist + provision_mode: install + role: compute + template: /opt/xcat/share/xcat/install/rh/compute.rhels7.tmpl + rhels7.4-ppc64le-install-service: + basic_attributes: + arch: ppc64le + distribution: rhels7.4 + osdistro: rhels7.4-ppc64le + osname: Linux + imagetype: linux + package_selection: + otherpkgdir: /install/post/otherpkgs/rhels7.4/ppc64le + otherpkglist: /opt/xcat/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist + pkgdir: /install/rhels7.4/ppc64le + pkglist: /opt/xcat/share/xcat/install/rh/service.rhels7.ppc64le.pkglist + provision_mode: install + role: service + scripts: + postscripts: servicenode + template: /opt/xcat/share/xcat/install/rh/service.rhels7.tmpl + rhels7.4-ppc64le-netboot-compute: + basic_attributes: + arch: ppc64le + distribution: rhels7.4 + osdistro: rhels7.4-ppc64le + osname: Linux + genimgoptions: + exlist: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist + postinstall: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + rootimgdir: /install/netboot/rhels7.4/ppc64le/compute + imagetype: linux + package_selection: + otherpkgdir: /install/post/otherpkgs/rhels7.4/ppc64le + pkgdir: /install/rhels7.4/ppc64le + pkglist: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist + provision_mode: netboot + role: compute + rhels7.4-ppc64le-stateful-mgmtnode: + basic_attributes: + arch: ppc64le + distribution: rhels7.4 + osdistro: rhels7.4-ppc64le + osname: Linux + imagetype: linux + package_selection: + otherpkgdir: /install/post/otherpkgs/rhels7.4/ppc64le + pkgdir: /install/rhels7.4/ppc64le + pkglist: /opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist + provision_mode: install + role: compute + template: /opt/xcat/share/xcat/install/rh/compute.rhels7.tmpl + rhels7.4-ppc64le-statelite-compute: + basic_attributes: + arch: ppc64le + distribution: rhels7.4 + osdistro: rhels7.4-ppc64le + osname: Linux + genimgoptions: + exlist: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist + postinstall: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + rootimgdir: /install/netboot/rhels7.4/ppc64le/compute + imagetype: linux + package_selection: + otherpkgdir: /install/post/otherpkgs/rhels7.4/ppc64le + pkgdir: /install/rhels7.4/ppc64le + pkglist: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist + provision_mode: statelite + role: compute +passwd: {} +policy: + '1': + name: root + rule: allow + '1.2': + name: c910f03c05k08.pok.stglabs.ibm.com + rule: trusted + '2': + commands: getbmcconfig + rule: allow + '2.1': + commands: remoteimmsetup + rule: allow + '2.3': + commands: lsxcatd + rule: allow + '3': + commands: nextdestiny + rule: allow + '4': + commands: getdestiny + rule: allow + '4.4': + commands: getpostscript + rule: allow + '4.5': + commands: getcredentials + rule: allow + '4.6': + commands: syncfiles + rule: allow + '4.7': + commands: litefile + rule: allow + '4.8': + commands: litetree + rule: allow + '4.9': + commands: getadapter + rule: allow +route: {} +schema_version: '1.0' +site: + cluster: + SNsyncfiledir: /var/xcat/syncfiles + auditnosyslog: '0' + auditskipcmds: ALL + blademaxp: '64' + cleanupxcatpost: 'no' + consoleondemand: 'no' + databaseloc: /var/lib + db2installloc: /mntdb2 + dhcplease: '43200' + dnshandler: ddns + enableASMI: 'no' + forwarders: 10.3.17.10 + fsptimeout: '0' + installdir: /install + ipmimaxp: '64' + ipmiretries: '3' + ipmitimeout: '2' + master: 10.3.5.8 + maxssh: '8' + nameservers: 10.3.5.8 + nodesyncfiledir: /var/xcat/node/syncfiles + powerinterval: '0' + ppcmaxp: '64' + ppcretry: '3' + ppctimeout: '0' + sharedtftp: '1' + sshbetweennodes: ALLGROUPS + syspowerinterval: '0' + tftpdir: /tftpboot + timezone: America/New_York + useNmapfromMN: 'no' + vsftp: n + xcatconfdir: /etc/xcat + xcatdport: '3001' + xcatiport: '3002' + xcatsslversion: TLSv1" > /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/yaml.test +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/yaml.test -t node +check:rc==0 +cmd:#!/bin/bash +echo "# +bogusnode1: + objtype=node + bmcpassword=0penBmc + bmcusername=root + cons=openbmc + groups=bogusgroup + ip=10.100.100.1 + mgt=openbmc + netboot=petitboot +bogusnode2: + objtype=node + bmcpassword=0penBmc + bmcusername=root + cons=openbmc + groups=bogusgroup + ip=10.100.100.2 + mgt=openbmc + netboot=petitboot +bogusnode3: + objtype=node + bmcpassword=0penBmc + bmcusername=root + cons=openbmc + groups=bogusgroup + ip=10.100.100.3 + mgt=openbmc + netboot=petitboot" > /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/node_stanza_from_import_file +check:rc==0 +cmd:lsdef bogusnode[1-3] -z | sed -e '/^\s*$/d' > /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/node_stanza_after_import +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/node_stanza_from_import_file /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/node_stanza_after_import +check:rc==0 +cmd:tabdump site|grep 100.3.5.8 +check:rc!=0 +cmd:tabdump networks|grep 100_0_0_0-255_0_0_0 +check:rc!=0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/bogusnode.stanza | mkdef -z -f;fi +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/bogusgroup.stanza ]];then cat /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format +check:rc==0 +end + + +start:xcat_inventory_try_to_import_all_type_is_node_json_format +description:This case is used to test xcat-inventory import all definition which type is node from a yaml file. +cmd:mkdir -p /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:#!/usr/bin/bash +echo '{ + "network": { + "10_0_0_0-255_0_0_0": { + "basic_attr": { + "gateway": "10.0.0.103", + "mask": "255.0.0.0", + "mgtifname": "eth0", + "mtu": "1500", + "net": "10.0.0.0" + }, + "service": { + "tftpserver": "" + } + } + }, + "node": { + "bogusgroup": { + "device_type": "server", + "engines": { + "console_engine": { + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "openbmc_info": { + "bmcpassword": "0penBmc", + "bmcusername": "root" + } + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + } + }, + "network_info": { + "primarynic": { + "ip": "|\\D+(\\d+)|10.100.100.($1)|" + } + }, + "obj_info": { + "grouptype": "static" + }, + "obj_type": "group", + "role": "compute" + }, + "bogusnode1": { + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + }, + "bogusnode2": { + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + }, + "bogusnode3": { + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + }, + "service": { + "device_type": "server", + "engines": { + "netboot_engine": { + "engine_info": { + "postscripts": "servicenode" + } + } + }, + "obj_type": "group", + "role": "compute" + }, + "xcatdefaults": { + "device_type": "server", + "engines": { + "netboot_engine": { + "engine_info": { + "postbootscripts": "otherpkgs", + "postscripts": "syslog,remoteshell,syncfiles" + } + } + }, + "obj_type": "group", + "role": "compute" + } + }, + "osimage": { + "rhels7.4-ppc64le-install-compute": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "rhels7.4", + "osdistro": "rhels7.4-ppc64le", + "osname": "Linux" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": "/install/post/otherpkgs/rhels7.4/ppc64le", + "pkgdir": "/install/rhels7.4/ppc64le", + "pkglist": "/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist" + }, + "provision_mode": "install", + "role": "compute", + "template": "/opt/xcat/share/xcat/install/rh/compute.rhels7.tmpl" + }, + "rhels7.4-ppc64le-install-service": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "rhels7.4", + "osdistro": "rhels7.4-ppc64le", + "osname": "Linux" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": "/install/post/otherpkgs/rhels7.4/ppc64le", + "otherpkglist": "/opt/xcat/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist", + "pkgdir": "/install/rhels7.4/ppc64le", + "pkglist": "/opt/xcat/share/xcat/install/rh/service.rhels7.ppc64le.pkglist" + }, + "provision_mode": "install", + "role": "service", + "scripts": { + "postscripts": "servicenode" + }, + "template": "/opt/xcat/share/xcat/install/rh/service.rhels7.tmpl" + }, + "rhels7.4-ppc64le-netboot-compute": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "rhels7.4", + "osdistro": "rhels7.4-ppc64le", + "osname": "Linux" + }, + "genimgoptions": { + "exlist": "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist", + "postinstall": "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall", + "rootimgdir": "/install/netboot/rhels7.4/ppc64le/compute" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": "/install/post/otherpkgs/rhels7.4/ppc64le", + "pkgdir": "/install/rhels7.4/ppc64le", + "pkglist": "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist" + }, + "provision_mode": "netboot", + "role": "compute" + }, + "rhels7.4-ppc64le-stateful-mgmtnode": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "rhels7.4", + "osdistro": "rhels7.4-ppc64le", + "osname": "Linux" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": "/install/post/otherpkgs/rhels7.4/ppc64le", + "pkgdir": "/install/rhels7.4/ppc64le", + "pkglist": "/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist" + }, + "provision_mode": "install", + "role": "compute", + "template": "/opt/xcat/share/xcat/install/rh/compute.rhels7.tmpl" + }, + "rhels7.4-ppc64le-statelite-compute": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "rhels7.4", + "osdistro": "rhels7.4-ppc64le", + "osname": "Linux" + }, + "genimgoptions": { + "exlist": "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist", + "postinstall": "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall", + "rootimgdir": "/install/netboot/rhels7.4/ppc64le/compute" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": "/install/post/otherpkgs/rhels7.4/ppc64le", + "pkgdir": "/install/rhels7.4/ppc64le", + "pkglist": "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist" + }, + "provision_mode": "statelite", + "role": "compute" + } + }, + "passwd": {}, + "policy": { + "1": { + "name": "root", + "rule": "allow" + }, + "1.2": { + "name": "c910f03c05k08.pok.stglabs.ibm.com", + "rule": "trusted" + }, + "2": { + "commands": "getbmcconfig", + "rule": "allow" + }, + "2.1": { + "commands": "remoteimmsetup", + "rule": "allow" + }, + "2.3": { + "commands": "lsxcatd", + "rule": "allow" + }, + "3": { + "commands": "nextdestiny", + "rule": "allow" + }, + "4": { + "commands": "getdestiny", + "rule": "allow" + }, + "4.4": { + "commands": "getpostscript", + "rule": "allow" + }, + "4.5": { + "commands": "getcredentials", + "rule": "allow" + }, + "4.6": { + "commands": "syncfiles", + "rule": "allow" + }, + "4.7": { + "commands": "litefile", + "rule": "allow" + }, + "4.8": { + "commands": "litetree", + "rule": "allow" + }, + "4.9": { + "commands": "getadapter", + "rule": "allow" + } + }, + "route": {}, + "schema_version": "1.0", + "site": { + "cluster": { + "SNsyncfiledir": "/var/xcat/syncfiles", + "auditnosyslog": "0", + "auditskipcmds": "ALL", + "blademaxp": "64", + "cleanupxcatpost": "no", + "consoleondemand": "no", + "databaseloc": "/var/lib", + "db2installloc": "/mntdb2", + "dhcplease": "43200", + "dnshandler": "ddns", + "enableASMI": "no", + "forwarders": "10.3.17.10", + "fsptimeout": "0", + "installdir": "/install", + "ipmimaxp": "64", + "ipmiretries": "3", + "ipmitimeout": "2", + "master": "10.3.5.8", + "maxssh": "8", + "nameservers": "10.3.5.8", + "nodesyncfiledir": "/var/xcat/node/syncfiles", + "powerinterval": "0", + "ppcmaxp": "64", + "ppcretry": "3", + "ppctimeout": "0", + "sharedtftp": "1", + "sshbetweennodes": "ALLGROUPS", + "syspowerinterval": "0", + "tftpdir": "/tftpboot", + "timezone": "America/New_York", + "useNmapfromMN": "no", + "vsftp": "n", + "xcatconfdir": "/etc/xcat", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatsslversion": "TLSv1" + } + } +}' > /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/json.test +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/json.test -t node +check:rc==0 +cmd:#!/bin/bash +echo "# +bogusnode1: + objtype=node + bmcpassword=0penBmc + bmcusername=root + cons=openbmc + groups=bogusgroup + ip=10.100.100.1 + mgt=openbmc + netboot=petitboot +bogusnode2: + objtype=node + bmcpassword=0penBmc + bmcusername=root + cons=openbmc + groups=bogusgroup + ip=10.100.100.2 + mgt=openbmc + netboot=petitboot +bogusnode3: + objtype=node + bmcpassword=0penBmc + bmcusername=root + cons=openbmc + groups=bogusgroup + ip=10.100.100.3 + mgt=openbmc + netboot=petitboot" > /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/node_stanza_from_import_file +check:rc==0 +cmd:lsdef bogusnode[1-3] -z | sed -e '/^\s*$/d' > /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/node_stanza_after_import +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/node_stanza_from_import_file /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/node_stanza_after_import +check:rc==0 +cmd:tabdump site|grep 100.3.5.8 +check:rc!=0 +cmd:tabdump networks|grep 100_0_0_0-255_0_0_0 +check:rc!=0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/bogusnode.stanza | mkdef -z -f;fi +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/bogusgroup.stanza ]];then cat /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format +check:rc==0 +end + +start:export_more_nodes_import_part_nodes_json +description:This case is used to test xcat-inventory import all definition which type is node from a yaml file. +cmd:mkdir -p /tmp/export_more_nodes_import_part_nodes_json +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_more_nodes_import_part_nodes_json/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/export_more_nodes_import_part_nodes_json/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:mkdef bogusnode[1-3] groups=bogusgroup +check:rc==0 +cmd:#!/bin/bash +echo '# +bogusnode1: + objtype=node + groups=bogusgroup +bogusnode2: + objtype=node + groups=bogusgroup' > /tmp/export_more_nodes_import_part_nodes_json/nodes.bogus +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode1,bogusnode2,bogusnode3|tee /tmp/export_more_nodes_import_part_nodes_json/nodes.export +check:rc==0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd:xcat-inventory import -f /tmp/export_more_nodes_import_part_nodes_json/nodes.export -t node -o bogusnode1,bogusnode2 +check:rc==0 +cmd:lsdef -t node bogusnode1,bogusnode2 -z |sed -e '/^\s*$/d' > /tmp/export_more_nodes_import_part_nodes_json/nodes.import +check:rc==0 +cmd:diff -y /tmp/export_more_nodes_import_part_nodes_json/nodes.bogus /tmp/export_more_nodes_import_part_nodes_json/nodes.import +check:rc==0 +cmd:lsdef -t node bogusnode3 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:rmdef bogusnode[1-2] +check:rc==0 +cmd:if [[ -e /tmp/export_more_nodes_import_part_nodes_json/bogusnode.stanza ]]; then cat /tmp/export_more_nodes_import_part_nodes_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_more_nodes_import_part_nodes_json/bogusgroup.stanza ]];then cat /tmp/export_more_nodes_import_part_nodes_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/export_more_nodes_import_part_nodes_json +check:rc==0 +end + +start:export_more_nodes_import_part_nodes_yaml +description:This case is used to test xcat-inventory import all definition which type is node from a yaml file. +cmd:mkdir -p /tmp/export_more_nodes_import_part_nodes_yaml +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_more_nodes_import_part_nodes_yaml/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/export_more_nodes_import_part_nodes_yaml/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:mkdef bogusnode[1-3] groups=bogusgroup +check:rc==0 +cmd:#!/bin/bash +echo '# +bogusnode1: + objtype=node + groups=bogusgroup +bogusnode2: + objtype=node + groups=bogusgroup' > /tmp/export_more_nodes_import_part_nodes_yaml/nodes.bogus +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode1,bogusnode2,bogusnode3|tee /tmp/export_more_nodes_import_part_nodes_yaml/nodes.export +check:rc==0 +cmd:rmdef bogusnode[1-3] +check:rc==0 +cmd:xcat-inventory import -f /tmp/export_more_nodes_import_part_nodes_yaml/nodes.export -t node -o bogusnode1,bogusnode2 +check:rc==0 +cmd:lsdef -t node bogusnode1,bogusnode2 -z |sed -e '/^\s*$/d' > /tmp/export_more_nodes_import_part_nodes_yaml/nodes.import +check:rc==0 +cmd:diff -y /tmp/export_more_nodes_import_part_nodes_yaml/nodes.bogus /tmp/export_more_nodes_import_part_nodes_yaml/nodes.import +check:rc==0 +cmd:lsdef -t node bogusnode3 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:rmdef bogusnode[1-2] +check:rc==0 +cmd:if [[ -e /tmp/export_more_nodes_import_part_nodes_yaml/bogusnode.stanza ]]; then cat /tmp/export_more_nodes_import_part_nodes_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_more_nodes_import_part_nodes_yaml/bogusgroup.stanza ]];then cat /tmp/export_more_nodes_import_part_nodes_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/export_more_nodes_import_part_nodes_yaml +check:rc==0 +end + +start:export_single_node_then_modify_yaml_then_import +description:This case is used to test xcat-inventory import a node , then modify the export yaml file, then import the yaml file +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_single_node_then_modify_yaml_then_import +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_single_node_then_modify_yaml_then_import/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_yaml_then_import/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=1111 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 hcp=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=1111 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=1111 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=1111 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1111 setupdhcp=1111 setupftp=1111 setupipforward=1111 setupldap=1111 setupnameserver=1111 setupnfs=1111 setupnim=1111 setupntp=1111 setupproxydhcp=1111 setuptftp=1111 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:lsdef bogusnode -z|sed 's/1111/2222/g'|sed 's/unused/used/g'|sed 's/10.10.100.9/20.10.200.9/g'|sort -t'=' -k1 |tee /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:sed -i 's/unused/used/g' /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:sed -i 's/10.10.100.9/20.10.200.9/g' /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:scp /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv $$DSTMN:/tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusnode_yaml.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/dstbogusnode.stanza /tmp/export_single_node_then_modify_yaml_then_import/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_single_node_then_modify_yaml_then_import/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza /tmp/export_single_node_then_modify_yaml_then_import/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_single_node_then_modify_yaml_then_import/bogusnode.stanza ]]; then cat /tmp/export_single_node_then_modify_yaml_then_import/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_single_node_then_modify_yaml_then_import/bogusgroup.stanza ]]; then cat /tmp/export_single_node_then_modify_yaml_then_import/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_single_node_then_modify_yaml_then_import +check:rc==0 +end + +start:export_single_node_then_modify_json_then_import +description:This case is used to test xcat-inventory import a node , then modify the export json file, then import the json file +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_single_node_then_modify_json_then_import +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/' +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_single_node_then_modify_json_then_import/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_json_then_import/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusnode.stanza ;rmdef bogusnode;fi' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=1111 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 hcp=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=1111 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=1111 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=1111 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1111 setupdhcp=1111 setupftp=1111 setupipforward=1111 setupldap=1111 setupnameserver=1111 setupnfs=1111 setupnim=1111 setupntp=1111 setupproxydhcp=1111 setuptftp=1111 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:lsdef bogusnode -z|sed 's/1111/2222/g'|sed 's/unused/used/g'|sed 's/10.10.100.9/20.10.200.9/g'|sort -t'=' -k1 |tee /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:sed -i 's/unused/used/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:sed -i 's/10.10.100.9/20.10.200.9/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:scp /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv $$DSTMN:/tmp/export_single_node_then_modify_json_then_import_$$DSTMN/ +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusnode_json.inv -t node -o bogusnode' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef bogusnode -z |sort -t'=' -k1|tee /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/dstbogusnode.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_single_node_then_modify_json_then_import_$$DSTMN/dstbogusnode.stanza /tmp/export_single_node_then_modify_json_then_import/dstbogusnode.stanza +check:rc==0 +cmd: cat /tmp/export_single_node_then_modify_json_then_import/dstbogusnode.stanza +check:rc==0 +cmd:diff -y /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza /tmp/export_single_node_then_modify_json_then_import/dstbogusnode.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef bogusnode' +check:rc==0 +cmd:if [[ -e /tmp/export_single_node_then_modify_json_then_import/bogusnode.stanza ]]; then cat /tmp/export_single_node_then_modify_json_then_import/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_single_node_then_modify_json_then_import/bogusgroup.stanza ]]; then cat /tmp/export_single_node_then_modify_json_then_import/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusgroup.stanza ]]; then cat /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_single_node_then_modify_json_then_import +check:rc==0 +end + +start:export_import_single_group_json +description:This case is used to test xcat-inventory export and import the definition of group +cmd:mkdir -p /tmp/export_import_single_group_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_group_json_$$DSTMN/' +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_single_group_json/bogusnode.stanza ;rmdef bogusnode$i;fi; done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_group_json/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_single_group_json_$$DSTMN/bogusnode.stanza ;rmdef bogusnode$i;fi; done' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_group_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t group -o bogusgroup mgt=openbmc cons=openbmc netboot=petitboot ip='|\D+(\d+)|10.100.100.($1)|' bmcusername=root bmcpassword=0penBmc +check:rc==0 +cmd: mkdef -t node -o bogusnode[1-3] groups=bogusgroup +check:rc==0 +cmd: lsdef -t node -o bogusnode[1-3] > /tmp/export_import_single_group_json/target_nodes_group +check:rc==0 +cmd: lsdef -t group -o bogusgroup >> /tmp/export_import_single_group_json/target_nodes_group +check:rc==0 +cmd:xcat-inventory export --format=json -t node -o bogusnode1,bogusnode2,bogusnode3,bogusgroup |tee /tmp/export_import_single_group_json/export.file +check:rc==0 +cmd:scp /tmp/export_import_single_group_json/export.file $$DSTMN:/tmp/export_import_single_group_json_$$DSTMN/ +check:rc==0 +cmd:rmdef -t node -o bogusnode[1-3] +check:rc==0 +cmd:rmdef -t group -o bogusgroup +check:rc==0 +cmd:ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_group_json_$$DSTMN/export.file -t node -o bogusnode1,bogusnode2,bogusnode3,bogusgroup' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t node -o bogusnode[1-3] > /tmp/export_import_single_group_json_$$DSTMN/import_nodes_group' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group -o bogusgroup >> /tmp/export_import_single_group_json_$$DSTMN/import_nodes_group' +check:rc==0 +cmd:scp $$DSTMN:/tmp/export_import_single_group_json_$$DSTMN/import_nodes_group /tmp/export_import_single_group_json/import_nodes_group +check:rc==0 +cmd:diff -y /tmp/export_import_single_group_json/target_nodes_group /tmp/export_import_single_group_json/import_nodes_group +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_group_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_group_json/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_group_json/bogusgroup.stanza ]];then cat /tmp/export_import_single_group_json/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t node -o bogusnode[1-3]' +check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t group -o bogusgroup' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_group_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_group_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_group_json_$$DSTMN/bogusgroup.stanza ]];then cat /tmp/export_import_single_group_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_group_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_group_json +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage new file mode 100644 index 000000000..e7ec504ff --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage @@ -0,0 +1,926 @@ +start:export_import_single_osimage_by_yaml +description:This case is used to test xcat-inventory export and import one linux osimage definition by yaml between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_osimage_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_osimage_by_yaml_$$DSTMN/' +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_import_single_osimage_by_yaml/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_import_single_osimage_by_yaml_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' +check:rc==0 +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +check:rc==0 +cmd:lsdef -t osimage -o bogus_image -z|sort -t'=' -k1 |tee /tmp/export_import_single_osimage_by_yaml/src_bogus_osimage.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t osimage -o bogus_image |tee /tmp/export_import_single_osimage_by_yaml/bogus_image.yaml +check:rc==0 +cmd:scp /tmp/export_import_single_osimage_by_yaml/bogus_image.yaml $$DSTMN:/tmp/export_import_single_osimage_by_yaml_$$DSTMN/ +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_osimage_by_yaml_$$DSTMN/bogus_image.yaml -t osimage -o bogus_image' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t osimage -o bogus_image -z |sort -t'=' -k1|tee /tmp/export_import_single_osimage_by_yaml_$$DSTMN/dst_bogus_image.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_osimage_by_yaml_$$DSTMN/dst_bogus_image.stanza /tmp/export_import_single_osimage_by_yaml/dst_bogus_image.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_osimage_by_yaml/dst_bogus_image.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_osimage_by_yaml/src_bogus_osimage.stanza /tmp/export_import_single_osimage_by_yaml/dst_bogus_image.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t osimage -o bogus_image' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_osimage_by_yaml/bogus_image.stanza ]]; then cat /tmp/export_import_single_osimage_by_yaml/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_osimage_by_yaml_$$DSTMN/bogus_image.stanza ]]; then cat /tmp/export_import_single_osimage_by_yaml_$$DSTMN/bogus_image.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_osimage_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_osimage_by_yaml +check:rc==0 +end + +start:export_import_single_osimage_by_json +description:This case is used to test xcat-inventory export and import one linux osimage definition by json between 2 exact same MNs. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_single_osimage_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_osimage_by_json_$$DSTMN/' +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_import_single_osimage_by_json/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_import_single_osimage_by_json_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' +check:rc==0 +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +check:rc==0 +cmd:lsdef -t osimage -o bogus_image -z|sort -t'=' -k1 |tee /tmp/export_import_single_osimage_by_json/src_bogus_osimage.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t osimage -o bogus_image |tee /tmp/export_import_single_osimage_by_json/bogus_image.json +check:rc==0 +cmd:scp /tmp/export_import_single_osimage_by_json/bogus_image.json $$DSTMN:/tmp/export_import_single_osimage_by_json_$$DSTMN/ +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_osimage_by_json_$$DSTMN/bogus_image.json -t osimage -o bogus_image' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t osimage -o bogus_image -z |sort -t'=' -k1|tee /tmp/export_import_single_osimage_by_json_$$DSTMN/dst_bogus_image.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_single_osimage_by_json_$$DSTMN/dst_bogus_image.stanza /tmp/export_import_single_osimage_by_json/dst_bogus_image.stanza +check:rc==0 +cmd: cat /tmp/export_import_single_osimage_by_json/dst_bogus_image.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_single_osimage_by_json/src_bogus_osimage.stanza /tmp/export_import_single_osimage_by_json/dst_bogus_image.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t osimage -o bogus_image' +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_osimage_by_json/bogus_image.stanza ]]; then cat /tmp/export_import_single_osimage_by_json/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_osimage_by_json_$$DSTMN/bogus_image.stanza ]]; then cat /tmp/export_import_single_osimage_by_json_$$DSTMN/bogus_image.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_osimage_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_osimage_by_json +check:rc==0 +end + + + +start:xcat_inventory_try_to_export_all_type_is_osimage_default_format +description:This case is used to test xcat-inventory export all definition which type is osimage by default format, i.e. json format. +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +check:rc==0 +cmd:xcat-inventory export -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc==0 +cmd:grep ' "osimage": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc==0 +cmd:grep '"bogus_image": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc==0 +cmd: grep '"node": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc!=0 +cmd: grep '"obj_type": "node",' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc!=0 +cmd: grep '"policy": {'' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc!=0 +cmd: grep '"passwd": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc!=0 +cmd: grep '"network": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc!=0 +cmd: grep '"route": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc!=0 +cmd: grep '"site": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file +check:rc!=0 +cmd:lsdef -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/osimage_in_xcat_db +check:rc==0 +cmd: a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/osimage_in_xcat_db`; do if grep -E "\"$i\": {" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file > /dev/null; then ((a++));fi; done; do=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/osimage_in_xcat_db|wc -l);if [[ $do -eq $a ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/bogus_image.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format +check:rc==0 +end + +start:xcat_inventory_try_to_export_all_type_is_osimage_json_format +description:This case is used to test xcat-inventory export all definition which type is osimage by json format. +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +check:rc==0 +cmd:xcat-inventory export --format=json -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc==0 +cmd:grep ' "osimage": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc==0 +cmd:grep '"bogus_image": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc==0 +cmd: grep '"node": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc!=0 +cmd: grep '"obj_type": "node",' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc!=0 +cmd: grep '"policy": {'' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc!=0 +cmd: grep '"passwd": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc!=0 +cmd: grep '"network": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc!=0 +cmd: grep '"route": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc!=0 +cmd: grep '"site": {' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file +check:rc!=0 +cmd:lsdef -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/osimage_in_xcat_db +check:rc==0 +cmd: a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/osimage_in_xcat_db`; do if grep -E "\"$i\": {" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file > /dev/null; then ((a++));fi; done; do=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/osimage_in_xcat_db|wc -l);if [[ $do -eq $a ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/bogus_image.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format +check:rc==0 +end + +start:xcat_inventory_try_to_export_all_type_is_osimage_yaml_format +description:This case is used to test xcat-inventory export all definition which type is osimage by yaml format. +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +check:rc==0 +cmd:xcat-inventory export --format=yaml -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc==0 +cmd:grep -E "^osimage:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc==0 +cmd:grep -E "^\s*bogus_image:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc==0 +cmd: grep -E "^node:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc!=0 +cmd: grep -E "obj_type: node" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc!=0 +cmd: grep -E "^policy:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc!=0 +cmd: grep -E "^passwd:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc!=0 +cmd: grep -E "^network:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc!=0 +cmd: grep -E "^route:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc!=0 +cmd: grep -E "^site:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file +check:rc!=0 +cmd:lsdef -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/osimage_in_xcat_db +check:rc==0 +cmd: a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/osimage_in_xcat_db`; do if grep -E "$i:" /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file > /dev/null; then ((a++));fi; done; do=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/osimage_in_xcat_db|wc -l);if [[ $do -eq $a ]]; then exit 0; else exit 1;fi +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/bogus_image.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format +check:rc==0 +end + + +start:xcat_inventory_try_to_import_all_type_is_osimage_yaml_format +description:This case is used to test xcat-inventory import all definition which type is osimage from a yaml file. +cmd:mkdir -p /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:lsdef -t node -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_nodes_db +check:rc==0 +cmd:lsdef -t group -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_group_db +check:rc==0 +cmd:tabdump site > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_site_db +check:rc==0 +cmd:tabdump passwd > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_pw_db +check:rc==0 +cmd:tabdump policy > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_policy_db +check:rc==0 +cmd:tabdump networks > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_network_db +check:rc==0 +cmd:tabdump routes > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_route_db +check:rc==0 +cmd:lsdef -t osimage -l|sed '/^Could not find any object definitions to display/d' > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_osimage_db +check:rc==0 +cmd:#!/bin/bash +echo "network: + 10_0_0_0-255_0_0_0: + basic_attr: + gateway: 10.0.0.103 + mask: 255.0.0.0 + mgtifname: eth0 + mtu: '1500' + net: 10.0.0.0 + schema_version: 1.0 + service: + tftpserver: +node: + bogusnode1: + device_type: server + engines: + console_engine: + engine_info: + cons: openbmc + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.3.11.101 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot + power_mgt_engine: + engine_type: openbmc + network_info: + primarynic: + ip: 10.100.100.1 + obj_info: + groups: bogusgroup + obj_type: node + role: compute + schema_version: 1.0 + bogusnode2: + device_type: server + engines: + console_engine: + engine_info: + cons: openbmc + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.3.11.102 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot + power_mgt_engine: + engine_type: openbmc + network_info: + primarynic: + ip: 10.100.100.2 + obj_info: + groups: bogusgroup + obj_type: node + role: compute + schema_version: 1.0 + bogusnode3: + device_type: server + engines: + console_engine: + engine_info: + cons: openbmc + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.3.11.103 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot + power_mgt_engine: + engine_type: openbmc + network_info: + primarynic: + ip: 10.100.100.3 + obj_info: + groups: bogusgroup + obj_type: node + role: compute + schema_version: 1.0 + service: + device_type: server + engines: + netboot_engine: + engine_info: + postscripts: servicenode + obj_type: group + role: compute + schema_version: 1.0 + xcatdefaults: + device_type: server + engines: + netboot_engine: + engine_info: + postbootscripts: otherpkgs + postscripts: syslog,remoteshell,syncfiles + obj_type: group + role: compute + schema_version: 1.0 +osimage: + bogus_image: + addkcmdline: aaaa + boottarget: aaa + imagetype: linux + schema_version: 1.0 +passwd: {} +policy: + '1': + name: root + rule: allow + schema_version: 1.0 + '1.2': + name: c910f03c05k08.pok.stglabs.ibm.com + rule: trusted + schema_version: 1.0 + '2': + commands: getbmcconfig + rule: allow + schema_version: 1.0 + '2.1': + commands: remoteimmsetup + rule: allow + schema_version: 1.0 + '2.3': + commands: lsxcatd + rule: allow + schema_version: 1.0 + '3': + commands: nextdestiny + rule: allow + schema_version: 1.0 + '4': + commands: getdestiny + rule: allow + schema_version: 1.0 + '4.4': + commands: getpostscript + rule: allow + schema_version: 1.0 + '4.5': + commands: getcredentials + rule: allow + schema_version: 1.0 + '4.6': + commands: syncfiles + rule: allow + schema_version: 1.0 + '4.7': + commands: litefile + rule: allow + schema_version: 1.0 + '4.8': + commands: litetree + rule: allow + schema_version: 1.0 + '4.9': + commands: getadapter + rule: allow + schema_version: 1.0 +route: {} +site: + cluster: + SNsyncfiledir: /var/xcat/syncfiles + auditnosyslog: '0' + auditskipcmds: ALL + blademaxp: '64' + cleanupxcatpost: 'no' + consoleondemand: 'no' + databaseloc: /var/lib + db2installloc: /mntdb2 + dhcplease: '43200' + dnshandler: ddns + enableASMI: 'no' + forwarders: 10.3.17.10 + fsptimeout: '0' + installdir: /install + ipmimaxp: '64' + ipmiretries: '3' + ipmitimeout: '2' + master: 10.3.5.8 + maxssh: '8' + nameservers: 10.3.5.8 + nodesyncfiledir: /var/xcat/node/syncfiles + powerinterval: '0' + ppcmaxp: '64' + ppcretry: '3' + ppctimeout: '0' + schema_version: 1.0 + sharedtftp: '1' + sshbetweennodes: ALLGROUPS + syspowerinterval: '0' + tftpdir: /tftpboot + timezone: America/New_York + useNmapfromMN: 'no' + vsftp: n + xcatconfdir: /etc/xcat + xcatdport: '3001' + xcatiport: '3002' + xcatsslversion: TLSv1" > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/import.file +check:rc==0 +cmd:#!/bin/bash +echo "Object name: bogus_image + addkcmdline=aaaa + boottarget=aaa + imagetype=linux">> /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_osimage_db +check:rc==0 +cmd:sort /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_osimage_db > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/target_osimage_sort +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/import.file -t osimage +check:rc==0 +cmd:lsdef -t osimage -l|sort > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/import_osimage +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/target_osimage_sort /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/import_osimage +check:rc==0 +cmd:lsdef -t node -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_nodes_db +check:rc==0 +cmd:lsdef -t group -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_group_db +check:rc==0 +cmd:tabdump site > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_site_db +check:rc==0 +cmd:tabdump passwd > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_pw_db +check:rc==0 +cmd:tabdump policy > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_policy_db +check:rc==0 +cmd:tabdump networks > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_network_db +check:rc==0 +cmd:tabdump routes > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_route_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_nodes_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_nodes_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_group_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_group_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_site_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_site_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_pw_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_pw_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_policy_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_policy_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_network_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_network_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_route_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/after_route_db +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/bogus_image.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format +check:rc==0 +end + +start:xcat_inventory_try_to_import_all_type_is_osimage_json_format +description:This case is used to test xcat-inventory import all definition which type is osimage from a json file. +cmd:mkdir -p /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:lsdef -t node -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_nodes_db +check:rc==0 +cmd:lsdef -t group -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_group_db +check:rc==0 +cmd:tabdump site > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_site_db +check:rc==0 +cmd:tabdump passwd > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_pw_db +check:rc==0 +cmd:tabdump policy > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_policy_db +check:rc==0 +cmd:tabdump networks > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_network_db +check:rc==0 +cmd:tabdump routes > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_route_db +check:rc==0 +cmd:lsdef -t osimage -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_osimage_db +check:rc==0 +cmd:lsdef -t osimage -l|sed '/^Could not find any object definitions to display/d' > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_osimage_db +check:rc==0 +cmd:#!/bin/bash +echo '{ + "network": { + "10_0_0_0-255_0_0_0": { + "basic_attr": { + "gateway": "10.0.0.103", + "mask": "255.0.0.0", + "mgtifname": "eth0", + "mtu": "1500", + "net": "10.0.0.0" + }, + "schema_version": 1.0, + "service": { + "tftpserver": "" + } + } + }, + "node": { + "bogusnode1": { + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "cons": "openbmc" + }, + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.3.11.101", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + }, + "power_mgt_engine": { + "engine_type": "openbmc" + } + }, + "network_info": { + "primarynic": { + "ip": "10.100.100.1" + } + }, + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute", + "schema_version": 1.0 + }, + "bogusnode2": { + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "cons": "openbmc" + }, + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.3.11.102", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + }, + "power_mgt_engine": { + "engine_type": "openbmc" + } + }, + "network_info": { + "primarynic": { + "ip": "10.100.100.2" + } + }, + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute", + "schema_version": 1.0 + }, + "bogusnode3": { + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "cons": "openbmc" + }, + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.3.11.103", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + }, + "power_mgt_engine": { + "engine_type": "openbmc" + } + }, + "network_info": { + "primarynic": { + "ip": "10.100.100.3" + } + }, + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute", + "schema_version": 1.0 + }, + "service": { + "device_type": "server", + "engines": { + "netboot_engine": { + "engine_info": { + "postscripts": "servicenode" + } + } + }, + "obj_type": "group", + "role": "compute", + "schema_version": 1.0 + }, + "xcatdefaults": { + "device_type": "server", + "engines": { + "netboot_engine": { + "engine_info": { + "postbootscripts": "otherpkgs", + "postscripts": "syslog,remoteshell,syncfiles" + } + } + }, + "obj_type": "group", + "role": "compute", + "schema_version": 1.0 + } + }, + "osimage": { + "bogus_image": { + "addkcmdline": "aaaa", + "boottarget": "aaa", + "imagetype": "linux", + "schema_version": 1.0 + } + }, + "passwd": {}, + "policy": { + "1": { + "name": "root", + "rule": "allow", + "schema_version": 1.0 + }, + "1.2": { + "name": "c910f03c05k08.pok.stglabs.ibm.com", + "rule": "trusted", + "schema_version": 1.0 + }, + "2": { + "commands": "getbmcconfig", + "rule": "allow", + "schema_version": 1.0 + }, + "2.1": { + "commands": "remoteimmsetup", + "rule": "allow", + "schema_version": 1.0 + }, + "2.3": { + "commands": "lsxcatd", + "rule": "allow", + "schema_version": 1.0 + }, + "3": { + "commands": "nextdestiny", + "rule": "allow", + "schema_version": 1.0 + }, + "4": { + "commands": "getdestiny", + "rule": "allow", + "schema_version": 1.0 + }, + "4.4": { + "commands": "getpostscript", + "rule": "allow", + "schema_version": 1.0 + }, + "4.5": { + "commands": "getcredentials", + "rule": "allow", + "schema_version": 1.0 + }, + "4.6": { + "commands": "syncfiles", + "rule": "allow", + "schema_version": 1.0 + }, + "4.7": { + "commands": "litefile", + "rule": "allow", + "schema_version": 1.0 + }, + "4.8": { + "commands": "litetree", + "rule": "allow", + "schema_version": 1.0 + }, + "4.9": { + "commands": "getadapter", + "rule": "allow", + "schema_version": 1.0 + } + }, + "route": {}, + "site": { + "cluster": { + "SNsyncfiledir": "/var/xcat/syncfiles", + "auditnosyslog": "0", + "auditskipcmds": "ALL", + "blademaxp": "64", + "cleanupxcatpost": "no", + "consoleondemand": "no", + "databaseloc": "/var/lib", + "db2installloc": "/mntdb2", + "dhcplease": "43200", + "dnshandler": "ddns", + "enableASMI": "no", + "forwarders": "10.3.17.10", + "fsptimeout": "0", + "installdir": "/install", + "ipmimaxp": "64", + "ipmiretries": "3", + "ipmitimeout": "2", + "master": "10.3.5.8", + "maxssh": "8", + "nameservers": "10.3.5.8", + "nodesyncfiledir": "/var/xcat/node/syncfiles", + "powerinterval": "0", + "ppcmaxp": "64", + "ppcretry": "3", + "ppctimeout": "0", + "schema_version": 1.0, + "sharedtftp": "1", + "sshbetweennodes": "ALLGROUPS", + "syspowerinterval": "0", + "tftpdir": "/tftpboot", + "timezone": "America/New_York", + "useNmapfromMN": "no", + "vsftp": "n", + "xcatconfdir": "/etc/xcat", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatsslversion": "TLSv1" + } + } +}' > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/import.file +check:rc==0 +cmd:#!/bin/bash +echo "Object name: bogus_image + addkcmdline=aaaa + boottarget=aaa + imagetype=linux">> /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_osimage_db +check:rc==0 +cmd:sort /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_osimage_db > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/target_osimage_sort +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/import.file -t osimage +check:rc==0 +cmd:lsdef -t osimage -l|sort > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/import_osimage +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/target_osimage_sort /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/import_osimage +check:rc==0 +cmd:lsdef -t node -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_nodes_db +check:rc==0 +cmd:lsdef -t group -l > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_group_db +check:rc==0 +cmd:tabdump site > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_site_db +check:rc==0 +cmd:tabdump passwd > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_pw_db +check:rc==0 +cmd:tabdump policy > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_policy_db +check:rc==0 +cmd:tabdump networks > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_network_db +check:rc==0 +cmd:tabdump routes > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_route_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_nodes_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_nodes_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_group_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_group_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_site_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_site_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_pw_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_pw_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_policy_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_policy_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_network_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_network_db +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_route_db /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/after_route_db +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/bogus_image.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format +check:rc==0 +end + + + +start:export_single_osimage_then_modify_json_then_import +description:This case is used to test xcat-inventory import a osimage , then modify the export json file, then import the json file +cmd:mkdir -p /tmp/export_single_osimage_then_modify_json_then_import +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/' +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_single_osimage_then_modify_json_then_import/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' +check:rc==0 +cmd:chdef -t osimage -o bogus_image addkcmdline=1111 boottarget=1111 cfmdir=1111 crashkernelsize=1111 description=1111 driverupdatesrc=1111 dump=1111 exlist=1111 groups=1111 imagename=1111 imagetype=linux isdeletable=1111 kerneldir=1111 kernelver=1111 kitcomponents=1111 krpmver=1111 netdrivers=1111 nodebootif=1111 osarch=1111 osdistroname=1111 osname=1111 osupdatename=1111 osvers=1111 otherifce=1111 otherpkgdir=1111 otherpkglist=1111 partitionfile=1111 permission=1111 pkgdir=1111 pkglist=1111 postbootscripts=1111 postinstall=1111 postscripts=1111 profile=1111 provmethod=1111 rootfstype=1111 rootimgdir=1111 serverrole=1111 synclists=1111 template=1111 usercomment=1111 +check:rc==0 +cmd:lsdef -t osimage -o bogus_image -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_single_osimage_then_modify_json_then_import/src_bogus_osimage.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t osimage -o bogus_image |tee /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json +check:rc==0 +cmd:scp /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json $$DSTMN:/tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/ +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/bogus_image.json -t osimage -o bogus_image' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t osimage -o bogus_image -z |sort -t'=' -k1|tee /tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/dst_bogus_image.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/dst_bogus_image.stanza /tmp/export_single_osimage_then_modify_json_then_import/dst_bogus_image.stanza +check:rc==0 +cmd: cat /tmp/export_single_osimage_then_modify_json_then_import/dst_bogus_image.stanza +check:rc==0 +cmd:diff -y /tmp/export_single_osimage_then_modify_json_then_import/src_bogus_osimage.stanza /tmp/export_single_osimage_then_modify_json_then_import/dst_bogus_image.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t osimage -o bogus_image' +check:rc==0 +cmd:if [[ -e /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.stanza ]]; then cat /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/bogus_image.stanza ]]; then cat /tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/bogus_image.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_single_osimage_then_modify_json_then_import +check:rc==0 +end + +start:export_single_osimage_then_modify_yaml_then_import +description:This case is used to test xcat-inventory import a osimage , then modify the export yaml file, then import the yaml file +cmd:mkdir -p /tmp/export_single_osimage_then_modify_yaml_then_import +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/' +check:rc==0 +cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' +check:rc==0 +cmd:chdef -t osimage -o bogus_image addkcmdline=1111 boottarget=1111 cfmdir=1111 crashkernelsize=1111 description=1111 driverupdatesrc=1111 dump=1111 exlist=1111 groups=1111 imagename=1111 imagetype=linux isdeletable=1111 kerneldir=1111 kernelver=1111 kitcomponents=1111 krpmver=1111 netdrivers=1111 nodebootif=1111 osarch=1111 osdistroname=1111 osname=1111 osupdatename=1111 osvers=1111 otherifce=1111 otherpkgdir=1111 otherpkglist=1111 partitionfile=1111 permission=1111 pkgdir=1111 pkglist=1111 postbootscripts=1111 postinstall=1111 postscripts=1111 profile=1111 provmethod=1111 rootfstype=1111 rootimgdir=1111 serverrole=1111 synclists=1111 template=1111 usercomment=1111 +check:rc==0 +cmd:lsdef -t osimage -o bogus_image -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_single_osimage_then_modify_yaml_then_import/src_bogus_osimage.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t osimage -o bogus_image |tee /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml +check:rc==0 +cmd:scp /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml $$DSTMN:/tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/ +check:rc==0 +cmd: rmdef -t osimage -o bogus_image +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/bogus_image.yaml -t osimage -o bogus_image' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t osimage -o bogus_image -z |sort -t'=' -k1|tee /tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/dst_bogus_image.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/dst_bogus_image.stanza /tmp/export_single_osimage_then_modify_yaml_then_import/dst_bogus_image.stanza +check:rc==0 +cmd: cat /tmp/export_single_osimage_then_modify_yaml_then_import/dst_bogus_image.stanza +check:rc==0 +cmd:diff -y /tmp/export_single_osimage_then_modify_yaml_then_import/src_bogus_osimage.stanza /tmp/export_single_osimage_then_modify_yaml_then_import/dst_bogus_image.stanza +check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t osimage -o bogus_image' +check:rc==0 +cmd:if [[ -e /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.stanza ]]; then cat /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.stanza | mkdef -z;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/bogus_image.stanza ]]; then cat /tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/bogus_image.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_single_osimage_then_modify_yaml_then_import +check:rc==0 +end + + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.site b/xCAT-test/autotest/testcase/xcat-inventory/cases.site new file mode 100644 index 000000000..a1b4555e3 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.site @@ -0,0 +1,1364 @@ +start:export_import_site_by_yaml +description:This case is used to test xcat-inventory export and import site table by yaml between 2 excat same MNs. Before running this case, make sure these two MNs have been installed same excatly, and the current MN can connect the other MN by ssh without password.This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_site_by_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_site_by_yaml_$$DSTMN/' +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/export_import_site_by_yaml/site.stanza +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t site -o clustersite -z >/tmp/export_import_site_by_yaml_$$DSTMN/site.stanza ' +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=0 useNFSv4onAIX=0 FQDNfirst=1 SNsyncfiledir='/var/xcat/syncfiles' auditnosyslog=0 auditskipcmds=ALL blademaxp=64 cleanupxcatpost=no consoleondemand=no databaseloc='/var/lib' db2installloc='/mntdb2' dbtracelevel=0 defserialflow=0 defserialport=0 defserialspeed=9600 dhcpinterfaces=eth0 dhcplease=43200 dhcpsetup=n disjointdhcps=1 dnshandler=ddns dnsinterfaces='xcatmn|eth1,eth2;service|bond0' dnsupdaters=dnsupdaters domain='pok.stglabs.ibm.com' enableASMI=no excludenodes=excludenodes externaldns=externaldns extntpservers=extntpservers forwarders=$mnip fsptimeout=0 genmacprefix='00:11:aa' genpasswords=genpasswords hierarchicalattrs=hierarchicalattrs httpport=80 hwctrldispatch=y installdir='/install/' installloc='hostname:/path' ipmidispatch=y ipmimaxp=64 ipmiretries=3 ipmisdrcache=no ipmitimeout=2 iscsidir='/iscsidir' managedaddressmode=dhcp master=$mnip maxssh=8 mnroutenames=mnroutenames nameservers=$mnip nmapoptions='--min-rtt-timeout' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles' ntpservers=$mnip persistkvmguests=y powerinterval=0 ppcmaxp=64 ppcretry=3 ppctimeout=0 precreatemypostscripts=1 pruneservices=1 runbootscripts=yes setinstallnic=1 sharedinstall=no sharedtftp=1 skiptables=nics skipvalidatelog=1 snmpc=snmpc sshbetweennodes=ALLGROUPS svloglocal=1 syspowerinterval=10 syspowermaxnodes=10 tftpdir='/tftprot/' tftpflags='-v' timezone='America/New_York' useNmapfromMN=no useflowcontrol=no usexhrm=no vcenterautojoin=no vmwarereconfigonpower=no vsftp=n xcatconfdir='/etc/xcat' xcatdebugmode=1 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=64 xcatmaxconnections=60 xcatsslciphers='3DES' xcatsslversion=TLSv1 +check:rc==0 +cmd:lsdef -t site -o clustersite -z|sort -t'=' -k1 |tee /tmp/export_import_site_by_yaml/srcsite.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t site -o clustersite |tee /tmp/export_import_site_by_yaml/export_site_yaml.inv +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$mnip/$$DSTMN/g" /tmp/export_import_site_by_yaml/export_site_yaml.inv +check:rc==0 +cmd:cat /tmp/export_import_site_by_yaml/export_site_yaml.inv +check:rc==0 +cmd:scp /tmp/export_import_site_by_yaml/export_site_yaml.inv $$DSTMN:/tmp/export_import_site_by_yaml_$$DSTMN/ +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_site_by_yaml_$$DSTMN/export_site_yaml.inv -t site -o clustersite' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t site -o clustersite -z |sort -t'=' -k1|tee /tmp/export_import_site_by_yaml_$$DSTMN/dstsite.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_site_by_yaml_$$DSTMN/dstsite.stanza /tmp/export_import_site_by_yaml/dstsite.stanza +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$$DSTMN/$mnip/g" /tmp/export_import_site_by_yaml/dstsite.stanza +check:rc==0 +cmd: cat /tmp/export_import_site_by_yaml/dstsite.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_site_by_yaml/srcsite.stanza /tmp/export_import_site_by_yaml/dstsite.stanza +check:rc==0 +cmd:cat /tmp/export_import_site_by_yaml/site.stanza | mkdef -z -f +check:rc==0 +cmd:ssh $$DSTMN 'cat /tmp/export_import_site_by_yaml_$$DSTMN/site.stanza | mkdef -z -f' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_site_by_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_site_by_yaml +check:rc==0 +end + + +start:export_import_site_by_json +description:This case is used to test xcat-inventory export and import site table by json between 2 excat same MNs. Before running this case, make sure these two MNs have been installed same excatly, and the current MN can connect the other MN by ssh without password.This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_import_site_by_json +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_site_by_json_$$DSTMN/' +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/export_import_site_by_json/site.stanza +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t site -o clustersite -z >/tmp/export_import_site_by_json_$$DSTMN/site.stanza ' +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=0 useNFSv4onAIX=0 FQDNfirst=1 SNsyncfiledir='/var/xcat/syncfiles' auditnosyslog=0 auditskipcmds=ALL blademaxp=64 cleanupxcatpost=no consoleondemand=no databaseloc='/var/lib' db2installloc='/mntdb2' dbtracelevel=0 defserialflow=0 defserialport=0 defserialspeed=9600 dhcpinterfaces=eth0 dhcplease=43200 dhcpsetup=n disjointdhcps=1 dnshandler=ddns dnsinterfaces='xcatmn|eth1,eth2;service|bond0' dnsupdaters=dnsupdaters domain='pok.stglabs.ibm.com' enableASMI=no excludenodes=excludenodes externaldns=externaldns extntpservers=extntpservers forwarders=$mnip fsptimeout=0 genmacprefix='00:11:aa' genpasswords=genpasswords hierarchicalattrs=hierarchicalattrs httpport=80 hwctrldispatch=y installdir='/install/' installloc='hostname:/path' ipmidispatch=y ipmimaxp=64 ipmiretries=3 ipmisdrcache=no ipmitimeout=2 iscsidir='/iscsidir' managedaddressmode=dhcp master=$mnip maxssh=8 mnroutenames=mnroutenames nameservers=$mnip nmapoptions='--min-rtt-timeout' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles' ntpservers=$mnip persistkvmguests=y powerinterval=0 ppcmaxp=64 ppcretry=3 ppctimeout=0 precreatemypostscripts=1 pruneservices=1 runbootscripts=yes setinstallnic=1 sharedinstall=no sharedtftp=1 skiptables=nics skipvalidatelog=1 snmpc=snmpc sshbetweennodes=ALLGROUPS svloglocal=1 syspowerinterval=10 syspowermaxnodes=10 tftpdir='/tftprot/' tftpflags='-v' timezone='America/New_York' useNmapfromMN=no useflowcontrol=no usexhrm=no vcenterautojoin=no vmwarereconfigonpower=no vsftp=n xcatconfdir='/etc/xcat' xcatdebugmode=1 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=64 xcatmaxconnections=60 xcatsslciphers='3DES' xcatsslversion=TLSv1 +check:rc==0 +cmd:lsdef -t site -o clustersite -z|sort -t'=' -k1 |tee /tmp/export_import_site_by_json/srcsite.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t site -o clustersite |tee /tmp/export_import_site_by_json/export_site_json.inv +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$mnip/$$DSTMN/g" /tmp/export_import_site_by_json/export_site_json.inv +check:rc==0 +cmd:cat /tmp/export_import_site_by_json/export_site_json.inv +check:rc==0 +cmd:scp /tmp/export_import_site_by_json/export_site_json.inv $$DSTMN:/tmp/export_import_site_by_json_$$DSTMN/ +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_site_by_json_$$DSTMN/export_site_json.inv -t site -o clustersite' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t site -o clustersite -z |sort -t'=' -k1|tee /tmp/export_import_site_by_json_$$DSTMN/dstsite.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_import_site_by_json_$$DSTMN/dstsite.stanza /tmp/export_import_site_by_json/dstsite.stanza +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$$DSTMN/$mnip/g" /tmp/export_import_site_by_json/dstsite.stanza +check:rc==0 +cmd: cat /tmp/export_import_site_by_json/dstsite.stanza +check:rc==0 +cmd:diff -y /tmp/export_import_site_by_json/srcsite.stanza /tmp/export_import_site_by_json/dstsite.stanza +check:rc==0 +cmd:cat /tmp/export_import_site_by_json/site.stanza | mkdef -z -f +check:rc==0 +cmd:ssh $$DSTMN 'cat /tmp/export_import_site_by_json_$$DSTMN/site.stanza | mkdef -z -f' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_site_by_json_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_site_by_json +check:rc==0 +end + + +start:xcat_inventory_try_to_export_all_type_is_site_default_format +description:This case is used to test xcat-inventory export all definition which type is site to default file. I.e. json file +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.stanza +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=0 useNFSv4onAIX=0 FQDNfirst=1 SNsyncfiledir='/var/xcat/syncfiles' auditnosyslog=0 auditskipcmds=ALL blademaxp=64 cleanupxcatpost=no consoleondemand=no databaseloc='/var/lib' db2installloc='/mntdb2' dbtracelevel=0 defserialflow=0 defserialport=0 defserialspeed=9600 dhcpinterfaces=eth0 dhcplease=43200 dhcpsetup=n disjointdhcps=1 dnshandler=ddns dnsinterfaces='xcatmn|eth1,eth2;service|bond0' dnsupdaters=dnsupdaters domain='pok.stglabs.ibm.com' enableASMI=no excludenodes=excludenodes externaldns=externaldns extntpservers=extntpservers forwarders=$mnip fsptimeout=0 genmacprefix='00:11:aa' genpasswords=genpasswords hierarchicalattrs=hierarchicalattrs httpport=80 hwctrldispatch=y installdir='/install/' installloc='hostname:/path' ipmidispatch=y ipmimaxp=64 ipmiretries=3 ipmisdrcache=no ipmitimeout=2 iscsidir='/iscsidir' managedaddressmode=dhcp master=$mnip maxssh=8 mnroutenames=mnroutenames nameservers=$mnip nmapoptions='--min-rtt-timeout' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles' ntpservers=$mnip persistkvmguests=y powerinterval=0 ppcmaxp=64 ppcretry=3 ppctimeout=0 precreatemypostscripts=1 pruneservices=1 runbootscripts=yes setinstallnic=1 sharedinstall=no sharedtftp=1 skiptables=nics skipvalidatelog=1 snmpc=snmpc sshbetweennodes=ALLGROUPS svloglocal=1 syspowerinterval=10 syspowermaxnodes=10 tftpdir='/tftprot/' tftpflags='-v' timezone='America/New_York' useNmapfromMN=no useflowcontrol=no usexhrm=no vcenterautojoin=no vmwarereconfigonpower=no vsftp=n xcatconfdir='/etc/xcat' xcatdebugmode=1 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=64 xcatmaxconnections=60 xcatsslciphers='3DES' xcatsslversion=TLSv1 +check:rc==0 +cmd:#!/bin/bash +echo '{ + "schema_version": "1.0", + "site": { + "clustersite": { + "FQDNfirst": "1", + "SNsyncfiledir": "/var/xcat/syncfiles", + "auditnosyslog": "0", + "auditskipcmds": "ALL", + "blademaxp": "64", + "cleanupxcatpost": "no", + "consoleondemand": "no", + "databaseloc": "/var/lib", + "db2installloc": "/mntdb2", + "dbtracelevel": "0", + "defserialflow": "0", + "defserialport": "0", + "defserialspeed": "9600", + "dhcpinterfaces": "eth0", + "dhcplease": "43200", + "dhcpsetup": "n", + "disjointdhcps": "1", + "dnshandler": "ddns", + "dnsinterfaces": "xcatmn|eth1,eth2;service|bond0", + "dnsupdaters": "dnsupdaters", + "domain": "pok.stglabs.ibm.com", + "enableASMI": "no", + "excludenodes": "excludenodes", + "externaldns": "externaldns", + "extntpservers": "extntpservers", + "forwarders": "10.3.5.8", + "fsptimeout": "0", + "genmacprefix": "00:11:aa", + "genpasswords": "genpasswords", + "hierarchicalattrs": "hierarchicalattrs", + "httpport": "80", + "hwctrldispatch": "y", + "installdir": "/install/", + "installloc": "hostname:/path", + "ipmidispatch": "y", + "ipmimaxp": "64", + "ipmiretries": "3", + "ipmisdrcache": "no", + "ipmitimeout": "2", + "iscsidir": "/iscsidir", + "managedaddressmode": "dhcp", + "master": "10.3.5.8", + "maxssh": "8", + "mnroutenames": "mnroutenames", + "nameservers": "10.3.5.8", + "nmapoptions": "--min-rtt-timeout", + "nodestatus": "n", + "nodesyncfiledir": "/var/xcat/node/syncfiles", + "ntpservers": "10.3.5.8", + "persistkvmguests": "y", + "powerinterval": "0", + "ppcmaxp": "64", + "ppcretry": "3", + "ppctimeout": "0", + "precreatemypostscripts": "1", + "pruneservices": "1", + "runbootscripts": "yes", + "setinstallnic": "1", + "sharedinstall": "no", + "sharedtftp": "1", + "skiptables": "nics", + "skipvalidatelog": "1", + "snmpc": "snmpc", + "sshbetweennodes": "ALLGROUPS", + "svloglocal": "1", + "syspowerinterval": "10", + "syspowermaxnodes": "10", + "tftpdir": "/tftprot/", + "tftpflags": "-v", + "timezone": "America/New_York", + "useNFSv4onAIX": "0", + "useNmapfromMN": "no", + "useSSHonAIX": "0", + "useflowcontrol": "no", + "usexhrm": "no", + "vcenterautojoin": "no", + "vmwarereconfigonpower": "no", + "vsftp": "n", + "xcatconfdir": "/etc/xcat", + "xcatdebugmode": "1", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatlport": "3003", + "xcatmaxbatchconnections": "64", + "xcatmaxconnections": "60", + "xcatsslciphers": "3DES", + "xcatsslversion": "TLSv1" + } + } +}' > /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org +check:rc==0 +cmd:xcat-inventory export -t site |tee /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.export +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.export +check:rc==0 +cmd:cat /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.stanza | mkdef -z -f +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format +check:rc==0 +end + +start:xcat_inventory_try_to_export_all_type_is_site_json_format +description:This case is used to test xcat-inventory export all definition which type is site to default file. I.e. json file +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.stanza +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=0 useNFSv4onAIX=0 FQDNfirst=1 SNsyncfiledir='/var/xcat/syncfiles' auditnosyslog=0 auditskipcmds=ALL blademaxp=64 cleanupxcatpost=no consoleondemand=no databaseloc='/var/lib' db2installloc='/mntdb2' dbtracelevel=0 defserialflow=0 defserialport=0 defserialspeed=9600 dhcpinterfaces=eth0 dhcplease=43200 dhcpsetup=n disjointdhcps=1 dnshandler=ddns dnsinterfaces='xcatmn|eth1,eth2;service|bond0' dnsupdaters=dnsupdaters domain='pok.stglabs.ibm.com' enableASMI=no excludenodes=excludenodes externaldns=externaldns extntpservers=extntpservers forwarders=$mnip fsptimeout=0 genmacprefix='00:11:aa' genpasswords=genpasswords hierarchicalattrs=hierarchicalattrs httpport=80 hwctrldispatch=y installdir='/install/' installloc='hostname:/path' ipmidispatch=y ipmimaxp=64 ipmiretries=3 ipmisdrcache=no ipmitimeout=2 iscsidir='/iscsidir' managedaddressmode=dhcp master=$mnip maxssh=8 mnroutenames=mnroutenames nameservers=$mnip nmapoptions='--min-rtt-timeout' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles' ntpservers=$mnip persistkvmguests=y powerinterval=0 ppcmaxp=64 ppcretry=3 ppctimeout=0 precreatemypostscripts=1 pruneservices=1 runbootscripts=yes setinstallnic=1 sharedinstall=no sharedtftp=1 skiptables=nics skipvalidatelog=1 snmpc=snmpc sshbetweennodes=ALLGROUPS svloglocal=1 syspowerinterval=10 syspowermaxnodes=10 tftpdir='/tftprot/' tftpflags='-v' timezone='America/New_York' useNmapfromMN=no useflowcontrol=no usexhrm=no vcenterautojoin=no vmwarereconfigonpower=no vsftp=n xcatconfdir='/etc/xcat' xcatdebugmode=1 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=64 xcatmaxconnections=60 xcatsslciphers='3DES' xcatsslversion=TLSv1 +check:rc==0 +cmd:#!/bin/bash +echo '{ + "schema_version": "1.0", + "site": { + "clustersite": { + "FQDNfirst": "1", + "SNsyncfiledir": "/var/xcat/syncfiles", + "auditnosyslog": "0", + "auditskipcmds": "ALL", + "blademaxp": "64", + "cleanupxcatpost": "no", + "consoleondemand": "no", + "databaseloc": "/var/lib", + "db2installloc": "/mntdb2", + "dbtracelevel": "0", + "defserialflow": "0", + "defserialport": "0", + "defserialspeed": "9600", + "dhcpinterfaces": "eth0", + "dhcplease": "43200", + "dhcpsetup": "n", + "disjointdhcps": "1", + "dnshandler": "ddns", + "dnsinterfaces": "xcatmn|eth1,eth2;service|bond0", + "dnsupdaters": "dnsupdaters", + "domain": "pok.stglabs.ibm.com", + "enableASMI": "no", + "excludenodes": "excludenodes", + "externaldns": "externaldns", + "extntpservers": "extntpservers", + "forwarders": "10.3.5.8", + "fsptimeout": "0", + "genmacprefix": "00:11:aa", + "genpasswords": "genpasswords", + "hierarchicalattrs": "hierarchicalattrs", + "httpport": "80", + "hwctrldispatch": "y", + "installdir": "/install/", + "installloc": "hostname:/path", + "ipmidispatch": "y", + "ipmimaxp": "64", + "ipmiretries": "3", + "ipmisdrcache": "no", + "ipmitimeout": "2", + "iscsidir": "/iscsidir", + "managedaddressmode": "dhcp", + "master": "10.3.5.8", + "maxssh": "8", + "mnroutenames": "mnroutenames", + "nameservers": "10.3.5.8", + "nmapoptions": "--min-rtt-timeout", + "nodestatus": "n", + "nodesyncfiledir": "/var/xcat/node/syncfiles", + "ntpservers": "10.3.5.8", + "persistkvmguests": "y", + "powerinterval": "0", + "ppcmaxp": "64", + "ppcretry": "3", + "ppctimeout": "0", + "precreatemypostscripts": "1", + "pruneservices": "1", + "runbootscripts": "yes", + "setinstallnic": "1", + "sharedinstall": "no", + "sharedtftp": "1", + "skiptables": "nics", + "skipvalidatelog": "1", + "snmpc": "snmpc", + "sshbetweennodes": "ALLGROUPS", + "svloglocal": "1", + "syspowerinterval": "10", + "syspowermaxnodes": "10", + "tftpdir": "/tftprot/", + "tftpflags": "-v", + "timezone": "America/New_York", + "useNFSv4onAIX": "0", + "useNmapfromMN": "no", + "useSSHonAIX": "0", + "useflowcontrol": "no", + "usexhrm": "no", + "vcenterautojoin": "no", + "vmwarereconfigonpower": "no", + "vsftp": "n", + "xcatconfdir": "/etc/xcat", + "xcatdebugmode": "1", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatlport": "3003", + "xcatmaxbatchconnections": "64", + "xcatmaxconnections": "60", + "xcatsslciphers": "3DES", + "xcatsslversion": "TLSv1" + } + } +}' > /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.org +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.org +check:rc==0 +cmd:xcat-inventory export --format=json -t site |tee /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.export +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.export +check:rc==0 +cmd:cat /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.stanza | mkdef -z -f +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format +check:rc==0 +end + +start:xcat_inventory_try_to_export_all_type_is_site_yaml_format +description:This case is used to test xcat-inventory export all definition which type is site to default file. I.e. json file +cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.stanza +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=0 useNFSv4onAIX=0 FQDNfirst=1 SNsyncfiledir='/var/xcat/syncfiles' auditnosyslog=0 auditskipcmds=ALL blademaxp=64 cleanupxcatpost=no consoleondemand=no databaseloc='/var/lib' db2installloc='/mntdb2' dbtracelevel=0 defserialflow=0 defserialport=0 defserialspeed=9600 dhcpinterfaces=eth0 dhcplease=43200 dhcpsetup=n disjointdhcps=1 dnshandler=ddns dnsinterfaces='xcatmn|eth1,eth2;service|bond0' dnsupdaters=dnsupdaters domain='pok.stglabs.ibm.com' enableASMI=no excludenodes=excludenodes externaldns=externaldns extntpservers=extntpservers forwarders=$mnip fsptimeout=0 genmacprefix='00:11:aa' genpasswords=genpasswords hierarchicalattrs=hierarchicalattrs httpport=80 hwctrldispatch=y installdir='/install/' installloc='hostname:/path' ipmidispatch=y ipmimaxp=64 ipmiretries=3 ipmisdrcache=no ipmitimeout=2 iscsidir='/iscsidir' managedaddressmode=dhcp master=$mnip maxssh=8 mnroutenames=mnroutenames nameservers=$mnip nmapoptions='--min-rtt-timeout' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles' ntpservers=$mnip persistkvmguests=y powerinterval=0 ppcmaxp=64 ppcretry=3 ppctimeout=0 precreatemypostscripts=1 pruneservices=1 runbootscripts=yes setinstallnic=1 sharedinstall=no sharedtftp=1 skiptables=nics skipvalidatelog=1 snmpc=snmpc sshbetweennodes=ALLGROUPS svloglocal=1 syspowerinterval=10 syspowermaxnodes=10 tftpdir='/tftprot/' tftpflags='-v' timezone='America/New_York' useNmapfromMN=no useflowcontrol=no usexhrm=no vcenterautojoin=no vmwarereconfigonpower=no vsftp=n xcatconfdir='/etc/xcat' xcatdebugmode=1 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=64 xcatmaxconnections=60 xcatsslciphers='3DES' xcatsslversion=TLSv1 +check:rc==0 +cmd:#!/bin/bash +echo "schema_version: '1.0' +site: + clustersite: + FQDNfirst: '1' + SNsyncfiledir: /var/xcat/syncfiles + auditnosyslog: '0' + auditskipcmds: ALL + blademaxp: '64' + cleanupxcatpost: 'no' + consoleondemand: 'no' + databaseloc: /var/lib + db2installloc: /mntdb2 + dbtracelevel: '0' + defserialflow: '0' + defserialport: '0' + defserialspeed: '9600' + dhcpinterfaces: eth0 + dhcplease: '43200' + dhcpsetup: n + disjointdhcps: '1' + dnshandler: ddns + dnsinterfaces: xcatmn|eth1,eth2;service|bond0 + dnsupdaters: dnsupdaters + domain: pok.stglabs.ibm.com + enableASMI: 'no' + excludenodes: excludenodes + externaldns: externaldns + extntpservers: extntpservers + forwarders: 10.3.5.8 + fsptimeout: '0' + genmacprefix: 00:11:aa + genpasswords: genpasswords + hierarchicalattrs: hierarchicalattrs + httpport: '80' + hwctrldispatch: y + installdir: /install/ + installloc: hostname:/path + ipmidispatch: y + ipmimaxp: '64' + ipmiretries: '3' + ipmisdrcache: 'no' + ipmitimeout: '2' + iscsidir: /iscsidir + managedaddressmode: dhcp + master: 10.3.5.8 + maxssh: '8' + mnroutenames: mnroutenames + nameservers: 10.3.5.8 + nmapoptions: --min-rtt-timeout + nodestatus: n + nodesyncfiledir: /var/xcat/node/syncfiles + ntpservers: 10.3.5.8 + persistkvmguests: y + powerinterval: '0' + ppcmaxp: '64' + ppcretry: '3' + ppctimeout: '0' + precreatemypostscripts: '1' + pruneservices: '1' + runbootscripts: 'yes' + setinstallnic: '1' + sharedinstall: 'no' + sharedtftp: '1' + skiptables: nics + skipvalidatelog: '1' + snmpc: snmpc + sshbetweennodes: ALLGROUPS + svloglocal: '1' + syspowerinterval: '10' + syspowermaxnodes: '10' + tftpdir: /tftprot/ + tftpflags: -v + timezone: America/New_York + useNFSv4onAIX: '0' + useNmapfromMN: 'no' + useSSHonAIX: '0' + useflowcontrol: 'no' + usexhrm: 'no' + vcenterautojoin: 'no' + vmwarereconfigonpower: 'no' + vsftp: n + xcatconfdir: /etc/xcat + xcatdebugmode: '1' + xcatdport: '3001' + xcatiport: '3002' + xcatlport: '3003' + xcatmaxbatchconnections: '64' + xcatmaxconnections: '60' + xcatsslciphers: 3DES + xcatsslversion: TLSv1" > /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.org +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.org +check:rc==0 +cmd:xcat-inventory export --format=yaml -t site|sed -e '/^\s*$/d' |tee /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.export +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.export +check:rc==0 +cmd:cat /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.stanza | mkdef -z -f +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format +check:rc==0 +end + + +start:xcat_inventory_try_to_import_all_type_is_site_json_format +description:This case is used to test xcat-inventory impport all definition which type is site from json file. +cmd:mkdir -p /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.stanza +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:#!/usr/bin/bash +echo '{ + "network": { + "100_0_0_0-255_0_0_0": { + "basic_attr": { + "gateway": "100.0.0.103", + "mask": "255.0.0.0", + "mgtifname": "eth0", + "mtu": "1500", + "net": "100.0.0.0" + }, + "schema_version": 1.0, + "service": { + "tftpserver": "" + } + } + }, + "node": { + "bogusnode1": { + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "cons": "openbmc" + }, + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.3.11.101", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + }, + "power_mgt_engine": { + "engine_type": "openbmc" + } + }, + "network_info": { + "primarynic": { + "ip": "10.100.100.1" + } + }, + "obj_info": { + "groups": "testgroup" + }, + "obj_type": "node", + "role": "compute", + "schema_version": 1.0 + }, + "bogusnode2": { + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "cons": "openbmc" + }, + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.3.11.102", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + }, + "power_mgt_engine": { + "engine_type": "openbmc" + } + }, + "network_info": { + "primarynic": { + "ip": "10.100.100.2" + } + }, + "obj_info": { + "groups": "testgroup" + }, + "obj_type": "node", + "role": "compute", + "schema_version": 1.0 + }, + "bogusnode3": { + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "cons": "openbmc" + }, + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.3.11.103", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + }, + "power_mgt_engine": { + "engine_type": "openbmc" + } + }, + "network_info": { + "primarynic": { + "ip": "10.100.100.3" + } + }, + "obj_info": { + "groups": "testgroup" + }, + "obj_type": "node", + "role": "compute", + "schema_version": 1.0 + }, + "service": { + "device_type": "server", + "engines": { + "netboot_engine": { + "engine_info": { + "postscripts": "servicenode" + } + } + }, + "obj_type": "group", + "role": "compute", + "schema_version": 1.0 + }, + "xcatdefaults": { + "device_type": "server", + "engines": { + "netboot_engine": { + "engine_info": { + "postbootscripts": "otherpkgs", + "postscripts": "syslog,remoteshell,syncfiles" + } + } + }, + "obj_type": "group", + "role": "compute", + "schema_version": 1.0 + } + }, + "osimage": {}, + "passwd": {}, + "policy": { + "1": { + "name": "root", + "rule": "allow", + "schema_version": 1.0 + }, + "1.2": { + "name": "c910f03c05k08.pok.stglabs.ibm.com", + "rule": "trusted", + "schema_version": 1.0 + }, + "2": { + "commands": "getbmcconfig", + "rule": "allow", + "schema_version": 1.0 + }, + "2.1": { + "commands": "remoteimmsetup", + "rule": "allow", + "schema_version": 1.0 + }, + "2.3": { + "commands": "lsxcatd", + "rule": "allow", + "schema_version": 1.0 + }, + "3": { + "commands": "nextdestiny", + "rule": "allow", + "schema_version": 1.0 + }, + "4": { + "commands": "getdestiny", + "rule": "allow", + "schema_version": 1.0 + }, + "4.4": { + "commands": "getpostscript", + "rule": "allow", + "schema_version": 1.0 + }, + "4.5": { + "commands": "getcredentials", + "rule": "allow", + "schema_version": 1.0 + }, + "4.6": { + "commands": "syncfiles", + "rule": "allow", + "schema_version": 1.0 + }, + "4.7": { + "commands": "litefile", + "rule": "allow", + "schema_version": 1.0 + }, + "4.8": { + "commands": "litetree", + "rule": "allow", + "schema_version": 1.0 + }, + "4.9": { + "commands": "getadapter", + "rule": "allow", + "schema_version": 1.0 + } + }, + "route": {}, + "site": { + "clustersite": { + "FQDNfirst": "1", + "SNsyncfiledir": "/var/xcat/syncfiles", + "auditnosyslog": "0", + "auditskipcmds": "ALL", + "blademaxp": "64", + "cleanupxcatpost": "no", + "consoleondemand": "no", + "databaseloc": "/var/lib", + "db2installloc": "/mntdb2", + "dbtracelevel": "0", + "defserialflow": "0", + "defserialport": "0", + "defserialspeed": "9600", + "dhcpinterfaces": "eth0", + "dhcplease": "43200", + "dhcpsetup": "n", + "disjointdhcps": "1", + "dnshandler": "ddns", + "dnsinterfaces": "xcatmn|eth1,eth2;service|bond0", + "dnsupdaters": "dnsupdaters", + "domain": "pok.stglabs.ibm.com", + "enableASMI": "no", + "excludenodes": "excludenodes", + "externaldns": "externaldns", + "extntpservers": "extntpservers", + "forwarders": "10.3.5.8", + "fsptimeout": "0", + "genmacprefix": "00:11:aa", + "genpasswords": "genpasswords", + "hierarchicalattrs": "hierarchicalattrs", + "httpport": "80", + "hwctrldispatch": "y", + "installdir": "/install/", + "installloc": "hostname:/path", + "ipmidispatch": "y", + "ipmimaxp": "64", + "ipmiretries": "3", + "ipmisdrcache": "no", + "ipmitimeout": "2", + "iscsidir": "/iscsidir", + "managedaddressmode": "dhcp", + "master": "10.3.5.8", + "maxssh": "8", + "mnroutenames": "mnroutenames", + "nameservers": "10.3.5.8", + "nmapoptions": "--min-rtt-timeout", + "nodestatus": "n", + "nodesyncfiledir": "/var/xcat/node/syncfiles", + "ntpservers": "10.3.5.8", + "persistkvmguests": "y", + "powerinterval": "0", + "ppcmaxp": "64", + "ppcretry": "3", + "ppctimeout": "0", + "precreatemypostscripts": "1", + "pruneservices": "1", + "runbootscripts": "yes", + "schema_version": 1.0, + "setinstallnic": "1", + "sharedinstall": "no", + "sharedtftp": "1", + "skiptables": "nics", + "skipvalidatelog": "1", + "snmpc": "snmpc", + "sshbetweennodes": "ALLGROUPS", + "svloglocal": "1", + "syspowerinterval": "10", + "syspowermaxnodes": "10", + "tftpdir": "/tftprot/", + "tftpflags": "-v", + "timezone": "America/New_York", + "useNFSv4onAIX": "0", + "useNmapfromMN": "no", + "useSSHonAIX": "0", + "useflowcontrol": "no", + "usexhrm": "no", + "vcenterautojoin": "no", + "vmwarereconfigonpower": "no", + "vsftp": "n", + "xcatconfdir": "/etc/xcat", + "xcatdebugmode": "1", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatlport": "3003", + "xcatmaxbatchconnections": "64", + "xcatmaxconnections": "60", + "xcatsslciphers": "3DES", + "xcatsslversion": "TLSv1" + } + } +}' > /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/json.test +check:rc==0 +cmd:#!/bin/bash +echo "Object name: clustersite + FQDNfirst=1 + SNsyncfiledir=/var/xcat/syncfiles + auditnosyslog=0 + auditskipcmds=ALL + blademaxp=64 + cleanupxcatpost=no + consoleondemand=no + databaseloc=/var/lib + db2installloc=/mntdb2 + dbtracelevel=0 + defserialflow=0 + defserialport=0 + defserialspeed=9600 + dhcpinterfaces=eth0 + dhcplease=43200 + dhcpsetup=n + disjointdhcps=1 + dnshandler=ddns + dnsinterfaces=xcatmn|eth1,eth2;service|bond0 + dnsupdaters=dnsupdaters + domain=pok.stglabs.ibm.com + enableASMI=no + excludenodes=excludenodes + externaldns=externaldns + extntpservers=extntpservers + forwarders=10.3.5.8 + fsptimeout=0 + genmacprefix=00:11:aa + genpasswords=genpasswords + hierarchicalattrs=hierarchicalattrs + httpport=80 + hwctrldispatch=y + installdir=/install/ + installloc=hostname:/path + ipmidispatch=y + ipmimaxp=64 + ipmiretries=3 + ipmisdrcache=no + ipmitimeout=2 + iscsidir=/iscsidir + managedaddressmode=dhcp + master=10.3.5.8 + maxssh=8 + mnroutenames=mnroutenames + nameservers=10.3.5.8 + nmapoptions=--min-rtt-timeout + nodestatus=n + nodesyncfiledir=/var/xcat/node/syncfiles + ntpservers=10.3.5.8 + persistkvmguests=y + powerinterval=0 + ppcmaxp=64 + ppcretry=3 + ppctimeout=0 + precreatemypostscripts=1 + pruneservices=1 + runbootscripts=yes + setinstallnic=1 + sharedinstall=no + sharedtftp=1 + skiptables=nics + skipvalidatelog=1 + snmpc=snmpc + sshbetweennodes=ALLGROUPS + svloglocal=1 + syspowerinterval=10 + syspowermaxnodes=10 + tftpdir=/tftprot/ + tftpflags=-v + timezone=America/New_York + useNFSv4onAIX=0 + useNmapfromMN=no + useSSHonAIX=0 + useflowcontrol=no + usexhrm=no + vcenterautojoin=no + vmwarereconfigonpower=no + vsftp=n + xcatconfdir=/etc/xcat + xcatdebugmode=1 + xcatdport=3001 + xcatiport=3002 + xcatlport=3003 + xcatmaxbatchconnections=64 + xcatmaxconnections=60 + xcatsslciphers=3DES + xcatsslversion=TLSv1"> /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.org +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.org +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/json.test +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/json.test -t site +check:rc==0 +cmd:lsdef -t site -o clustersite > /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.import +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.org /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.import +check:rc==0 +cmd:lsdef bogusgroup1 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:lsdef bogusgroup2 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:lsdef bogusgroup3 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:tabdump networks|grep 100_0_0_0-255_0_0_0 +check:rc!=0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/bogusgroup.stanza ]];then cat /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:cat /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.stanza | mkdef -z -f +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format +check:rc==0 +end + +start:xcat_inventory_try_to_import_all_type_is_site_yaml_format +description:This case is used to test xcat-inventory impport all definition which type is site from json file. +cmd:mkdir -p /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.stanza +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/bogusnode.stanza ;rmdef bogusnode$i;fi;done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z >> /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/bogusnode.stanza;rmdef -t group bogusgroup; fi +check:rc==0 +cmd:#!/usr/bin/bash +echo "network: + 100_0_0_0-255_0_0_0: + basic_attr: + gateway: 100.0.0.103 + mask: 255.0.0.0 + mgtifname: eth0 + mtu: '1500' + net: 100.0.0.0 + schema_version: 1.0 + service: + tftpserver: +node: + bogusnode1: + device_type: server + engines: + console_engine: + engine_info: + cons: openbmc + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.3.11.101 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot + power_mgt_engine: + engine_type: openbmc + network_info: + primarynic: + ip: 10.100.100.1 + obj_info: + groups: testgroup + obj_type: node + role: compute + schema_version: 1.0 + bogusnode2: + device_type: server + engines: + console_engine: + engine_info: + cons: openbmc + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.3.11.102 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot + power_mgt_engine: + engine_type: openbmc + network_info: + primarynic: + ip: 10.100.100.2 + obj_info: + groups: testgroup + obj_type: node + role: compute + schema_version: 1.0 + bogusnode3: + device_type: server + engines: + console_engine: + engine_info: + cons: openbmc + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.3.11.103 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot + power_mgt_engine: + engine_type: openbmc + network_info: + primarynic: + ip: 10.100.100.3 + obj_info: + groups: testgroup + obj_type: node + role: compute + schema_version: 1.0 + service: + device_type: server + engines: + netboot_engine: + engine_info: + postscripts: servicenode + obj_type: group + role: compute + schema_version: 1.0 + xcatdefaults: + device_type: server + engines: + netboot_engine: + engine_info: + postbootscripts: otherpkgs + postscripts: syslog,remoteshell,syncfiles + obj_type: group + role: compute + schema_version: 1.0 +osimage: {} +passwd: {} +policy: + '1': + name: root + rule: allow + schema_version: 1.0 + '1.2': + name: c910f03c05k08.pok.stglabs.ibm.com + rule: trusted + schema_version: 1.0 + '2': + commands: getbmcconfig + rule: allow + schema_version: 1.0 + '2.1': + commands: remoteimmsetup + rule: allow + schema_version: 1.0 + '2.3': + commands: lsxcatd + rule: allow + schema_version: 1.0 + '3': + commands: nextdestiny + rule: allow + schema_version: 1.0 + '4': + commands: getdestiny + rule: allow + schema_version: 1.0 + '4.4': + commands: getpostscript + rule: allow + schema_version: 1.0 + '4.5': + commands: getcredentials + rule: allow + schema_version: 1.0 + '4.6': + commands: syncfiles + rule: allow + schema_version: 1.0 + '4.7': + commands: litefile + rule: allow + schema_version: 1.0 + '4.8': + commands: litetree + rule: allow + schema_version: 1.0 + '4.9': + commands: getadapter + rule: allow + schema_version: 1.0 +route: {} +site: + clustersite: + FQDNfirst: '1' + SNsyncfiledir: /var/xcat/syncfiles + auditnosyslog: '0' + auditskipcmds: ALL + blademaxp: '64' + cleanupxcatpost: 'no' + consoleondemand: 'no' + databaseloc: /var/lib + db2installloc: /mntdb2 + dbtracelevel: '0' + defserialflow: '0' + defserialport: '0' + defserialspeed: '9600' + dhcpinterfaces: eth0 + dhcplease: '43200' + dhcpsetup: n + disjointdhcps: '1' + dnshandler: ddns + dnsinterfaces: xcatmn|eth1,eth2;service|bond0 + dnsupdaters: dnsupdaters + domain: pok.stglabs.ibm.com + enableASMI: 'no' + excludenodes: excludenodes + externaldns: externaldns + extntpservers: extntpservers + forwarders: 10.3.5.8 + fsptimeout: '0' + genmacprefix: 00:11:aa + genpasswords: genpasswords + hierarchicalattrs: hierarchicalattrs + httpport: '80' + hwctrldispatch: y + installdir: /install/ + installloc: hostname:/path + ipmidispatch: y + ipmimaxp: '64' + ipmiretries: '3' + ipmisdrcache: 'no' + ipmitimeout: '2' + iscsidir: /iscsidir + managedaddressmode: dhcp + master: 10.3.5.8 + maxssh: '8' + mnroutenames: mnroutenames + nameservers: 10.3.5.8 + nmapoptions: --min-rtt-timeout + nodestatus: n + nodesyncfiledir: /var/xcat/node/syncfiles + ntpservers: 10.3.5.8 + persistkvmguests: y + powerinterval: '0' + ppcmaxp: '64' + ppcretry: '3' + ppctimeout: '0' + precreatemypostscripts: '1' + pruneservices: '1' + runbootscripts: 'yes' + schema_version: 1.0 + setinstallnic: '1' + sharedinstall: 'no' + sharedtftp: '1' + skiptables: nics + skipvalidatelog: '1' + snmpc: snmpc + sshbetweennodes: ALLGROUPS + svloglocal: '1' + syspowerinterval: '10' + syspowermaxnodes: '10' + tftpdir: /tftprot/ + tftpflags: -v + timezone: America/New_York + useNFSv4onAIX: '0' + useNmapfromMN: 'no' + useSSHonAIX: '0' + useflowcontrol: 'no' + usexhrm: 'no' + vcenterautojoin: 'no' + vmwarereconfigonpower: 'no' + vsftp: n + xcatconfdir: /etc/xcat + xcatdebugmode: '1' + xcatdport: '3001' + xcatiport: '3002' + xcatlport: '3003' + xcatmaxbatchconnections: '64' + xcatmaxconnections: '60' + xcatsslciphers: 3DES + xcatsslversion: TLSv1" > /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/yaml.test +check:rc==0 +cmd:#!/bin/bash +echo "Object name: clustersite + FQDNfirst=1 + SNsyncfiledir=/var/xcat/syncfiles + auditnosyslog=0 + auditskipcmds=ALL + blademaxp=64 + cleanupxcatpost=no + consoleondemand=no + databaseloc=/var/lib + db2installloc=/mntdb2 + dbtracelevel=0 + defserialflow=0 + defserialport=0 + defserialspeed=9600 + dhcpinterfaces=eth0 + dhcplease=43200 + dhcpsetup=n + disjointdhcps=1 + dnshandler=ddns + dnsinterfaces=xcatmn|eth1,eth2;service|bond0 + dnsupdaters=dnsupdaters + domain=pok.stglabs.ibm.com + enableASMI=no + excludenodes=excludenodes + externaldns=externaldns + extntpservers=extntpservers + forwarders=10.3.5.8 + fsptimeout=0 + genmacprefix=00:11:aa + genpasswords=genpasswords + hierarchicalattrs=hierarchicalattrs + httpport=80 + hwctrldispatch=y + installdir=/install/ + installloc=hostname:/path + ipmidispatch=y + ipmimaxp=64 + ipmiretries=3 + ipmisdrcache=no + ipmitimeout=2 + iscsidir=/iscsidir + managedaddressmode=dhcp + master=10.3.5.8 + maxssh=8 + mnroutenames=mnroutenames + nameservers=10.3.5.8 + nmapoptions=--min-rtt-timeout + nodestatus=n + nodesyncfiledir=/var/xcat/node/syncfiles + ntpservers=10.3.5.8 + persistkvmguests=y + powerinterval=0 + ppcmaxp=64 + ppcretry=3 + ppctimeout=0 + precreatemypostscripts=1 + pruneservices=1 + runbootscripts=yes + setinstallnic=1 + sharedinstall=no + sharedtftp=1 + skiptables=nics + skipvalidatelog=1 + snmpc=snmpc + sshbetweennodes=ALLGROUPS + svloglocal=1 + syspowerinterval=10 + syspowermaxnodes=10 + tftpdir=/tftprot/ + tftpflags=-v + timezone=America/New_York + useNFSv4onAIX=0 + useNmapfromMN=no + useSSHonAIX=0 + useflowcontrol=no + usexhrm=no + vcenterautojoin=no + vmwarereconfigonpower=no + vsftp=n + xcatconfdir=/etc/xcat + xcatdebugmode=1 + xcatdport=3001 + xcatiport=3002 + xcatlport=3003 + xcatmaxbatchconnections=64 + xcatmaxconnections=60 + xcatsslciphers=3DES + xcatsslversion=TLSv1"> /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.org +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.org +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/yaml.test +check:rc==0 +cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/yaml.test -t site +check:rc==0 +cmd:lsdef -t site -o clustersite > /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.import +check:rc==0 +cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.org /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.import +check:rc==0 +cmd:lsdef bogusgroup1 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:lsdef bogusgroup2 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:lsdef bogusgroup3 +check:output=~Error: Could not find an object +check:rc!=0 +cmd:tabdump networks|grep 100_0_0_0-255_0_0_0 +check:rc!=0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/bogusgroup.stanza ]];then cat /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:cat /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.stanza | mkdef -z -f +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format +check:rc==0 +end + + +start:export_site_table_then_modify_yaml_then_import +This case is used to test xcat-inventory import a site , then modify the export yaml file, then import the yaml file +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_site_table_then_modify_yaml_then_import +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/' +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_yaml_then_import/site.stanza +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/site.stanza ' +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 cleanupxcatpost=1111 consoleondemand=1111 databaseloc='/var/lib1111' db2installloc='/mntdb1111' dbtracelevel=1111 defserialflow=1111 defserialport=1111 defserialspeed=9611111111 dhcpinterfaces=eth1111 dhcplease=43211111111 dhcpsetup=1111 disjointdhcps=1111 dnshandler=ddns1111 dnsinterfaces='xcatmn|eth1,eth2;service|bond1111' dnsupdaters=dnsupdaters1111 domain='pok1111.stglabs.ibm.com' enableASMI=1111 excludenodes=1111 externaldns=1111 extntpservers=1111 forwarders=$mnip fsptimeout=1111 genmacprefix='11111111:11:aa' genpasswords=1111 hierarchicalattrs=1111 httpport=81111 hwctrldispatch=1111 installdir='/install1111/' installloc='hostname:/path1111' ipmidispatch=1111 ipmimaxp=641111 ipmiretries=31111 ipmisdrcache=1111 ipmitimeout=21111 iscsidir='/iscsidir1111' managedaddressmode=dhcp1111 master=$mnip maxssh=81111 mnroutenames=1111 nameservers=$mnip nmapoptions='--min-rtt-timeout 1111' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles1111' ntpservers=$mnip persistkvmguests=1111 powerinterval=1111 ppcmaxp=641111 ppcretry=31111 ppctimeout=1111 precreatemypostchdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 pruneservices=1111 runbootscripts=1111 setinstallnic=1111 sharedinstall=1111 sharedtftp=1111 skiptables=nics1111 skipvalidatelog=1111 snmpc=xc1111 sshbetweennodes=ALLGROUPS1111 svloglocal=1111 syspowerinterval=11111 syspowermaxnodes=11111 tftpdir='/tftprot1111/' tftpflags='-v1111' timezone='America/New_York1111' useNmapfromMN=1111 useflowcontrol=1111 usexhrm=1111 vcenterautojoin=1111 vmwarereconfigonpower=1111 vsftp=1111 xcatconfdir='/etc/xcat1111' xcatdebugmode=1111 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=641111 xcatmaxconnections=61111 xcatsslciphers='3DES' xcatsslversion=TLSv1 +check:rc==0 +cmd:lsdef -t site -o clustersite -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza +check:rc==0 +cmd:xcat-inventory export --format=yaml -t site -o clustersite |tee /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$mnip/$$DSTMN/g" /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 +cmd:cat /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 +cmd:scp /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv $$DSTMN:/tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/ +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/export_site_yaml.inv -t site -o clustersite' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t site -o clustersite -z |sort -t'=' -k1|tee /tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/dstsite.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/dstsite.stanza /tmp/export_site_table_then_modify_yaml_then_import/dstsite.stanza +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$$DSTMN/$mnip/g" /tmp/export_site_table_then_modify_yaml_then_import/dstsite.stanza +check:rc==0 +cmd: cat /tmp/export_site_table_then_modify_yaml_then_import/dstsite.stanza +check:rc==0 +cmd:diff -y /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza /tmp/export_site_table_then_modify_yaml_then_import/dstsite.stanza +check:rc==0 +cmd:cat /tmp/export_site_table_then_modify_yaml_then_import/site.stanza | mkdef -z -f +check:rc==0 +cmd:ssh $$DSTMN 'cat /tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/site.stanza | mkdef -z -f' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_site_table_then_modify_yaml_then_import +check:rc==0 +end + +start:export_site_table_then_modify_json_then_import +This case is used to test xcat-inventory import a site , then modify the export json file, then import the json file +Attribute: $$DSTMN - the ip of MN which is used to run import operation. +cmd:mkdir -p /tmp/export_site_table_then_modify_json_then_import +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_site_table_then_modify_json_then_import_$$DSTMN/' +check:rc==0 +cmd: lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_json_then_import/site.stanza +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_json_then_import_$$DSTMN/site.stanza ' +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 cleanupxcatpost=1111 consoleondemand=1111 databaseloc='/var/lib1111' db2installloc='/mntdb1111' dbtracelevel=1111 defserialflow=1111 defserialport=1111 defserialspeed=9611111111 dhcpinterfaces=eth1111 dhcplease=43211111111 dhcpsetup=1111 disjointdhcps=1111 dnshandler=ddns1111 dnsinterfaces='xcatmn|eth1,eth2;service|bond1111' dnsupdaters=dnsupdaters1111 domain='pok1111.stglabs.ibm.com' enableASMI=1111 excludenodes=1111 externaldns=1111 extntpservers=1111 forwarders=$mnip fsptimeout=1111 genmacprefix='11111111:11:aa' genpasswords=1111 hierarchicalattrs=1111 httpport=81111 hwctrldispatch=1111 installdir='/install1111/' installloc='hostname:/path1111' ipmidispatch=1111 ipmimaxp=641111 ipmiretries=31111 ipmisdrcache=1111 ipmitimeout=21111 iscsidir='/iscsidir1111' managedaddressmode=dhcp1111 master=$mnip maxssh=81111 mnroutenames=1111 nameservers=$mnip nmapoptions='--min-rtt-timeout 1111' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles1111' ntpservers=$mnip persistkvmguests=1111 powerinterval=1111 ppcmaxp=641111 ppcretry=31111 ppctimeout=1111 precreatemypostchdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 pruneservices=1111 runbootscripts=1111 setinstallnic=1111 sharedinstall=1111 sharedtftp=1111 skiptables=nics1111 skipvalidatelog=1111 snmpc=xc1111 sshbetweennodes=ALLGROUPS1111 svloglocal=1111 syspowerinterval=11111 syspowermaxnodes=11111 tftpdir='/tftprot1111/' tftpflags='-v1111' timezone='America/New_York1111' useNmapfromMN=1111 useflowcontrol=1111 usexhrm=1111 vcenterautojoin=1111 vmwarereconfigonpower=1111 vsftp=1111 xcatconfdir='/etc/xcat1111' xcatdebugmode=1111 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=641111 xcatmaxconnections=61111 xcatsslciphers='3DES' xcatsslversion=TLSv1 +check:rc==0 +cmd:lsdef -t site -o clustersite -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza +check:rc==0 +cmd:xcat-inventory export --format=json -t site -o clustersite |tee /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$mnip/$$DSTMN/g" /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 +cmd:cat /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 +cmd:scp /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv $$DSTMN:/tmp/export_site_table_then_modify_json_then_import_$$DSTMN/ +check:rc==0 +cmd: ssh $$DSTMN 'xcat-inventory import -f /tmp/export_site_table_then_modify_json_then_import_$$DSTMN/export_site_json.inv -t site -o clustersite' +check:rc==0 +cmd: ssh $$DSTMN 'lsdef -t site -o clustersite -z |sort -t'=' -k1|tee /tmp/export_site_table_then_modify_json_then_import_$$DSTMN/dstsite.stanza' +check:rc==0 +cmd: scp $$DSTMN:/tmp/export_site_table_then_modify_json_then_import_$$DSTMN/dstsite.stanza /tmp/export_site_table_then_modify_json_then_import/dstsite.stanza +check:rc==0 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$$DSTMN/$mnip/g" /tmp/export_site_table_then_modify_json_then_import/dstsite.stanza +check:rc==0 +cmd: cat /tmp/export_site_table_then_modify_json_then_import/dstsite.stanza +check:rc==0 +cmd:diff -y /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza /tmp/export_site_table_then_modify_json_then_import/dstsite.stanza +check:rc==0 +cmd:cat /tmp/export_site_table_then_modify_json_then_import/site.stanza | mkdef -z -f +check:rc==0 +cmd:ssh $$DSTMN 'cat /tmp/export_site_table_then_modify_json_then_import_$$DSTMN/site.stanza | mkdef -z -f' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_site_table_then_modify_json_then_import_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_site_table_then_modify_json_then_import +check:rc==0 +end + + From 8491449266a8bbac581d88d835f2221b5ba1fc8e Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Mar 2018 10:26:20 -0500 Subject: [PATCH 002/161] [DO NOT MERGE} OpenBMC reventlog clear in Python --- .../agent/hwctl/executor/openbmc_eventlog.py | 9 +++++++++ .../lib/python/agent/hwctl/openbmc_client.py | 19 +++++++++++++++++-- .../lib/python/agent/xcatagent/openbmc.py | 1 - 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py index 243b469f7..f582270e5 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py @@ -56,6 +56,15 @@ class OpenBMCEventlogTask(ParallelNodesCommand): def clear_all_ev_records(self, **kw): node = kw['node'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, debugmode=self.debugmode, verbose=self.verbose) + try: + obmc.login() + obmc.clear_all_eventlog_records() + + except (SelfServerException, SelfClientException) as e: + self.callback.error('%s' % e.message, node) + + self.callback.info('%s: %s' % (node, "Logs cleared")) def resolve_ev_records(self, resolve_list, **kw): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 8b1dc1605..892c687da 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -219,7 +219,11 @@ RSPCONFIG_APIS = { }, } -EVENTLOG_URL = "/logging/enumerate" +EVENTLOG_URLS = { + "list": "/logging/enumerate", + "clear_all": "/logging/action/deleteAll", +} + RAS_POLICY_TABLE = "/opt/ibm/ras/lib/policyTable.json" RAS_POLICY_MSG = "Install the OpenBMC RAS package to obtain more details logging messages." RAS_NOT_FOUND_MSG = " Not found in policy table: " @@ -559,7 +563,7 @@ class OpenBMCRest(object): # Extract all eventlog info and parse it def get_eventlog_info(self): - eventlog_data = self.request('GET', EVENTLOG_URL, cmd='get_eventlog_info') + eventlog_data = self.request('GET', EVENTLOG_URLS['list'], cmd='get_eventlog_info') return self.parse_eventlog_data(eventlog_data) @@ -584,6 +588,11 @@ class OpenBMCRest(object): id, event_log_line = self.parse_eventlog_data_record(value, ras_event_mapping) if int(id) != 0: eventlog_dict[str(id)] = event_log_line + + if not eventlog_dict: + # Nothing was returned from BMC + eventlog_dict['0'] ='No attributes returned from the BMC.' + return eventlog_dict except KeyError: error = 'Error: Received wrong format response: %s' % eventlog_data @@ -649,6 +658,12 @@ class OpenBMCRest(object): formatted_line += LED_tag return id_str, formatted_line + # Clear all eventlog records + def clear_all_eventlog_records(self): + + return self.request('POST', EVENTLOG_URLS['clear_all'], cmd='clear_all_eventlog_records') + + def set_apis_values(self, key, value): attr_info = RSPCONFIG_APIS[key] if 'set_url' not in attr_info: diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 6d382d140..629f9e781 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -872,7 +872,6 @@ class OpenBMCManager(base.BaseManager): # 3, run the subcommands runner = OpenBMCEventlogTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) - self.messager.info('revetlog.py processing action=%s args=%s' % (action, args)) if action == 'clear': DefaultEventlogManager().clear_all_eventlog_records(runner) elif action == 'resolved': From 7cb0065a98fa6e84113346fc68680183a430f988 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 5 Mar 2018 09:18:19 -0500 Subject: [PATCH 003/161] Payload data for clear action --- .../lib/python/agent/hwctl/executor/openbmc_eventlog.py | 2 +- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py index f582270e5..ee3ba2458 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py @@ -60,11 +60,11 @@ class OpenBMCEventlogTask(ParallelNodesCommand): try: obmc.login() obmc.clear_all_eventlog_records() + self.callback.info('%s: %s' % (node, "Logs cleared")) except (SelfServerException, SelfClientException) as e: self.callback.error('%s' % e.message, node) - self.callback.info('%s: %s' % (node, "Logs cleared")) def resolve_ev_records(self, resolve_list, **kw): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 892c687da..8a9f4640d 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -661,7 +661,8 @@ class OpenBMCRest(object): # Clear all eventlog records def clear_all_eventlog_records(self): - return self.request('POST', EVENTLOG_URLS['clear_all'], cmd='clear_all_eventlog_records') + payload = { "data": [] } + return self.request('POST', EVENTLOG_URLS['clear_all'], payload=payload, cmd='clear_all_eventlog_records') def set_apis_values(self, key, value): From 84fd513f3d5341bd354ff7507904c076a14b3421 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 5 Mar 2018 03:48:11 -0500 Subject: [PATCH 004/161] rspconfig set ip/netmask/gateway/vlan in python --- .../lib/python/agent/common/utils.py | 14 +++ .../agent/hwctl/executor/openbmc_bmcconfig.py | 103 ++++++++++++++++-- .../lib/python/agent/hwctl/openbmc_client.py | 84 +++++++++++--- 3 files changed, 176 insertions(+), 25 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/common/utils.py b/xCAT-openbmc-py/lib/python/agent/common/utils.py index e4112741b..5df571320 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/utils.py +++ b/xCAT-openbmc-py/lib/python/agent/common/utils.py @@ -82,6 +82,20 @@ def sort_string_with_numbers(origin_list): new_list.sort() return [string for __,string in new_list] +def exchange_mask(mask): + count_bit = lambda bin_str: len([i for i in bin_str if i=='1']) + mask_splited = mask.split('.') + mask_count = [count_bit(bin(int(i))) for i in mask_splited] + return sum(mask_count) + +def exchange_maskint(mask_int): + bin_arr = ['0' for i in range(32)] + for i in range(mask_int): + bin_arr[i] = '1' + tmpmask = [''.join(bin_arr[i * 8:i * 8 + 8]) for i in range(4)] + tmpmask = [str(int(tmpstr, 2)) for tmpstr in tmpmask] + return '.'.join(tmpmask) + class Messager(object): def __init__(self, name=None): self.logger = logging.getLogger(name or 'xcatagent') diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index f1b648ede..46045c361 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -167,7 +167,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): if (20-i) % 8 == 0: self.callback.info('%s: Still waiting for dump %s to be generated... ' % (node, dump_id)) - sleep( 15 ) + gevent.sleep( 15 ) if flag: self._dump_download(obmc, node, str(dump_id), flag_dump_process=True) @@ -296,7 +296,7 @@ rmdir \"/tmp/$userid\" \n") return else: self._set_netinfo(netinfo_dict['ip'], netinfo_dict['netmask'], - netinfo_dict['gateway'], netinfo_dict['vlan']) + netinfo_dict['gateway'], netinfo_dict['vlan'], **kw) def _set_hostname(self, hostname, **kw): node = kw['node'] @@ -324,6 +324,10 @@ rmdir \"/tmp/$userid\" \n") if not netinfo: return self.callback.error('No network information get', node) + if 'error' in netinfo: + self.callback.info('%s: %s' % (node, netinfo['error'])) + return + bmcip = node_info['bmcip'] nic = self._get_facing_nic(bmcip, netinfo) if not nic: @@ -394,12 +398,91 @@ rmdir \"/tmp/$userid\" \n") result = '%s: %s: %s' % (node, openbmc.RSPCONFIG_APIS[key]['display_name'], str_value.split('.')[-1]) self.callback.info(result) - def _set_netinfo(self, ip, netmask, gateway, vlan=False, **kw): + def _print_bmc_netinfo(self, node, ip, netmask, gateway, vlan): + + self.callback.info('%s: BMC IP: %s'% (node, ip)) + self.callback.info('%s: BMC Netmask: %s' % (node, netmask)) + self.callback.info('%s: BMC Gateway: %s' % (node, gateway)) if vlan: - result = "set net(%s, %s, %s) for vlan %s" % (ip, netmask, gateway, vlan) - else: - result = "set net(%s, %s, %s) for eth0" % (ip, netmask, gateway) - return self.callback.info("set_netinfo %s" % result) + self.callback.info('%s: BMC VLAN ID: %s' % (node, vlan)) + + def _set_netinfo(self, ip, netmask, gateway, vlan=False, **kw): + + node = kw['node'] + node_info = kw['nodeinfo'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=node_info, messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + obmc.login() + netinfo = obmc.get_netinfo() + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + return + + if not netinfo: + return self.callback.error("No network information get", node) + if 'error' in netinfo: + return self.callback.info('%s: %s' % (node, netinfo['error'])) + + bmcip = node_info['bmcip'] + origin_nic = nic = self._get_facing_nic(bmcip, netinfo) + if not nic: + return self.callback.error('Can not get facing NIC for %s' % bmcip, node) + + if (ip == netinfo[nic]['ip'] and netmask == utils.exchange_maskint(netinfo[nic]['netmask']) and + gateway == netinfo[nic]['gateway']): + if not vlan or vlan == str(netinfo[nic]['vlanid']): + self._print_bmc_netinfo(node, ip, netmask, gateway, vlan) + return + + origin_type = netinfo[origin_nic]['ipsrc'] + origin_ip_obj = netinfo[origin_nic]['ipobj'] + + if vlan: + pre_nic = nic.split('_')[0] + try: + obmc.set_vlan(pre_nic, vlan) + gevent.sleep( 15 ) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + return + nic = pre_nic + '_' + vlan + + prefix = int(utils.exchange_mask(netmask)) + try: + obmc.set_netinfo(nic, ip, prefix, gateway) + gevent.sleep( 5 ) + nic_netinfo = obmc.get_nic_netinfo(nic) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + return + + if not netinfo: + return self.callback.error('Did not get info for NIC %s' % nic, node) + + set_success = False + for net_id, attr in nic_netinfo.items(): + if attr['ip'] == ip: + attr_netmask = utils.exchange_maskint(attr["netmask"]) + if (attr_netmask == netmask and + attr['gateway'] == gateway): + set_success = True + + if not set_success: + return self.callback.error('Config BMC IP failed', node) + + try: + if origin_type == 'DHCP': + obmc.disable_dhcp(origin_nic) + elif origin_type == 'Static': + obmc.delete_ip_object(origin_nic, origin_ip_obj) + else: + self.callback.error('Get wrong Origin type %s for NIC %s IP object %s' % (origin_type, nic, origin_ip_obj), node) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + self. _print_bmc_netinfo(node, ip, netmask, gateway, vlan) def _get_netinfo(self, ip=False, ipsrc=False, netmask=False, gateway=False, vlan=False, hostname=False, ntpservers=False, **kw): node = kw['node'] @@ -424,6 +507,10 @@ rmdir \"/tmp/$userid\" \n") if hostname: self.callback.info("%s: BMC Hostname: %s" %(node, bmchostname)) + + if 'error' in netinfo: + return self.callback.info('%s: %s' % (node, netinfo['error'])) + dic_length = len(netinfo) netinfodict = {'ip':[], 'netmask':[], 'gateway':[], 'vlan':[], 'ipsrc':[], 'ntpservers':[]} @@ -432,7 +519,7 @@ rmdir \"/tmp/$userid\" \n") if dic_length > 1: addon_string = " for %s" % nic netinfodict['ip'].append("BMC IP"+addon_string+": %s" % attrs["ip"]) - netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % attrs["netmask"]) + netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % utils.exchange_maskint(attrs["netmask"])) netinfodict['gateway'].append("BMC Gateway"+addon_string+": %s (default: %s)" % (attrs["gateway"], defaultgateway)) netinfodict['vlan'].append("BMC VLAN ID"+addon_string+": %s" % attrs["vlanid"]) netinfodict['ipsrc'].append("BMC IP Source"+addon_string+": %s" % attrs["ipsrc"]) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 8b1dc1605..f3ff6c00f 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -162,11 +162,14 @@ FIRM_URLS = { } RSPCONFIG_NETINFO_URL = { + 'delete_ip_object': "/network/#NIC#/ipv4/#OBJ#", + 'disable_dhcp': "/network/#NIC#/attr/DHCPEnabled", 'get_netinfo': "/network/enumerate", - 'nic_ip': "/network/#NIC#/action/IP", - 'vlan': "/network/action/VLAN", + 'get_nic_netinfo': "/network/#NIC#/ipv4/enumerate", 'ipdhcp': "/network/action/Reset", + 'nic_ip': "/network/#NIC#/action/IP", 'ntpservers': "/network/#NIC#/attr/NTPServers", + 'vlan': "/network/action/VLAN", } PASSWD_URL = '/user/root/action/SetPassword' @@ -285,7 +288,7 @@ class OpenBMCRest(object): code = resp.status_code if code != requests.codes.ok: description = ''.join(data['data']['description']) - error = 'Error: [%d] %s' % (code, description) + error = '[%d] %s' % (code, description) self._print_record_log(error, cmd) raise SelfClientException(error, code) @@ -308,12 +311,12 @@ class OpenBMCRest(object): response = self.session.request(method, url, httpheaders, data=data) return self.handle_response(response, cmd=cmd) except SelfServerException as e: - e.message = 'Error: BMC did not respond. ' \ + e.message = 'BMC did not respond. ' \ 'Validate BMC configuration and retry the command.' self._print_record_log(e.message, cmd) raise except ValueError: - error = 'Error: Received wrong format response: %s' % response + error = 'Received wrong format response: %s' % response self._print_record_log(error, cmd) raise SelfServerException(error) @@ -360,13 +363,13 @@ class OpenBMCRest(object): try: data = json.loads(response) except ValueError: - error = 'Error: Received wrong format response when running command \'%s\': %s' % \ + error = 'Received wrong format response when running command \'%s\': %s' % \ (request_cmd, response) self._print_record_log(error, cmd=cmd) raise SelfServerException(error) if data['message'] != '200 OK': - error = 'Error: Failed to upload update file %s : %s-%s' % \ + error = 'Failed to upload update file %s : %s-%s' % \ (files, data['message'], \ ''.join(data['data']['description'])) self._print_record_log(error, cmd=cmd) @@ -392,7 +395,7 @@ class OpenBMCRest(object): chassis_stat = states[PROJECT_URL + '/state/chassis0']['CurrentPowerState'] return {'host': host_stat.split('.')[-1], 'chassis': chassis_stat.split('.')[-1]} except KeyError: - error = 'Error: Received wrong format response: %s' % states + error = 'Received wrong format response: %s' % states raise SelfServerException(error) def set_power_state(self, state): @@ -406,7 +409,7 @@ class OpenBMCRest(object): try: return {'bmc': state.split('.')[-1]} except KeyError: - error = 'Error: Received wrong format response: %s' % state + error = 'Received wrong format response: %s' % state raise SelfServerException(error) def reboot_bmc(self, optype='warm'): @@ -448,7 +451,7 @@ class OpenBMCRest(object): boot_state = BOOTSOURCE_GET_STATE.get(boot_source.split('.')[-1], error) return boot_state except KeyError: - error = 'Error: Received wrong format response: %s' % states + error = 'Received wrong format response: %s' % states raise SelfServerException(error) def get_beacon_info(self): @@ -462,7 +465,7 @@ class OpenBMCRest(object): beacon_dict[key_id] = value['State'].split('.')[-1] return beacon_dict except KeyError: - error = 'Error: Received wrong format response: %s' % beacon_data + error = 'Received wrong format response: %s' % beacon_data raise SelfServerException(error) def set_beacon_state(self, state): @@ -494,7 +497,7 @@ class OpenBMCRest(object): return sensor_dict except KeyError: - error = 'Error: Received wrong format response: %s' % sensor_data + error = 'Received wrong format response: %s' % sensor_data raise SelfServerException(error) def get_inventory_info(self): @@ -531,7 +534,7 @@ class OpenBMCRest(object): return inverntory_dict except KeyError: - error = 'Error: Received wrong format response: %s' % inventory_data + error = 'Received wrong format response: %s' % inventory_data raise SelfServerException(error) def list_firmware(self): @@ -586,7 +589,7 @@ class OpenBMCRest(object): eventlog_dict[str(id)] = event_log_line return eventlog_dict except KeyError: - error = 'Error: Received wrong format response: %s' % eventlog_data + error = 'Received wrong format response: %s' % eventlog_data raise SelfServerException(error) # Parse a single eventlog entry and return data in formatted string @@ -717,7 +720,7 @@ class OpenBMCRest(object): return dump_dict except KeyError: - error = 'Error: Received wrong format response: %s' % dump_data + error = 'Received wrong format response: %s' % dump_data raise SelfServerException(error) def download_dump(self, download_id, file_path): @@ -732,6 +735,50 @@ class OpenBMCRest(object): url = HTTP_PROTOCOL + self.bmcip + GARD_CLEAR_URL return self.request('POST', url, payload=payload, cmd='clear_gard') + def set_vlan(self, nic, vlan_id): + + payload = { "data": [nic, vlan_id] } + return self.request('POST', RSPCONFIG_NETINFO_URL['vlan'], payload=payload, cmd='set_vlan') + + def set_netinfo(self, nic, ip, netmask, gateway): + + payload = { "data": ["xyz.openbmc_project.Network.IP.Protocol.IPv4", ip, netmask, gateway] } + path = RSPCONFIG_NETINFO_URL['nic_ip'].replace('#NIC#', nic) + return self.request('POST', path, payload=payload, cmd='set_netinfo') + + def disable_dhcp(self, nic): + + payload = { "data": 0 } + path = RSPCONFIG_NETINFO_URL['disable_dhcp'].replace('#NIC#', nic) + return self.request('PUT', path, payload=payload, cmd='disable_dhcp') + + def delete_ip_object(self, nic, ip_object): + + path = RSPCONFIG_NETINFO_URL['delete_ip_object'].replace('#OBJ#', ip_object).replace('#NIC#', nic) + return self.request('DELETE', path, cmd='delete_ip_object') + + def get_nic_netinfo(self, nic): + + path = RSPCONFIG_NETINFO_URL['get_nic_netinfo'].replace('#NIC#', nic) + data = self.request('GET', path, cmd='get_nic_netinfo') + + try: + netinfo = {} + for k, v in data.items(): + dev,match,netid = k.partition("/ipv4/") + if 'LinkLocal' in v["Origin"] or v["Address"].startswith("169.254"): + msg = "Found LinkLocal address %s for interface %s, Ignoring..." % (v["Address"], dev) + self._print_record_log(msg, 'get_netinfo') + continue + utils.update2Ddict(netinfo, netid, 'ip', v['Address']) + utils.update2Ddict(netinfo, netid, 'ipsrc', v['Origin'].split('.')[-1]) + utils.update2Ddict(netinfo, netid, 'netmask', v['PrefixLength']) + utils.update2Ddict(netinfo, netid, 'gateway', v['Gateway']) + return netinfo + except KeyError: + error = 'Received wrong format response: %s' % data + raise SelfServerException(error) + def get_netinfo(self): data = self.request('GET', RSPCONFIG_NETINFO_URL['get_netinfo'], cmd="get_netinfo") try: @@ -755,11 +802,14 @@ class OpenBMCRest(object): if 'ip' in netinfo[nicid]: msg = "%s: Another valid ip %s found." % (node, v["Address"]) self._print_record_log(msg, 'get_netinfo') - continue + del netinfo[nicid] + netinfo['error'] = 'Interfaces with multiple IP addresses are not supported' + break utils.update2Ddict(netinfo, nicid, "ipsrc", v["Origin"].split('.')[-1]) utils.update2Ddict(netinfo, nicid, "netmask", v["PrefixLength"]) utils.update2Ddict(netinfo, nicid, "gateway", v["Gateway"]) utils.update2Ddict(netinfo, nicid, "ip", v["Address"]) + utils.update2Ddict(netinfo, nicid, "ipobj", netid) if dev in data: info = data[dev] utils.update2Ddict(netinfo, nicid, "vlanid", info.get("Id", "Disable")) @@ -771,7 +821,7 @@ class OpenBMCRest(object): utils.update2Ddict(netinfo, nicid, "ntpservers", ntpservers) return netinfo except KeyError: - error = 'Error: Received wrong format response: %s' % data + error = 'Received wrong format response: %s' % data raise SelfServerException(error) From 072a04fd846bc5ff064e5de2e58c57d7e0b18cd6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 6 Mar 2018 15:43:42 -0500 Subject: [PATCH 005/161] OpenBMC reventlog resolved support --- .../agent/hwctl/executor/openbmc_eventlog.py | 49 ++++++++++++++++++- .../lib/python/agent/hwctl/openbmc_client.py | 11 ++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py index ee3ba2458..fdfa7097d 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py @@ -26,7 +26,7 @@ class OpenBMCEventlogTask(ParallelNodesCommand): number_to_display = 0 try: # Number of records to display from the end - number_to_display = 0-int(num_to_display[0]) + number_to_display = 0-int(num_to_display) except Exception: # All records to display number_to_display = 0 @@ -69,3 +69,50 @@ class OpenBMCEventlogTask(ParallelNodesCommand): def resolve_ev_records(self, resolve_list, **kw): node = kw['node'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, debugmode=self.debugmode, verbose=self.verbose) + try: + obmc.login() + + # Get all eventlog records + eventlog_info_dict = obmc.get_eventlog_info() + + keys = eventlog_info_dict.keys() + # Sort the keys in natural order + keys.sort(key=lambda x : int(x[0:])) + + resolved, ids = resolve_list.split('=') + eventlog_ids_to_resolve = [] + if ids.upper() == "LED": + + # loop through eventlog_info_dict and collect LED ids to be resolved into a eventlog_ids_to_resolve array + for key in list(keys): + if "[LED]" in eventlog_info_dict[key]: + if "Resolved: 0" in eventlog_info_dict[key]: + eventlog_ids_to_resolve.append(key) + else: + if self.verbose: + self.callback.info('%s: Not resolving already resolved eventlog ID %s' % (node, key)) + else: + # loop through list of ids and collect ids to resolve into a eventlog_ids_to_resolve array + for id_to_resolve in ids.split(','): + if id_to_resolve in eventlog_info_dict: + if "Resolved: 0" in eventlog_info_dict[id_to_resolve]: + eventlog_ids_to_resolve.append(id_to_resolve) + else: + if self.verbose: + self.callback.info('%s: Not resolving already resolved eventlog ID %s' % (node, id_to_resolve)) + else: + self.callback.info('%s: Invalid ID: %s' % (node, id_to_resolve)) + + if len(eventlog_ids_to_resolve) == 0: + # At the end and there are no entries to resolve + self.callback.info('%s: No event log entries needed to be resolved' % node) + else: + # Resolve entries that were collected into the eventlog_ids_to_resolve array + obmc.resolve_event_log_entries(eventlog_ids_to_resolve) + for entry in eventlog_ids_to_resolve: + self.callback.info('%s: Resolved %s' % (node, entry)) + + except (SelfServerException, SelfClientException) as e: + self.callback.error('%s' % e.message, node) + diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 8a9f4640d..0a1323220 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -220,8 +220,9 @@ RSPCONFIG_APIS = { } EVENTLOG_URLS = { - "list": "/logging/enumerate", + "list": "/logging/enumerate", "clear_all": "/logging/action/deleteAll", + "resolve": "/logging/entry/{}/attr/Resolved", } RAS_POLICY_TABLE = "/opt/ibm/ras/lib/policyTable.json" @@ -664,6 +665,14 @@ class OpenBMCRest(object): payload = { "data": [] } return self.request('POST', EVENTLOG_URLS['clear_all'], payload=payload, cmd='clear_all_eventlog_records') + # Resolve eventlog records + def resolve_event_log_entries(self, eventlog_ids_to_resolve): + + payload = { "data": "1" } + for event_id in eventlog_ids_to_resolve: + self.request('PUT', EVENTLOG_URLS['resolve'].format(event_id), payload=payload, cmd='resolve_event_log_entries') + + return def set_apis_values(self, key, value): attr_info = RSPCONFIG_APIS[key] From 8159ba222c491cf8061e970c6fbb2ba8c593c499 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 6 Mar 2018 22:15:43 -0500 Subject: [PATCH 006/161] modify existed cases for support validation --- .../testcase/xcat-inventory/cases.common | 2 +- .../testcase/xcat-inventory/cases.node | 648 +++++++++++++++++- .../testcase/xcat-inventory/cases.osimage | 122 ++-- .../testcase/xcat-inventory/cases.site | 106 ++- 4 files changed, 736 insertions(+), 142 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.common b/xCAT-test/autotest/testcase/xcat-inventory/cases.common index 875682e20..cf257d6a3 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.common +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.common @@ -104,7 +104,7 @@ check:rc==0 cmd:cat /tmp/xcat_inventory_import_option_f_invalid_file/invaild_yaml check:rc==0 cmd:xcat-inventory import -f /tmp/xcat_inventory_import_option_f_invalid_file/invaild_yaml -check:output =~ Error: failed to load file +check:output =~ Error: check:output !~Traceback check:rc!=0 cmd:rm -rf /tmp/xcat_inventory_import_option_f_invalid_file diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.node b/xCAT-test/autotest/testcase/xcat-inventory/cases.node index 92d8d8177..35a351bb5 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.node +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.node @@ -13,7 +13,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_ppc_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=hmc nodetype=ppc,osi addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou parent=parent password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power pprofile=pprofile prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=hmc nodetype=ppc,osi addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=HMC height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou parent=parent password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power pprofile=pprofile prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_ppc_by_json/srcbogusnode.stanza check:rc==0 @@ -65,7 +65,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_ppc_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=hmc nodetype=ppc,osi addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou parent=parent password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power pprofile=pprofile prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=hmc nodetype=ppc,osi addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=HMC height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou parent=parent password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power pprofile=pprofile prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_ppc_by_yaml/srcbogusnode.stanza check:rc==0 @@ -117,7 +117,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_kvm_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=kvm addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmcpus=vmcpus vmhost=vmhost vmmanager=vmmanager vmmaster=vmmaster vmmemory=vmmemory vmnicnicmodel=vmnicnicmodel vmnics=vmnics vmothersetting=vmothersetting vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=kvm addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmcpus=vmcpus vmhost=vmhost vmmanager=vmmanager vmmaster=vmmaster vmmemory=vmmemory vmnicnicmodel=vmnicnicmodel vmnics=vmnics vmothersetting=vmothersetting vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_kvm_by_json/srcbogusnode.stanza check:rc==0 @@ -170,7 +170,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_kvm_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=kvm addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmcpus=vmcpus vmhost=vmhost vmmanager=vmmanager vmmaster=vmmaster vmmemory=vmmemory vmnicnicmodel=vmnicnicmodel vmnics=vmnics vmothersetting=vmothersetting vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=kvm addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmcpus=vmcpus vmhost=vmhost vmmanager=vmmanager vmmaster=vmmaster vmmemory=vmmemory vmnicnicmodel=vmnicnicmodel vmnics=vmnics vmothersetting=vmothersetting vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_kvm_by_yaml/srcbogusnode.stanza check:rc==0 @@ -223,7 +223,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=arch authdomain=authdomain authkey=authkey authtype=authtype cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=privtype productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=seclevel serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_json/srcbogusnode.stanza check:rc==0 @@ -275,7 +275,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=arch authdomain=authdomain authkey=authkey authtype=authtype cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=privtype productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=seclevel serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_yaml/srcbogusnode.stanza check:rc==0 @@ -327,7 +327,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_boston_by_yaml/srcbogusnode.stanza check:rc==0 @@ -378,7 +378,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_boston_by_json/srcbogusnode.stanza check:rc==0 @@ -429,7 +429,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_witherspoon_by_yaml/srcbogusnode.stanza check:rc==0 @@ -480,7 +480,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=arch authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_witherspoon_by_json/srcbogusnode.stanza check:rc==0 @@ -532,7 +532,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=protocol provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpauth=snmpauth snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_json/srcbogusnode.stanza check:rc==0 @@ -583,7 +583,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=arch authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac hcp=hcp height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=id installnic=installnic interface=interface ip=ip iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=mac memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=netboot nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=protocol provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=setupconserver setupdhcp=setupdhcp setupftp=setupftp setupipforward=setupipforward setupldap=setupldap setupnameserver=setupnameserver setupnfs=setupnfs setupnim=setupnim setupntp=setupntp setupproxydhcp=setupproxydhcp setuptftp=setuptftp sfp=sfp side=side slot=slot snmpauth=snmpauth snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=switchport switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_yaml/srcbogusnode.stanza check:rc==0 @@ -790,7 +790,7 @@ cmd: grep " \"xcatdefaults\": " /tmp/xcat_inventory_try_to_export_all_type_is_no check:rc==0 cmd: grep " \"service\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi check:rc==0 -cmd:dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db|wc -l);dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db |wc -l);((da=$dn+$dg+2));ia=$(grep " \"obj_type\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node|wc -l); if [[ $da -eq $ia ]];then exit 0; else exit 1;fi +cmd:dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db|wc -l);dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db |wc -l);((da=$dn+$dg+2));echo "dn=$dn dg=$dg da=$da";ia=$(grep " \"obj_type\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node|wc -l);echo "ia=$ia"; if [[ $da -eq $ia ]];then exit 0; else exit 1;fi check:rc==0 cmd:a=0;for i in `awk -F':' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db`; do grep -E " \"$i\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db|wc -l);if [[ $a -eq $dg ]]; then exit 0; else exit 1;fi check:rc==0 @@ -918,15 +918,14 @@ node: engine_type: openbmc hardware_mgt_engine: engine_info: - openbmc_info: - bmcpassword: 0penBmc - bmcusername: root + bmcpassword: 0penBmc + bmcusername: root engine_type: openbmc netboot_engine: engine_type: petitboot network_info: primarynic: - ip: '|\D+(\d+)|10.100.100.(\$1)|' + ip: '|\D+(\d+)|10.100.100.($1)|' obj_info: grouptype: static obj_type: group @@ -1090,7 +1089,7 @@ policy: route: {} schema_version: '1.0' site: - cluster: + clustersite: SNsyncfiledir: /var/xcat/syncfiles auditnosyslog: '0' auditskipcmds: ALL @@ -1785,3 +1784,616 @@ check:rc==0 cmd:rm -rf /tmp/export_import_single_group_json check:rc==0 end + + +start:import_validation_json_node_obj_type +description:This case is used to test node validation function of xcat-inventory import json file. To test "obj_type" attribute +cmd:mkdir -p /tmp/import_validation_json_node_obj_type +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_obj_type/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_obj_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "server", + "network_info": { + "primarynic": { + "mac": [ + "11:11:11:11:11:11" + ] + } + }, + "obj_info": { + "groups": "bogusgroup" + }, + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_obj_type/node.json +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json +check:output=~Error: failed to validate schema entry +check:output=~obj_type +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "server", + "network_info": { + "primarynic": { + "mac": [ + "11:11:11:11:11:11" + ] + } + }, + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "aaa", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_obj_type/node.json +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json +check:output=~Error: failed to validate schema entry +check:output=~obj_type +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "server", + "network_info": { + "primarynic": { + "mac": [ + "11:11:11:11:11:11" + ] + } + }, + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_obj_type/node.json +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusgroup": { + "device_type": "server", + "engines": { + "hardware_mgt_engine": { + "engine_type": "ipmi" + } + }, + "obj_info": { + "grouptype": "static" + }, + "obj_type": "group", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_obj_type/node.json +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json +check:output=~import object successfully +check:rc==0 +cmd:lsdef -t group -o bogusgroup +check:output=~Object name: bogusgroup +check:rc==0 +cmd:rmdef -t group -o bogusgroup +check:rc==0 +cmd:if [[ -e /tmp/import_validation_json_node_obj_type/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_obj_type/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_json_node_obj_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_obj_type/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_json_node_obj_type +check:rc==0 +end + + +start:import_validation_yaml_node_obj_type +description:This case is used to test node validation function of xcat-inventory import yaml file. To test "obj_type" attribute +cmd:mkdir -p /tmp/import_validation_yaml_node_obj_type +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_obj_type/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_obj_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: server + network_info: + primarynic: + mac: + - '11:11:11:11:11:11' + obj_info: + groups: bogusgroup + role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml +check:output=~Error: failed to validate schema entry +check:output=~obj_type +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: server + network_info: + primarynic: + mac: + - '11:11:11:11:11:11' + obj_info: + groups: bogusgroup + obj_type: aaa + role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml +check:output=~Error: failed to validate schema entry +check:output=~obj_type +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: server + network_info: + primarynic: + mac: + - '11:11:11:11:11:11' + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusgroup: + device_type: server + engines: + hardware_mgt_engine: + engine_type: ipmi + obj_info: + grouptype: static + obj_type: group + role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml +check:output=~import object successfully +check:rc==0 +cmd:lsdef -t group -o bogusgroup +check:output=~Object name: bogusgroup +check:rc==0 +cmd:rmdef -t group -o bogusgroup +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_obj_type/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_obj_type/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_obj_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_obj_type/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_yaml_node_obj_type +check:rc==0 +end + + +start:import_validation_json_node_group +description:This case is used to test node validation function of xcat-inventory import json file. To test "group" attribute +cmd:mkdir -p /tmp/import_validation_json_node_group +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_group/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_group/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "server", + "network_info": { + "primarynic": { + "mac": [ + "11:11:11:11:11:11" + ] + } + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_group/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_group/node.inv +check:output=~Error: failed to validate schema entry +check:output=~group +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_json_node_group/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_group/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_json_node_group/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_group/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_json_node_group +check:rc==0 +end + +start:import_validation_yaml_node_group +description:This case is used to test node validation function of xcat-inventory import yaml file. To test "group" attribute +cmd:mkdir -p /tmp/import_validation_yaml_node_group +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_group/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_group/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: server + network_info: + primarynic: + mac: + - '11:11:11:11:11:11' + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_group/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_group/node.inv +check:output=~Error: failed to validate schema entry +check:output=~group +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_yaml_node_group/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_group/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_group/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_group/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_yaml_node_group +check:rc==0 +end + +start:import_validation_json_node_device_type +description:This case is used to test node validation function of xcat-inventory import json file. To test "device_type" attribute +cmd:mkdir -p /tmp/import_validation_json_node_device_type +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_device_type/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_device_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv +check:output=~Error: failed to validate schema entry +check:output=~devtype +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "aaa", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv +check:output=~Error: failed to validate schema entry +check:output=~devtype +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "server", + "network_info": { + "primarynic": { + "mac": [ + "11:11:11:11:11:11" + ] + } + }, + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "switch", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "pdu", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "hmc", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_type": "rack", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:if [[ -e /tmp/import_validation_json_node_device_type/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_device_type/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_json_node_device_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_device_type/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_json_node_device_type +check:rc==0 +end + + +start:import_validation_yaml_node_device_type +description:This case is used to test node validation function of xcat-inventory import yaml file. To test "device_type" attribute +cmd:mkdir -p /tmp/import_validation_yaml_node_device_type +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_device_type/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_device_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv +check:output=~Error: failed to validate schema entry +check:output=~devtype +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: aaa + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv +check:output=~Error: failed to validate schema entry +check:output=~devtype +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: switch + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: pdu + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: rack + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: hmc + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_type: server + network_info: + primarynic: + mac: + - '11:11:11:11:11:11' + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv +check:output=~import object successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_device_type/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_device_type/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_device_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_device_type/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_yaml_node_device_type +check:rc==0 +end + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage index e7ec504ff..a957435f8 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage @@ -9,7 +9,7 @@ cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsde check:rc==0 cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_import_single_osimage_by_yaml_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' check:rc==0 -cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=compute provmethod=netboot rootfstype=nfs rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment check:rc==0 cmd:lsdef -t osimage -o bogus_image -z|sort -t'=' -k1 |tee /tmp/export_import_single_osimage_by_yaml/src_bogus_osimage.stanza check:rc==0 @@ -52,7 +52,7 @@ cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsde check:rc==0 cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_import_single_osimage_by_json_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' check:rc==0 -cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=compute provmethod=netboot rootfstype=nfs rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment check:rc==0 cmd:lsdef -t osimage -o bogus_image -z|sort -t'=' -k1 |tee /tmp/export_import_single_osimage_by_json/src_bogus_osimage.stanza check:rc==0 @@ -92,7 +92,7 @@ cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_forma check:rc==0 cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi check:rc==0 -cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=compute provmethod=netboot rootfstype=nfs rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment check:rc==0 cmd:xcat-inventory export -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_default_format/export.file check:rc==0 @@ -132,7 +132,7 @@ cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format check:rc==0 cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi check:rc==0 -cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=compute provmethod=netboot rootfstype=nfs rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment check:rc==0 cmd:xcat-inventory export --format=json -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_json_format/export.file check:rc==0 @@ -172,7 +172,7 @@ cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format check:rc==0 cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi check:rc==0 -cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=profile provmethod=provmethod rootfstype=rootfstype rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment +cmd:chdef -t osimage -o bogus_image addkcmdline=addkcmdline boottarget=boottarget cfmdir=cfmdir crashkernelsize=crashkernelsize description=description driverupdatesrc=driverupdatesrc dump=dump exlist=exlist groups=groups imagename=imagename imagetype=linux isdeletable=isdeletable kerneldir=kerneldir kernelver=kernelver kitcomponents=kitcomponents krpmver=krpmver netdrivers=netdrivers nodebootif=nodebootif osarch=osarch osdistroname=osdistroname osname=osname osupdatename=osupdatename osvers=osvers otherifce=otherifce otherpkgdir=otherpkgdir otherpkglist=otherpkglist partitionfile=partitionfile permission=permission pkgdir=pkgdir pkglist=pkglist postbootscripts=postbootscripts postinstall=postinstall postscripts=postscripts profile=compute provmethod=netboot rootfstype=nfs rootimgdir=rootimgdir serverrole=serverrole synclists=synclists template=template usercomment=usercomment check:rc==0 cmd:xcat-inventory export --format=yaml -t osimage |tee /tmp/xcat_inventory_try_to_export_all_type_is_osimage_yaml_format/export.file check:rc==0 @@ -238,7 +238,6 @@ echo "network: mgtifname: eth0 mtu: '1500' net: 10.0.0.0 - schema_version: 1.0 service: tftpserver: node: @@ -266,7 +265,6 @@ node: groups: bogusgroup obj_type: node role: compute - schema_version: 1.0 bogusnode2: device_type: server engines: @@ -291,7 +289,6 @@ node: groups: bogusgroup obj_type: node role: compute - schema_version: 1.0 bogusnode3: device_type: server engines: @@ -316,7 +313,6 @@ node: groups: bogusgroup obj_type: node role: compute - schema_version: 1.0 service: device_type: server engines: @@ -325,7 +321,6 @@ node: postscripts: servicenode obj_type: group role: compute - schema_version: 1.0 xcatdefaults: device_type: server engines: @@ -335,67 +330,54 @@ node: postscripts: syslog,remoteshell,syncfiles obj_type: group role: compute - schema_version: 1.0 osimage: bogus_image: addkcmdline: aaaa boottarget: aaa imagetype: linux - schema_version: 1.0 + provision_mode: statelite + role: compute passwd: {} policy: '1': name: root rule: allow - schema_version: 1.0 '1.2': name: c910f03c05k08.pok.stglabs.ibm.com rule: trusted - schema_version: 1.0 '2': commands: getbmcconfig rule: allow - schema_version: 1.0 '2.1': commands: remoteimmsetup rule: allow - schema_version: 1.0 '2.3': commands: lsxcatd rule: allow - schema_version: 1.0 '3': commands: nextdestiny rule: allow - schema_version: 1.0 '4': commands: getdestiny rule: allow - schema_version: 1.0 '4.4': commands: getpostscript rule: allow - schema_version: 1.0 '4.5': commands: getcredentials rule: allow - schema_version: 1.0 '4.6': commands: syncfiles rule: allow - schema_version: 1.0 '4.7': commands: litefile rule: allow - schema_version: 1.0 '4.8': commands: litetree rule: allow - schema_version: 1.0 '4.9': commands: getadapter rule: allow - schema_version: 1.0 route: {} site: cluster: @@ -424,7 +406,6 @@ site: ppcmaxp: '64' ppcretry: '3' ppctimeout: '0' - schema_version: 1.0 sharedtftp: '1' sshbetweennodes: ALLGROUPS syspowerinterval: '0' @@ -441,7 +422,9 @@ cmd:#!/bin/bash echo "Object name: bogus_image addkcmdline=aaaa boottarget=aaa - imagetype=linux">> /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_osimage_db + imagetype=linux + profile=compute + provmethod=statelite" >> /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_osimage_db check:rc==0 cmd:sort /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/org_osimage_db > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/target_osimage_sort cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_osimage_yaml_format/import.file -t osimage @@ -521,7 +504,6 @@ echo '{ "mtu": "1500", "net": "10.0.0.0" }, - "schema_version": 1.0, "service": { "tftpserver": "" } @@ -562,7 +544,6 @@ echo '{ }, "obj_type": "node", "role": "compute", - "schema_version": 1.0 }, "bogusnode2": { "device_type": "server", @@ -598,7 +579,6 @@ echo '{ }, "obj_type": "node", "role": "compute", - "schema_version": 1.0 }, "bogusnode3": { "device_type": "server", @@ -634,7 +614,6 @@ echo '{ }, "obj_type": "node", "role": "compute", - "schema_version": 1.0 }, "service": { "device_type": "server", @@ -647,7 +626,6 @@ echo '{ }, "obj_type": "group", "role": "compute", - "schema_version": 1.0 }, "xcatdefaults": { "device_type": "server", @@ -661,7 +639,6 @@ echo '{ }, "obj_type": "group", "role": "compute", - "schema_version": 1.0 } }, "osimage": { @@ -669,75 +646,63 @@ echo '{ "addkcmdline": "aaaa", "boottarget": "aaa", "imagetype": "linux", - "schema_version": 1.0 + "provision_mode": "statelite", + "role": "compute" } }, "passwd": {}, "policy": { "1": { "name": "root", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "1.2": { "name": "c910f03c05k08.pok.stglabs.ibm.com", - "rule": "trusted", - "schema_version": 1.0 + "rule": "trusted" }, "2": { "commands": "getbmcconfig", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "2.1": { "commands": "remoteimmsetup", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "2.3": { "commands": "lsxcatd", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "3": { "commands": "nextdestiny", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4": { "commands": "getdestiny", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.4": { "commands": "getpostscript", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.5": { "commands": "getcredentials", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.6": { "commands": "syncfiles", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.7": { "commands": "litefile", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.8": { "commands": "litetree", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.9": { "commands": "getadapter", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" } }, "route": {}, @@ -768,7 +733,6 @@ echo '{ "ppcmaxp": "64", "ppcretry": "3", "ppctimeout": "0", - "schema_version": 1.0, "sharedtftp": "1", "sshbetweennodes": "ALLGROUPS", "syspowerinterval": "0", @@ -788,7 +752,9 @@ cmd:#!/bin/bash echo "Object name: bogus_image addkcmdline=aaaa boottarget=aaa - imagetype=linux">> /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_osimage_db + imagetype=linux + profile=compute + provmethod=statelite" >> /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_osimage_db check:rc==0 cmd:sort /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/org_osimage_db > /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/target_osimage_sort cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/import.file -t osimage @@ -829,8 +795,8 @@ cmd: rmdef -t osimage -o bogus_image check:rc==0 cmd:if [[ -e /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/bogus_image.stanza ]]; then cat /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format/bogus_image.stanza | mkdef -z;fi check:rc==0 -cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format -check:rc==0 +#cmd:rm -rf /tmp/xcat_inventory_try_to_import_all_type_is_osimage_json_format +#check:rc==0 end @@ -845,14 +811,26 @@ cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsde check:rc==0 cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' check:rc==0 -cmd:chdef -t osimage -o bogus_image addkcmdline=1111 boottarget=1111 cfmdir=1111 crashkernelsize=1111 description=1111 driverupdatesrc=1111 dump=1111 exlist=1111 groups=1111 imagename=1111 imagetype=linux isdeletable=1111 kerneldir=1111 kernelver=1111 kitcomponents=1111 krpmver=1111 netdrivers=1111 nodebootif=1111 osarch=1111 osdistroname=1111 osname=1111 osupdatename=1111 osvers=1111 otherifce=1111 otherpkgdir=1111 otherpkglist=1111 partitionfile=1111 permission=1111 pkgdir=1111 pkglist=1111 postbootscripts=1111 postinstall=1111 postscripts=1111 profile=1111 provmethod=1111 rootfstype=1111 rootimgdir=1111 serverrole=1111 synclists=1111 template=1111 usercomment=1111 +cmd:chdef -t osimage -o bogus_image addkcmdline=1111 boottarget=1111 cfmdir=1111 crashkernelsize=1111 description=1111 driverupdatesrc=1111 dump=1111 exlist=1111 groups=1111 imagename=1111 imagetype=linux isdeletable=1111 kerneldir=1111 kernelver=1111 kitcomponents=1111 krpmver=1111 netdrivers=1111 nodebootif=1111 osarch=1111 osdistroname=1111 osname=1111 osupdatename=1111 osvers=1111 otherifce=1111 otherpkgdir=1111 otherpkglist=1111 partitionfile=1111 permission=1111 pkgdir=1111 pkglist=1111 postbootscripts=1111 postinstall=1111 postscripts=1111 profile=compute provmethod=statelite rootfstype=nfs rootimgdir=1111 serverrole=1111 synclists=1111 template=1111 usercomment=1111 check:rc==0 cmd:lsdef -t osimage -o bogus_image -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_single_osimage_then_modify_json_then_import/src_bogus_osimage.stanza check:rc==0 +cmd:sed -i 's/profile=compute/profile=service/g' /tmp/export_single_osimage_then_modify_json_then_import/src_bogus_osimage.stanza +check:rc==0 +cmd:sed -i 's/provmethod=statelite/provmethod=netboot/g' /tmp/export_single_osimage_then_modify_json_then_import/src_bogus_osimage.stanza +check:rc==0 +cmd:sed -i 's/rootfstype=nfs/rootfstype=ramdisk/g' /tmp/export_single_osimage_then_modify_json_then_import/src_bogus_osimage.stanza +check:rc==0 cmd:xcat-inventory export --format=json -t osimage -o bogus_image |tee /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json check:rc==0 cmd:sed -i 's/1111/2222/g' /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json check:rc==0 +cmd:sed -i 's/"role": "compute"/"role": "service"/g' /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json +check:rc==0 +cmd:sed -i 's/"provision_mode": "statelite"/"provision_mode": "netboot"/g' /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json +check:rc==0 +cmd:sed -i 's/"rootfstype": "nfs"/"rootfstype": "ramdisk"/g' /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json +check:rc==0 cmd:scp /tmp/export_single_osimage_then_modify_json_then_import/bogus_image.json $$DSTMN:/tmp/export_single_osimage_then_modify_json_then_import_$$DSTMN/ check:rc==0 cmd: rmdef -t osimage -o bogus_image @@ -889,14 +867,26 @@ cmd:lsdef -t osimage -o bogus_image >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsde check:rc==0 cmd:ssh $$DSTMN 'lsdef -t osimage -o bogus_image > /dev/null 2>&1; if [[ $? -eq 0 ]]; then lsdef -t osimage -o bogus_image -z >/tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/bogus_image.stanza ;rmdef -t osimage -o bogus_image;fi' check:rc==0 -cmd:chdef -t osimage -o bogus_image addkcmdline=1111 boottarget=1111 cfmdir=1111 crashkernelsize=1111 description=1111 driverupdatesrc=1111 dump=1111 exlist=1111 groups=1111 imagename=1111 imagetype=linux isdeletable=1111 kerneldir=1111 kernelver=1111 kitcomponents=1111 krpmver=1111 netdrivers=1111 nodebootif=1111 osarch=1111 osdistroname=1111 osname=1111 osupdatename=1111 osvers=1111 otherifce=1111 otherpkgdir=1111 otherpkglist=1111 partitionfile=1111 permission=1111 pkgdir=1111 pkglist=1111 postbootscripts=1111 postinstall=1111 postscripts=1111 profile=1111 provmethod=1111 rootfstype=1111 rootimgdir=1111 serverrole=1111 synclists=1111 template=1111 usercomment=1111 +cmd:chdef -t osimage -o bogus_image addkcmdline=1111 boottarget=1111 cfmdir=1111 crashkernelsize=1111 description=1111 driverupdatesrc=1111 dump=1111 exlist=1111 groups=1111 imagename=1111 imagetype=linux isdeletable=1111 kerneldir=1111 kernelver=1111 kitcomponents=1111 krpmver=1111 netdrivers=1111 nodebootif=1111 osarch=1111 osdistroname=1111 osname=1111 osupdatename=1111 osvers=1111 otherifce=1111 otherpkgdir=1111 otherpkglist=1111 partitionfile=1111 permission=1111 pkgdir=1111 pkglist=1111 postbootscripts=1111 postinstall=1111 postscripts=1111 profile=compute provmethod=statelite rootfstype=nfs rootimgdir=1111 serverrole=1111 synclists=1111 template=1111 usercomment=1111 check:rc==0 cmd:lsdef -t osimage -o bogus_image -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_single_osimage_then_modify_yaml_then_import/src_bogus_osimage.stanza check:rc==0 +cmd:sed -i 's/profile=compute/profile=service/g' /tmp/export_single_osimage_then_modify_yaml_then_import/src_bogus_osimage.stanza +check:rc==0 +cmd:sed -i 's/provmethod=statelite/provmethod=netboot/g' /tmp/export_single_osimage_then_modify_yaml_then_import/src_bogus_osimage.stanza +check:rc==0 +cmd:sed -i 's/rootfstype=nfs/rootfstype=ramdisk/g' /tmp/export_single_osimage_then_modify_yaml_then_import/src_bogus_osimage.stanza +check:rc==0 cmd:xcat-inventory export --format=yaml -t osimage -o bogus_image |tee /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml check:rc==0 cmd:sed -i 's/1111/2222/g' /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml check:rc==0 +cmd:sed -i "s/role: '*compute'*/role: 'service'/g" /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml +check:rc==0 +cmd:sed -i "s/provision_mode: '*statelite'*/provision_mode: 'netboot'/g" /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml +check:rc==0 +cmd:sed -i "s/rootfstype: '*nfs'*/rootfstype: 'ramdisk'/g" /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml +check:rc==0 cmd:scp /tmp/export_single_osimage_then_modify_yaml_then_import/bogus_image.yaml $$DSTMN:/tmp/export_single_osimage_then_modify_yaml_then_import_$$DSTMN/ check:rc==0 cmd: rmdef -t osimage -o bogus_image diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.site b/xCAT-test/autotest/testcase/xcat-inventory/cases.site index a1b4555e3..e23b916a5 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.site +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.site @@ -453,7 +453,6 @@ echo '{ "mtu": "1500", "net": "100.0.0.0" }, - "schema_version": 1.0, "service": { "tftpserver": "" } @@ -494,7 +493,6 @@ echo '{ }, "obj_type": "node", "role": "compute", - "schema_version": 1.0 }, "bogusnode2": { "device_type": "server", @@ -530,7 +528,6 @@ echo '{ }, "obj_type": "node", "role": "compute", - "schema_version": 1.0 }, "bogusnode3": { "device_type": "server", @@ -566,7 +563,6 @@ echo '{ }, "obj_type": "node", "role": "compute", - "schema_version": 1.0 }, "service": { "device_type": "server", @@ -579,7 +575,6 @@ echo '{ }, "obj_type": "group", "role": "compute", - "schema_version": 1.0 }, "xcatdefaults": { "device_type": "server", @@ -593,7 +588,6 @@ echo '{ }, "obj_type": "group", "role": "compute", - "schema_version": 1.0 } }, "osimage": {}, @@ -601,68 +595,55 @@ echo '{ "policy": { "1": { "name": "root", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "1.2": { "name": "c910f03c05k08.pok.stglabs.ibm.com", - "rule": "trusted", - "schema_version": 1.0 + "rule": "trusted" }, "2": { "commands": "getbmcconfig", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "2.1": { "commands": "remoteimmsetup", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "2.3": { "commands": "lsxcatd", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "3": { "commands": "nextdestiny", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4": { "commands": "getdestiny", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.4": { "commands": "getpostscript", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.5": { "commands": "getcredentials", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.6": { "commands": "syncfiles", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.7": { "commands": "litefile", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.8": { "commands": "litetree", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" }, "4.9": { "commands": "getadapter", - "rule": "allow", - "schema_version": 1.0 + "rule": "allow" } }, "route": {}, @@ -725,7 +706,6 @@ echo '{ "precreatemypostscripts": "1", "pruneservices": "1", "runbootscripts": "yes", - "schema_version": 1.0, "setinstallnic": "1", "sharedinstall": "no", "sharedtftp": "1", @@ -900,7 +880,6 @@ echo "network: mgtifname: eth0 mtu: '1500' net: 100.0.0.0 - schema_version: 1.0 service: tftpserver: node: @@ -928,7 +907,6 @@ node: groups: testgroup obj_type: node role: compute - schema_version: 1.0 bogusnode2: device_type: server engines: @@ -953,7 +931,6 @@ node: groups: testgroup obj_type: node role: compute - schema_version: 1.0 bogusnode3: device_type: server engines: @@ -978,7 +955,6 @@ node: groups: testgroup obj_type: node role: compute - schema_version: 1.0 service: device_type: server engines: @@ -987,7 +963,6 @@ node: postscripts: servicenode obj_type: group role: compute - schema_version: 1.0 xcatdefaults: device_type: server engines: @@ -997,62 +972,48 @@ node: postscripts: syslog,remoteshell,syncfiles obj_type: group role: compute - schema_version: 1.0 osimage: {} passwd: {} policy: '1': name: root rule: allow - schema_version: 1.0 '1.2': name: c910f03c05k08.pok.stglabs.ibm.com rule: trusted - schema_version: 1.0 '2': commands: getbmcconfig rule: allow - schema_version: 1.0 '2.1': commands: remoteimmsetup rule: allow - schema_version: 1.0 '2.3': commands: lsxcatd rule: allow - schema_version: 1.0 '3': commands: nextdestiny rule: allow - schema_version: 1.0 '4': commands: getdestiny rule: allow - schema_version: 1.0 '4.4': commands: getpostscript rule: allow - schema_version: 1.0 '4.5': commands: getcredentials rule: allow - schema_version: 1.0 '4.6': commands: syncfiles rule: allow - schema_version: 1.0 '4.7': commands: litefile rule: allow - schema_version: 1.0 '4.8': commands: litetree rule: allow - schema_version: 1.0 '4.9': commands: getadapter rule: allow - schema_version: 1.0 route: {} site: clustersite: @@ -1113,7 +1074,6 @@ site: precreatemypostscripts: '1' pruneservices: '1' runbootscripts: 'yes' - schema_version: 1.0 setinstallnic: '1' sharedinstall: 'no' sharedtftp: '1' @@ -1278,14 +1238,30 @@ cmd: lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_yaml_th check:rc==0 cmd:ssh $$DSTMN 'lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_yaml_then_import_$$DSTMN/site.stanza ' check:rc==0 -cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 cleanupxcatpost=1111 consoleondemand=1111 databaseloc='/var/lib1111' db2installloc='/mntdb1111' dbtracelevel=1111 defserialflow=1111 defserialport=1111 defserialspeed=9611111111 dhcpinterfaces=eth1111 dhcplease=43211111111 dhcpsetup=1111 disjointdhcps=1111 dnshandler=ddns1111 dnsinterfaces='xcatmn|eth1,eth2;service|bond1111' dnsupdaters=dnsupdaters1111 domain='pok1111.stglabs.ibm.com' enableASMI=1111 excludenodes=1111 externaldns=1111 extntpservers=1111 forwarders=$mnip fsptimeout=1111 genmacprefix='11111111:11:aa' genpasswords=1111 hierarchicalattrs=1111 httpport=81111 hwctrldispatch=1111 installdir='/install1111/' installloc='hostname:/path1111' ipmidispatch=1111 ipmimaxp=641111 ipmiretries=31111 ipmisdrcache=1111 ipmitimeout=21111 iscsidir='/iscsidir1111' managedaddressmode=dhcp1111 master=$mnip maxssh=81111 mnroutenames=1111 nameservers=$mnip nmapoptions='--min-rtt-timeout 1111' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles1111' ntpservers=$mnip persistkvmguests=1111 powerinterval=1111 ppcmaxp=641111 ppcretry=31111 ppctimeout=1111 precreatemypostchdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 pruneservices=1111 runbootscripts=1111 setinstallnic=1111 sharedinstall=1111 sharedtftp=1111 skiptables=nics1111 skipvalidatelog=1111 snmpc=xc1111 sshbetweennodes=ALLGROUPS1111 svloglocal=1111 syspowerinterval=11111 syspowermaxnodes=11111 tftpdir='/tftprot1111/' tftpflags='-v1111' timezone='America/New_York1111' useNmapfromMN=1111 useflowcontrol=1111 usexhrm=1111 vcenterautojoin=1111 vmwarereconfigonpower=1111 vsftp=1111 xcatconfdir='/etc/xcat1111' xcatdebugmode=1111 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=641111 xcatmaxconnections=61111 xcatsslciphers='3DES' xcatsslversion=TLSv1 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 cleanupxcatpost=1111 consoleondemand=1111 databaseloc='/var/lib1111' db2installloc='/mntdb1111' dbtracelevel=0 defserialflow=1111 defserialport=1111 defserialspeed=9611111111 dhcpinterfaces=eth1111 dhcplease=43211111111 dhcpsetup=1111 disjointdhcps=0 dnshandler=ddns1111 dnsinterfaces='xcatmn|eth1,eth2;service|bond1111' dnsupdaters=dnsupdaters1111 domain='pok1111.stglabs.ibm.com' enableASMI=1111 excludenodes=1111 externaldns=1111 extntpservers=1111 forwarders=$mnip fsptimeout=1111 genmacprefix='11111111:11:aa' genpasswords=1111 hierarchicalattrs=1111 httpport=81111 hwctrldispatch=1111 installdir='/install1111/' installloc='hostname:/path1111' ipmidispatch=1111 ipmimaxp=641111 ipmiretries=31111 ipmisdrcache=1111 ipmitimeout=21111 iscsidir='/iscsidir1111' managedaddressmode=dhcp master=$mnip maxssh=81111 mnroutenames=1111 nameservers=$mnip nmapoptions='--min-rtt-timeout 1111' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles1111' ntpservers=$mnip persistkvmguests=1111 powerinterval=1111 ppcmaxp=641111 ppcretry=31111 ppctimeout=1111 precreatemypostchdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 pruneservices=1111 runbootscripts=1111 setinstallnic=1111 sharedinstall=no sharedtftp=1111 skiptables=nics1111 skipvalidatelog=1111 snmpc=xc1111 sshbetweennodes=ALLGROUPS svloglocal=1111 syspowerinterval=11111 syspowermaxnodes=11111 tftpdir='/tftprot1111/' tftpflags='-v1111' timezone='America/New_York1111' useNmapfromMN=1111 useflowcontrol=1111 usexhrm=1111 vcenterautojoin=1111 vmwarereconfigonpower=1111 vsftp=1111 xcatconfdir='/etc/xcat1111' xcatdebugmode=0 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=641111 xcatmaxconnections=61111 xcatsslciphers='3DES' xcatsslversion=TLSv1 check:rc==0 -cmd:lsdef -t site -o clustersite -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza +cmd:lsdef -t site -o clustersite -z|sed 's/=0$/=1/g' |sort -t'=' -k1 |tee /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/managedaddressmode=dhcp/managedaddressmode=static/g' /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/sharedinstall=no/sharedinstall=sns/g' /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/sshbetweennodes=ALLGROUPS/sshbetweennodes=NOGROUPS/g' /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza check:rc==0 cmd:xcat-inventory export --format=yaml -t site -o clustersite |tee /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv check:rc==0 cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$mnip/$$DSTMN/g" /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv check:rc==0 +cmd:sed -i "s/: '*0'*$/: '1'/g" /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 +cmd:sed -i "s/managedaddressmode: '*dhcp'*/managedaddressmode: 'static'/g" /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 +cmd:sed -i "s/sharedinstall: '*no'*/sharedinstall: 'sns'/g" /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 +cmd:sed -i "s/sshbetweennodes: '*ALLGROUPS'*/sshbetweennodes: 'NOGROUPS'/g" /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv +check:rc==0 cmd:sed -i 's/1111/2222/g' /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv check:rc==0 cmd:cat /tmp/export_site_table_then_modify_yaml_then_import/export_site_yaml.inv @@ -1325,14 +1301,30 @@ cmd: lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_json_th check:rc==0 cmd:ssh $$DSTMN 'lsdef -t site -o clustersite -z >/tmp/export_site_table_then_modify_json_then_import_$$DSTMN/site.stanza ' check:rc==0 -cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 cleanupxcatpost=1111 consoleondemand=1111 databaseloc='/var/lib1111' db2installloc='/mntdb1111' dbtracelevel=1111 defserialflow=1111 defserialport=1111 defserialspeed=9611111111 dhcpinterfaces=eth1111 dhcplease=43211111111 dhcpsetup=1111 disjointdhcps=1111 dnshandler=ddns1111 dnsinterfaces='xcatmn|eth1,eth2;service|bond1111' dnsupdaters=dnsupdaters1111 domain='pok1111.stglabs.ibm.com' enableASMI=1111 excludenodes=1111 externaldns=1111 extntpservers=1111 forwarders=$mnip fsptimeout=1111 genmacprefix='11111111:11:aa' genpasswords=1111 hierarchicalattrs=1111 httpport=81111 hwctrldispatch=1111 installdir='/install1111/' installloc='hostname:/path1111' ipmidispatch=1111 ipmimaxp=641111 ipmiretries=31111 ipmisdrcache=1111 ipmitimeout=21111 iscsidir='/iscsidir1111' managedaddressmode=dhcp1111 master=$mnip maxssh=81111 mnroutenames=1111 nameservers=$mnip nmapoptions='--min-rtt-timeout 1111' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles1111' ntpservers=$mnip persistkvmguests=1111 powerinterval=1111 ppcmaxp=641111 ppcretry=31111 ppctimeout=1111 precreatemypostchdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 pruneservices=1111 runbootscripts=1111 setinstallnic=1111 sharedinstall=1111 sharedtftp=1111 skiptables=nics1111 skipvalidatelog=1111 snmpc=xc1111 sshbetweennodes=ALLGROUPS1111 svloglocal=1111 syspowerinterval=11111 syspowermaxnodes=11111 tftpdir='/tftprot1111/' tftpflags='-v1111' timezone='America/New_York1111' useNmapfromMN=1111 useflowcontrol=1111 usexhrm=1111 vcenterautojoin=1111 vmwarereconfigonpower=1111 vsftp=1111 xcatconfdir='/etc/xcat1111' xcatdebugmode=1111 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=641111 xcatmaxconnections=61111 xcatsslciphers='3DES' xcatsslversion=TLSv1 +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 cleanupxcatpost=1111 consoleondemand=1111 databaseloc='/var/lib1111' db2installloc='/mntdb1111' dbtracelevel=0 defserialflow=1111 defserialport=1111 defserialspeed=9611111111 dhcpinterfaces=eth1111 dhcplease=43211111111 dhcpsetup=1111 disjointdhcps=0 dnshandler=ddns1111 dnsinterfaces='xcatmn|eth1,eth2;service|bond1111' dnsupdaters=dnsupdaters1111 domain='pok1111.stglabs.ibm.com' enableASMI=1111 excludenodes=1111 externaldns=1111 extntpservers=1111 forwarders=$mnip fsptimeout=1111 genmacprefix='11111111:11:aa' genpasswords=1111 hierarchicalattrs=1111 httpport=81111 hwctrldispatch=1111 installdir='/install1111/' installloc='hostname:/path1111' ipmidispatch=1111 ipmimaxp=641111 ipmiretries=31111 ipmisdrcache=1111 ipmitimeout=21111 iscsidir='/iscsidir1111' managedaddressmode=dhcp master=$mnip maxssh=81111 mnroutenames=1111 nameservers=$mnip nmapoptions='--min-rtt-timeout 1111' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles1111' ntpservers=$mnip persistkvmguests=1111 powerinterval=1111 ppcmaxp=641111 ppcretry=31111 ppctimeout=1111 precreatemypostchdef -t site -o clustersite useSSHonAIX=1111 useNFSv4onAIX=1111 FQDNfirst=1111 SNsyncfiledir='/var/xcat/1111' auditnosyslog=1111 auditskipcmds=ALL blademaxp=641111 pruneservices=1111 runbootscripts=1111 setinstallnic=1111 sharedinstall=no sharedtftp=1111 skiptables=nics1111 skipvalidatelog=1111 snmpc=xc1111 sshbetweennodes=ALLGROUPS svloglocal=1111 syspowerinterval=11111 syspowermaxnodes=11111 tftpdir='/tftprot1111/' tftpflags='-v1111' timezone='America/New_York1111' useNmapfromMN=1111 useflowcontrol=1111 usexhrm=1111 vcenterautojoin=1111 vmwarereconfigonpower=1111 vsftp=1111 xcatconfdir='/etc/xcat1111' xcatdebugmode=0 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=641111 xcatmaxconnections=61111 xcatsslciphers='3DES' xcatsslversion=TLSv1 check:rc==0 -cmd:lsdef -t site -o clustersite -z|sed 's/1111/2222/g'|sort -t'=' -k1 |tee /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza +cmd:lsdef -t site -o clustersite -z|sed 's/=0$/=1/g' |sort -t'=' -k1 |tee /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/1111/2222/g' /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/managedaddressmode=dhcp/managedaddressmode=static/g' /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/sharedinstall=no/sharedinstall=sns/g' /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza +check:rc==0 +cmd:sed -i 's/sshbetweennodes=ALLGROUPS/sshbetweennodes=NOGROUPS/g' /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza check:rc==0 cmd:xcat-inventory export --format=json -t site -o clustersite |tee /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv check:rc==0 cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/$mnip/$$DSTMN/g" /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv check:rc==0 +cmd:sed -i 's/"0"/"1"/g' /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 +cmd:sed -i 's/"managedaddressmode": "dhcp"/"managedaddressmode": "static"/g' /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 +cmd:sed -i 's/"sharedinstall": "no"/"sharedinstall": "sns"/g' /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 +cmd:sed -i 's/"sshbetweennodes": "ALLGROUPS"/"sshbetweennodes": "NOGROUPS"/g' /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv +check:rc==0 cmd:sed -i 's/1111/2222/g' /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv check:rc==0 cmd:cat /tmp/export_site_table_then_modify_json_then_import/export_site_json.inv From 0d5317df7fcd5fbcb96ac4cce26222d8ecdee593 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 7 Mar 2018 02:10:28 -0500 Subject: [PATCH 007/161] show node name with error msg for ipmi --- xCAT-server/lib/xcat/plugins/ipmi.pm | 49 ++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index a47df379a..7e38aa817 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -8264,13 +8264,20 @@ sub preprocess_request { return; } + my $all_noderange = $realnoderange; + if ($command eq "rpower") { my $subcmd = $exargs[0]; if ($subcmd eq '') { #$callback->({data=>["Please enter an action (eg: boot,off,on, etc)", $usage_string]}); #Above statement will miss error code, so replaced by the below statement - $callback->({ errorcode => [1], data => [ "Please enter an action (eg: boot,off,on, etc)", $usage_string ] }); + my $error_data = ""; + foreach (@$all_noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$_: Please enter an action (eg: boot,off,on, etc)"; + } + $callback->({ errorcode => [1], data => [ $error_data, $usage_string ] }); $request = {}; return 0; } @@ -8284,13 +8291,23 @@ sub preprocess_request { #$callback->({data=>["Unsupported command: $command $subcmd", $usage_string]}); #Above statement will miss error code, so replaced by the below statement - $callback->({ errorcode => [1], data => [ "Unsupported command: $command $subcmd", $usage_string ] }); + my $error_data = ""; + foreach (@$all_noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$_: Error: Unsupported command: $command $subcmd"; + } + $callback->({ errorcode => [1], data => [ $error_data, $usage_string ] }); $request = {}; return; } if (($subcmd eq 'on' or $subcmd eq 'reset' or $subcmd eq 'boot') and $::XCATSITEVALS{syspowerinterval}) { unless ($::XCATSITEVALS{syspowermaxnodes}) { - $callback->({ errorcode => [1], error => ["IPMI plugin requires syspowermaxnodes be defined if syspowerinterval is defined"] }); + my $error_data = ""; + foreach (@$all_noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$_: IPMI plugin requires syspowermaxnodes be defined if syspowerinterval is defined"; + } + $callback->({ errorcode => [1], error => [$error_data] }); $request = {}; return 0; } @@ -8312,10 +8329,15 @@ sub preprocess_request { if ($realnoderange) { my $optset; my $option; + my $error_data = ""; foreach (@exargs) { if ($_ =~ /^(\w+)=(.*)/) { if ($optset eq 0) { - $callback->({ errorcode => [1], data => [ "Usage Error: Cannot display and change attributes on the same command."] }); + foreach (@$all_noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command."; + } + $callback->({ errorcode => [1], data => [ $error_data] }); $request = {}; return; } @@ -8323,7 +8345,11 @@ sub preprocess_request { $option = $1; } else { if ($optset eq 1) { - $callback->({ errorcode => [1], data => [ "Usage Error: Cannot display and change attributes on the same command."] }); + foreach (@$all_noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command."; + } + $callback->({ errorcode => [1], data => [ $error_data] }); $request = {}; return; } @@ -8331,7 +8357,11 @@ sub preprocess_request { $optset = 0; } unless ($option =~ /^USERID$|^ip$|^netmask$|^gateway$|^vlan$|^userid$|^username$|^password$|^snmpdest|^thermprofile$|^alert$|^garp$|^community$|^backupgateway$/) { - $callback->({ errorcode => [1], data => [ "Unsupported command: $command $_"] }); + foreach (@$all_noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$_: Error: Unsupported command: $command $option"; + } + $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; return; } @@ -8341,7 +8371,12 @@ sub preprocess_request { if ($exargs[0] eq "-t" and $#exargs == 0) { unshift @{ $request->{arg} }, 'all'; } elsif ((grep /-t/, @exargs) and !(grep /(all|vpd)/, @exargs)) { - $callback->({ errorcode => [1], error => ["option '-t' can only work with 'all' or 'vpd'"] }); + my $error_data = ""; + foreach (@$all_noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$_: option '-t' can only work with 'all' or 'vpd"; + } + $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; return 0; } From 706068f688f5d5939ccec26444e9478ef018627a Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 8 Mar 2018 11:24:52 -0500 Subject: [PATCH 008/161] UT cases --- .../UT_openbmc/reventlog_resolved_cases0 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/xCAT-test/autotest/testcase/UT_openbmc/reventlog_resolved_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/reventlog_resolved_cases0 index c63d172dd..43b9a6410 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/reventlog_resolved_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/reventlog_resolved_cases0 @@ -33,3 +33,30 @@ cmd:reventlog $$CN resolved=-1 check:rc==1 check:output=~Error: Invalid ID= end + +start:reventlog_resolved_parse_error5 +description: Pass in a string +os:Linux +hcp:openbmc +cmd:reventlog $$CN resolved=abc +check:rc==1 +check:output=~Error: Invalid ID= +end + +start:reventlog_resolved_list +description: Pass in a list of ids +os:Linux +hcp:openbmc +cmd:reventlog $$CN resolved=100,101 +check:rc==0 +check:output=~Attempting to resolve the following log entries: 100,101... +end + +start:reventlog_resolved_LED +description: Pass in a LED keyword +os:Linux +hcp:openbmc +cmd:reventlog $$CN resolved=Led +check:rc==0 +check:output=~Attempting to resolve the following log entries: Led... +end From f1d337ababec2ce76a6fbba4a18035c46ebbb684 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 9 Mar 2018 00:18:29 -0500 Subject: [PATCH 009/161] update test cases for xcat-inventory new code --- .../testcase/xcat-inventory/cases.node | 251 ++++++++++++++++-- 1 file changed, 222 insertions(+), 29 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.node b/xCAT-test/autotest/testcase/xcat-inventory/cases.node index 35a351bb5..6a266624c 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.node +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.node @@ -223,7 +223,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_json/srcbogusnode.stanza check:rc==0 @@ -275,7 +275,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_yaml/srcbogusnode.stanza check:rc==0 @@ -532,7 +532,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=DES snmpusername=snmpusername snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_json/srcbogusnode.stanza check:rc==0 @@ -583,7 +583,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=snmpprivacy snmpusername=snmpusername snmpversion=snmpversion storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=DES snmpusername=snmpusername snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_yaml/srcbogusnode.stanza check:rc==0 @@ -918,32 +918,63 @@ node: engine_type: openbmc hardware_mgt_engine: engine_info: + bmc: '|\D+(\d+)|10.100.100.($1)|' bmcpassword: 0penBmc bmcusername: root engine_type: openbmc netboot_engine: engine_type: petitboot - network_info: - primarynic: - ip: '|\D+(\d+)|10.100.100.($1)|' obj_info: grouptype: static obj_type: group role: compute bogusnode1: device_type: server + engines: + console_engine: + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.100.100.1 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot obj_info: groups: bogusgroup obj_type: node role: compute bogusnode2: device_type: server + engines: + console_engine: + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.100.100.2 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot obj_info: groups: bogusgroup obj_type: node role: compute bogusnode3: device_type: server + engines: + console_engine: + engine_type: openbmc + hardware_mgt_engine: + engine_info: + bmc: 10.100.100.3 + bmcpassword: 0penBmc + bmcusername: root + engine_type: openbmc + netboot_engine: + engine_type: petitboot obj_info: groups: bogusgroup obj_type: node @@ -966,6 +997,12 @@ node: obj_type: group role: compute osimage: + bogus_image: + addkcmdline: aaaa + boottarget: aaa + imagetype: linux + provision_mode: statelite + role: compute rhels7.4-ppc64le-install-compute: basic_attributes: arch: ppc64le @@ -1133,29 +1170,29 @@ cmd:#!/bin/bash echo "# bogusnode1: objtype=node + bmc=10.100.100.1 bmcpassword=0penBmc bmcusername=root cons=openbmc groups=bogusgroup - ip=10.100.100.1 mgt=openbmc netboot=petitboot bogusnode2: objtype=node + bmc=10.100.100.2 bmcpassword=0penBmc bmcusername=root cons=openbmc groups=bogusgroup - ip=10.100.100.2 mgt=openbmc netboot=petitboot bogusnode3: objtype=node + bmc=10.100.100.3 bmcpassword=0penBmc bmcusername=root cons=openbmc groups=bogusgroup - ip=10.100.100.3 mgt=openbmc netboot=petitboot" > /tmp/xcat_inventory_try_to_import_all_type_is_node_yaml_format/node_stanza_from_import_file check:rc==0 @@ -1211,10 +1248,9 @@ echo '{ }, "hardware_mgt_engine": { "engine_info": { - "openbmc_info": { - "bmcpassword": "0penBmc", - "bmcusername": "root" - } + "bmc": "|\\D+(\\d+)|10.100.100.($1)|", + "bmcpassword": "0penBmc", + "bmcusername": "root" }, "engine_type": "openbmc" }, @@ -1222,11 +1258,6 @@ echo '{ "engine_type": "petitboot" } }, - "network_info": { - "primarynic": { - "ip": "|\\D+(\\d+)|10.100.100.($1)|" - } - }, "obj_info": { "grouptype": "static" }, @@ -1235,6 +1266,22 @@ echo '{ }, "bogusnode1": { "device_type": "server", + "engines": { + "console_engine": { + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.100.100.1", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + } + }, "obj_info": { "groups": "bogusgroup" }, @@ -1243,6 +1290,22 @@ echo '{ }, "bogusnode2": { "device_type": "server", + "engines": { + "console_engine": { + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.100.100.2", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + } + }, "obj_info": { "groups": "bogusgroup" }, @@ -1251,6 +1314,22 @@ echo '{ }, "bogusnode3": { "device_type": "server", + "engines": { + "console_engine": { + "engine_type": "openbmc" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.100.100.3", + "bmcpassword": "0penBmc", + "bmcusername": "root" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_type": "petitboot" + } + }, "obj_info": { "groups": "bogusgroup" }, @@ -1284,6 +1363,13 @@ echo '{ } }, "osimage": { + "bogus_image": { + "addkcmdline": "aaaa", + "boottarget": "aaa", + "imagetype": "linux", + "provision_mode": "statelite", + "role": "compute" + }, "rhels7.4-ppc64le-install-compute": { "basic_attributes": { "arch": "ppc64le", @@ -1440,7 +1526,7 @@ echo '{ "route": {}, "schema_version": "1.0", "site": { - "cluster": { + "clustersite": { "SNsyncfiledir": "/var/xcat/syncfiles", "auditnosyslog": "0", "auditskipcmds": "ALL", @@ -1487,29 +1573,29 @@ cmd:#!/bin/bash echo "# bogusnode1: objtype=node + bmc=10.100.100.1 bmcpassword=0penBmc bmcusername=root cons=openbmc groups=bogusgroup - ip=10.100.100.1 mgt=openbmc netboot=petitboot bogusnode2: objtype=node + bmc=10.100.100.2 bmcpassword=0penBmc bmcusername=root cons=openbmc groups=bogusgroup - ip=10.100.100.2 mgt=openbmc netboot=petitboot bogusnode3: objtype=node + bmc=10.100.100.3 bmcpassword=0penBmc bmcusername=root cons=openbmc groups=bogusgroup - ip=10.100.100.3 mgt=openbmc netboot=petitboot" > /tmp/xcat_inventory_try_to_import_all_type_is_node_json_format/node_stanza_from_import_file check:rc==0 @@ -1630,9 +1716,19 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=1111 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 hcp=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=1111 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=1111 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=1111 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1111 setupdhcp=1111 setupftp=1111 setupipforward=1111 setupldap=1111 setupnameserver=1111 setupnfs=1111 setupnim=1111 setupntp=1111 setupproxydhcp=1111 setuptftp=1111 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=ppc64 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=10.10.10.10 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=42:d6:0a:03:05:08 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=grub2 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1 setupdhcp=1 setupftp=1111 setupipforward=1 setupldap=1 setupnameserver=1 setupnfs=1 setupnim=1111 setupntp=1 setupproxydhcp=1 setuptftp=1 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused cmd:lsdef bogusnode -z|sed 's/1111/2222/g'|sed 's/unused/used/g'|sed 's/10.10.100.9/20.10.200.9/g'|sort -t'=' -k1 |tee /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza check:rc==0 +cmd:sed -i 's/arch=ppc64/arch=ppc64le/g' /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza +check:rc==0 +cmd:sed -i 's/ip=10.10.10.10/ip=10.20.10.20/g' /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza +check:rc==0 +cmd:sed -i 's/mac=42:d6:0a:03:05:08/mac=42:d6:0a:03:05:09/g' /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza +check:rc==0 +cmd:sed -i 's/netboot=grub2/netboot=petitboot/g' /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza +check:rc==0 +cmd:a=('setuptftp' 'setupnameserver' 'setupdhcp' 'setupntp' 'setupldap' 'setupproxydhcp' 'setupipforward' 'setupconserver' 'setupnfs');for i in ${a[@]};do sed -i "s/$i=1/$i=0/g" /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza; done +check:rc==0 cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv check:rc==0 cmd:sed -i 's/1111/2222/g' /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv @@ -1641,6 +1737,18 @@ cmd:sed -i 's/unused/used/g' /tmp/export_single_node_then_modify_yaml_then_impor check:rc==0 cmd:sed -i 's/10.10.100.9/20.10.200.9/g' /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv check:rc==0 + +cmd:sed -i "s/arch: '*ppc64'*/arch: 'ppc64le'/g" /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:sed -i "s/ip: '*10.10.10.10'*/ip: '10.20.10.20'/g" /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:sed -i 's/- 42:d6:0a:03:05:08/- 42:d6:0a:03:05:09/g' /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:sed -i 's/ grub2/ petitboot/g' /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv +check:rc==0 +cmd:a=('setuptftp' 'setupnameserver' 'setupdhcp' 'setupntp' 'setupldap' 'setupproxydhcp' 'setupipforward' 'setupconserver' 'setupnfs');for i in ${a[@]};do sed -i "s/$i: '*1'*/$i: '0'/g" /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv; done +check:rc==0 + cmd:scp /tmp/export_single_node_then_modify_yaml_then_import/bogusnode_yaml.inv $$DSTMN:/tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/ check:rc==0 cmd:rmdef bogusnode @@ -1686,9 +1794,19 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=1111 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 hcp=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=1111 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=1111 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=1111 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1111 setupdhcp=1111 setupftp=1111 setupipforward=1111 setupldap=1111 setupnameserver=1111 setupnfs=1111 setupnim=1111 setupntp=1111 setupproxydhcp=1111 setuptftp=1111 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=ppc64 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=10.10.10.10 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=42:d6:0a:03:05:08 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=grub2 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1 setupdhcp=1 setupftp=1111 setupipforward=1 setupldap=1 setupnameserver=1 setupnfs=1 setupnim=1111 setupntp=1 setupproxydhcp=1 setuptftp=1 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused cmd:lsdef bogusnode -z|sed 's/1111/2222/g'|sed 's/unused/used/g'|sed 's/10.10.100.9/20.10.200.9/g'|sort -t'=' -k1 |tee /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza check:rc==0 +cmd:sed -i 's/arch=ppc64/arch=ppc64le/g' /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza +check:rc==0 +cmd:sed -i 's/ip=10.10.10.10/ip=10.20.10.20/g' /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza +check:rc==0 +cmd:sed -i 's/mac=42:d6:0a:03:05:08/mac=42:d6:0a:03:05:09/g' /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza +check:rc==0 +cmd:sed -i 's/netboot=grub2/netboot=petitboot/g' /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza +check:rc==0 +cmd:a=('setuptftp' 'setupnameserver' 'setupdhcp' 'setupntp' 'setupldap' 'setupproxydhcp' 'setupipforward' 'setupconserver' 'setupnfs');for i in ${a[@]};do sed -i "s/$i=1/$i=0/g" /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza; done +check:rc==0 cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv check:rc==0 cmd:sed -i 's/1111/2222/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv @@ -1697,6 +1815,16 @@ cmd:sed -i 's/unused/used/g' /tmp/export_single_node_then_modify_json_then_impor check:rc==0 cmd:sed -i 's/10.10.100.9/20.10.200.9/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv check:rc==0 +cmd:sed -i 's/"arch": "ppc64"/"arch": "ppc64le"/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:sed -i 's/"ip": "10.10.10.10"/"ip": "10.20.10.20"/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:sed -i 's/"42:d6:0a:03:05:08"/"42:d6:0a:03:05:09"/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:sed -i 's/ "grub2"/ "petitboot"/g' /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv +check:rc==0 +cmd:a=('setuptftp' 'setupnameserver' 'setupdhcp' 'setupntp' 'setupldap' 'setupproxydhcp' 'setupipforward' 'setupconserver' 'setupnfs');for i in ${a[@]};do sed -i "s/\"$i\": \"1\"/\"$i\": \"0\"/g" /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv; done +check:rc==0 cmd:scp /tmp/export_single_node_then_modify_json_then_import/bogusnode_json.inv $$DSTMN:/tmp/export_single_node_then_modify_json_then_import_$$DSTMN/ check:rc==0 cmd:rmdef bogusnode @@ -1749,6 +1877,8 @@ cmd: lsdef -t node -o bogusnode[1-3] > /tmp/export_import_single_group_json/targ check:rc==0 cmd: lsdef -t group -o bogusgroup >> /tmp/export_import_single_group_json/target_nodes_group check:rc==0 +cmd:sed -e 's/members=.*$/members='"$(awk -F = '/members=/ { print $2 }' < /tmp/export_import_single_group_json/target_nodes_group | tr , ' ' | xargs -n 1 | sort -g | xargs -n 999 | tr ' ' ,)"'/' < /tmp/export_import_single_group_json/target_nodes_group > /tmp/export_import_single_group_json/target_nodes_group.1; cp -f /tmp/export_import_single_group_json/target_nodes_group.1 /tmp/export_import_single_group_json/target_nodes_group +check:rc==0 cmd:xcat-inventory export --format=json -t node -o bogusnode1,bogusnode2,bogusnode3,bogusgroup |tee /tmp/export_import_single_group_json/export.file check:rc==0 cmd:scp /tmp/export_import_single_group_json/export.file $$DSTMN:/tmp/export_import_single_group_json_$$DSTMN/ @@ -1765,16 +1895,18 @@ cmd:ssh $$DSTMN 'lsdef -t group -o bogusgroup >> /tmp/export_import_single_grou check:rc==0 cmd:scp $$DSTMN:/tmp/export_import_single_group_json_$$DSTMN/import_nodes_group /tmp/export_import_single_group_json/import_nodes_group check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t node -o bogusnode[1-3]' +check:rc==0 +cmd: ssh $$DSTMN 'rmdef -t group -o bogusgroup' +check:rc==0 +cmd:sed -e 's/members=.*$/members='"$(awk -F = '/members=/ { print $2 }' < /tmp/export_import_single_group_json/import_nodes_group | tr , ' ' | xargs -n 1 | sort -g | xargs -n 999 | tr ' ' ,)"'/' < /tmp/export_import_single_group_json/import_nodes_group > /tmp/export_import_single_group_json/import_nodes_group.1; cp -rf /tmp/export_import_single_group_json/import_nodes_group.1 /tmp/export_import_single_group_json/import_nodes_group +check:rc==0 cmd:diff -y /tmp/export_import_single_group_json/target_nodes_group /tmp/export_import_single_group_json/import_nodes_group check:rc==0 cmd:if [[ -e /tmp/export_import_single_group_json/bogusnode.stanza ]]; then cat /tmp/export_import_single_group_json/bogusnode.stanza | mkdef -z;fi check:rc==0 cmd:if [[ -e /tmp/export_import_single_group_json/bogusgroup.stanza ]];then cat /tmp/export_import_single_group_json/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:ssh $$DSTMN 'rmdef -t node -o bogusnode[1-3]' -check:rc==0 -cmd:ssh $$DSTMN 'rmdef -t group -o bogusgroup' -check:rc==0 cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_group_json_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_group_json_$$DSTMN/bogusnode.stanza | mkdef -z;fi' check:rc==0 cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_group_json_$$DSTMN/bogusgroup.stanza ]];then cat /tmp/export_import_single_group_json_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' @@ -1785,6 +1917,67 @@ cmd:rm -rf /tmp/export_import_single_group_json check:rc==0 end +start:export_import_single_group_yaml +description:This case is used to test xcat-inventory export and import the definition of group +cmd:mkdir -p /tmp/export_import_single_group_yaml +check:rc==0 +cmd:ssh $$DSTMN 'mkdir -p /tmp/export_import_single_group_yaml_$$DSTMN/' +check:rc==0 +cmd:for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_single_group_yaml/bogusnode.stanza ;rmdef bogusnode$i;fi; done +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_group_yaml/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:ssh $$DSTMN 'for i in 1 2 3; do lsdef bogusnode$i > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode$i -z >> /tmp/export_import_single_group_yaml_$$DSTMN/bogusnode.stanza ;rmdef bogusnode$i;fi; done' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_group_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' +check:rc==0 +cmd:mkdef -t group -o bogusgroup mgt=openbmc cons=openbmc netboot=petitboot ip='|\D+(\d+)|10.100.100.($1)|' bmcusername=root bmcpassword=0penBmc +check:rc==0 +cmd: mkdef -t node -o bogusnode[1-3] groups=bogusgroup +check:rc==0 +cmd: lsdef -t node -o bogusnode[1-3] > /tmp/export_import_single_group_yaml/target_nodes_group +check:rc==0 +cmd: lsdef -t group -o bogusgroup >> /tmp/export_import_single_group_yaml/target_nodes_group +check:rc==0 +cmd:sed -e 's/members=.*$/members='"$(awk -F = '/members=/ { print $2 }' < /tmp/export_import_single_group_yaml/target_nodes_group | tr , ' ' | xargs -n 1 | sort -g | xargs -n 999 | tr ' ' ,)"'/' < /tmp/export_import_single_group_yaml/target_nodes_group > /tmp/export_import_single_group_yaml/target_nodes_group.1; cp -f /tmp/export_import_single_group_yaml/target_nodes_group.1 /tmp/export_import_single_group_yaml/target_nodes_group +check:rc==0 +cmd:xcat-inventory export --format=yaml -t node -o bogusnode1,bogusnode2,bogusnode3,bogusgroup |tee /tmp/export_import_single_group_yaml/export.file +check:rc==0 +cmd:scp /tmp/export_import_single_group_yaml/export.file $$DSTMN:/tmp/export_import_single_group_yaml_$$DSTMN/ +check:rc==0 +cmd:rmdef -t node -o bogusnode[1-3] +check:rc==0 +cmd:rmdef -t group -o bogusgroup +check:rc==0 +cmd:ssh $$DSTMN 'xcat-inventory import -f /tmp/export_import_single_group_yaml_$$DSTMN/export.file -t node -o bogusnode1,bogusnode2,bogusnode3,bogusgroup' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t node -o bogusnode[1-3] > /tmp/export_import_single_group_yaml_$$DSTMN/import_nodes_group' +check:rc==0 +cmd:ssh $$DSTMN 'lsdef -t group -o bogusgroup >> /tmp/export_import_single_group_yaml_$$DSTMN/import_nodes_group' +check:rc==0 +cmd:scp $$DSTMN:/tmp/export_import_single_group_yaml_$$DSTMN/import_nodes_group /tmp/export_import_single_group_yaml/import_nodes_group +check:rc==0 +cmd:ssh $$DSTMN 'rmdef -t node -o bogusnode[1-3]' +check:rc==0 +cmd: ssh $$DSTMN 'rmdef -t group -o bogusgroup' +check:rc==0 +cmd:sed -e 's/members=.*$/members='"$(awk -F = '/members=/ { print $2 }' < /tmp/export_import_single_group_yaml/import_nodes_group | tr , ' ' | xargs -n 1 | sort -g | xargs -n 999 | tr ' ' ,)"'/' < /tmp/export_import_single_group_yaml/import_nodes_group > /tmp/export_import_single_group_yaml/import_nodes_group.1; cp -rf /tmp/export_import_single_group_yaml/import_nodes_group.1 /tmp/export_import_single_group_yaml/import_nodes_group +check:rc==0 +cmd:diff -y /tmp/export_import_single_group_yaml/target_nodes_group /tmp/export_import_single_group_yaml/import_nodes_group +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_group_yaml/bogusnode.stanza ]]; then cat /tmp/export_import_single_group_yaml/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/export_import_single_group_yaml/bogusgroup.stanza ]];then cat /tmp/export_import_single_group_yaml/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_group_yaml_$$DSTMN/bogusnode.stanza ]]; then cat /tmp/export_import_single_group_yaml_$$DSTMN/bogusnode.stanza | mkdef -z;fi' +check:rc==0 +cmd:ssh $$DSTMN 'if [[ -e /tmp/export_import_single_group_yaml_$$DSTMN/bogusgroup.stanza ]];then cat /tmp/export_import_single_group_yaml_$$DSTMN/bogusgroup.stanza |mkdef -z -f;fi' +check:rc==0 +cmd:ssh $$DSTMN 'rm -rf /tmp/export_import_single_group_yaml_$$DSTMN/' +check:rc==0 +cmd:rm -rf /tmp/export_import_single_group_yaml +check:rc==0 +end start:import_validation_json_node_obj_type description:This case is used to test node validation function of xcat-inventory import json file. To test "obj_type" attribute From 549ee35a493e45a3c827ffe4f815321386c6986c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 13 Mar 2018 11:15:18 -0400 Subject: [PATCH 010/161] Display Perl/Python for OpenBMC commands with -V --- xCAT-server/lib/xcat/plugins/openbmc.pm | 3 +++ xCAT-server/lib/xcat/plugins/openbmc2.pm | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 41f6ed99d..5bbc34877 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -908,6 +908,9 @@ sub process_request { my $rst = parse_command_status($command, \@exargs); return if ($rst); + if ($::VERBOSE) { + xCAT::SvrUtils::sendmsg("Running command in Perl", $callback); + } if ($request->{command}->[0] ne "getopenbmccons") { $cookie_jar = HTTP::Cookies->new({}); $async = HTTP::Async->new( diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index f4c750777..61d49c733 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -47,6 +47,7 @@ my $reventlog_no_id_resolved_errormsg = "Provide a comma separated list of IDs t my %node_info = (); my $callback; +$::VERBOSE = 0; #------------------------------------------------------- @@ -92,6 +93,9 @@ sub preprocess_request { return; } + if ($::VERBOSE) { + xCAT::SvrUtils::sendmsg("Running command in Python", $callback); + } my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN"); foreach my $snkey (keys %$sn) { my $reqcopy = {%$request}; @@ -157,9 +161,8 @@ sub parse_args { my $noderange = shift; my $subcommand = undef; - my $verbose; unless (GetOptions( - 'V|verbose' => \$verbose, + 'V|verbose' => \$::VERBOSE, )) { return ([ 1, "Error parsing arguments." ]); } From ba2c179904839e13e0a3906583f64db99a87b075 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 13 Mar 2018 11:35:52 -0400 Subject: [PATCH 011/161] Add new testcase to test deleting an active BMC image --- xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 index 83f596e8c..ec306a460 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 @@ -70,3 +70,14 @@ cmd: rflash $$CN --delete 221d9020 221d9020 check:rc==1 check:output=~Error: More than one firmware specified is not supported end + +start:rflash_delete_active_bmc +description: Attempt to delete the active BMC firmware +os:Linux +hcp:openbmc +cmd: rflash $$CN -l | grep \* | grep BMC | awk '{print $2}' | xargs -i{} rflash $$CN --delete {} +check:rc==1 +check:output=~ + + +./xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 From 52939c94c02f0be843e088f74d4fb2d57eea29c1 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 13 Mar 2018 11:36:12 -0400 Subject: [PATCH 012/161] start to add UT cases for the success case, this allows us to easily run sanity test on all the BMC commands --- .../UT_openbmc/supported_commands_case0 | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 diff --git a/xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 b/xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 new file mode 100644 index 000000000..82e8dbdc3 --- /dev/null +++ b/xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 @@ -0,0 +1,36 @@ +start:supported_cmds_rpower +description: Make sure the rpower command works ... +os:Linux +hcp:openbmc +cmd:rpower $$CN state +check:rc==0 +check:output=~$$CN: +cmd: rpower $$CN bmcstate +check:rc==0 +check:output=~$$CN: BMC +end + +start:supported_cmds_rinv +description: Make sure that the rinv command works... +os:Linux +hcp:openbmc +cmd: rinv $$CN +check:rc==0 +check:output=~$$CN: +cmd: rinv $$CN model +check:rc==0 +check:output=~$$CN: SYSTEM Model +cmd: rinv $$CN serial +check:rc==0 +check:output=~$$CN: SYSTEM SerialNumber +cmd: rinv $$CN firm +check:rc==0 +check:output=~$$CN: HOST Firmware +check:output=~$$CN: BMC Firmware +cmd: rinv $$CN cpu +check:rc==0 +check:output=~$$CN: CPU +cmd: rinv $$CN dimm +check:rc==0 +check:output=~$$CN: DIMM +end From c61a253a457440d0c9f1599255e73f714c1f4c72 Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Wed, 14 Mar 2018 11:27:38 +0800 Subject: [PATCH 013/161] Update Version --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index 3c5ed7828..123a39a8e 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.13.11 +2.14 From c0314a36b6d8e4bb736aa8ae0b81005d274394b9 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Wed, 14 Mar 2018 13:49:08 +0800 Subject: [PATCH 014/161] enhance invalid node name error msg (#4931) --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 221c12819..abc9174d0 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1554,6 +1554,7 @@ sub defmk } else { my $invalidobjname = (); my $invalidnodename = (); + my $nodewithdomain = (); foreach my $node (@::allobjnames) { my $myobjtype=$::opt_t; if(!$myobjtype and $::FILEATTRS{$node}{'objtype'}){ @@ -1563,10 +1564,22 @@ sub defmk unless(isobjnamevalid($node,$myobjtype)){ $invalidobjname .= ",$node"; } - if (($node =~ /[A-Z]/) && (((!$::opt_t) && (!$::FILEATTRS{$node}{'objtype'})) || ($::FILEATTRS{$node}{'objtype'} eq "node") || ($::opt_t eq "node"))) { - $invalidnodename .= ",$node"; + if (((!$::opt_t) && (!$::FILEATTRS{$node}{'objtype'})) || ($::FILEATTRS{$node}{'objtype'} eq "node") || ($::opt_t eq "node")) { + if($node =~ /[A-Z]/){ + $invalidnodename .= ",$node"; + }elsif($node =~ /\./){ + $nodewithdomain .= ",$node"; + } } } + if ($nodewithdomain) { + $nodewithdomain =~ s/,//; + my $rsp; + $rsp->{data}->[0] = "The object name \'$nodewithdomain\' is invalid, Cannot use '.' in node name."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + $error = 1; + return 1; + } if ($invalidobjname) { $invalidobjname =~ s/,//; my $rsp; From 84ad957d3f305c955e2c5021906617e48fafc67f Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 14 Mar 2018 03:56:44 -0400 Subject: [PATCH 015/161] fix issue 4856: rewrite parse_args for rspconfig --- xCAT-server/lib/xcat/plugins/openbmc2.pm | 114 ++++++++++++++++++++++- 1 file changed, 111 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index f4c750777..ebc5e26a9 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -16,7 +16,6 @@ use Getopt::Long; use xCAT::Usage; use xCAT::SvrUtils; use xCAT::OPENBMC; -use xCAT_plugin::openbmc; #------------------------------------------------------- @@ -90,6 +89,10 @@ sub preprocess_request { $callback->({ errorcode => [$parse_result->[0]], data => [$error_data] }); $request = {}; return; + } elsif ($command eq 'rspconfig') { + $callback->({ data => ["rspconfig is fine"]}); + $request = {}; + return; } my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN"); @@ -142,6 +145,11 @@ sub process_request { xCAT::OPENBMC::wait_agent($pid, $callback); } +my @rsp_common_options = qw/autoreboot bootmode powersupplyredundancy powerrestorepolicy timesyncmethod + ip netmask gateway hostname vlan ntpservers/; +my @rspconfig_set_options = (@rsp_common_options, qw/admin_passwd/); + +my @rspconfig_get_options = (@rsp_common_options, qw/ipsrc sshcfg gard dump/); #------------------------------------------------------- =head3 parse_args @@ -166,7 +174,7 @@ sub parse_args { if (scalar(@ARGV) >= 2 and ($command =~ /rbeacon|rinv|rpower|rvitals/)) { return ([ 1, "Only one option is supported at the same time for $command" ]); - } elsif (scalar(@ARGV) == 0 and $command =~ /rbeacon|rpower|rflash/) { + } elsif (scalar(@ARGV) == 0 and $command =~ /rbeacon|rspconfig|rpower|rflash/) { return ([ 1, "No option specified for $command" ]); } else { $subcommand = $ARGV[0]; @@ -248,7 +256,107 @@ sub parse_args { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq 'rspconfig') { - xCAT_plugin::openbmc::parse_args('rspconfig', $extrargs, $noderange); + my $num_subcommand = @ARGV; + my ($set, $get); + my $all_subcommand = ""; + my %set_net_info = (); + foreach $subcommand (@ARGV) { + my ($key, $value); + if ($subcommand =~ /^(\w+)=(.*)/) { + $key = $1; + $value = $2; + $set = 1; + } else { + $key = $subcommand; + $get = 1; + } + if ($set and $get) { + return ([1, "Can not set and query OpenBMC information at the same time"]); + } elsif ($set and $value eq '') { + return ([1, "Invalid parameter for option $key"]); + } + if (($set and !grep /$key/, @rspconfig_set_options) or + ($get and !grep /$key/, @rspconfig_get_options)) { + return ([1, "Unsupported command: $command $subcommand"]); + } + if ($set) { + if ($key =~ /^hostname$|^admin_passwd$|^ntpservers$/ and $num_subcommand > 1) { + return([1, "The option '$key' can not work with other options"]); + } + elsif ($key eq "admin_passwd") { + if ($value =~ /(.*),(.*)/) { + if ($1 eq '' or $2 eq '') { + return([1, "Invalid parameter for option $key: $value"]); + } + } else { + return([1, "Invalid parameter for option $key: $value"]); + } + } + elsif ($key eq "netmask") { + if (!xCAT::NetworkUtils->isIpaddr($value)) { + return ([ 1, "Invalid parameter for option $key: $value" ]); + } + $set_net_info{"netmask"} = 1; + } + elsif ($key eq "gateway") { + if ($value ne "0.0.0.0" and !xCAT::NetworkUtils->isIpaddr($value)) { + return ([ 1, "Invalid parameter for option $key: $value" ]); + } + $set_net_info{"gateway"} = 1; + } + elsif ($key eq "vlan") { + $set_net_info{"vlan"} = 1; + } + elsif ($key eq "ip") { + if ($value ne "dhcp") { + if (@$noderange > 1) { + return ([ 1, "Can not configure more than 1 nodes' ip at the same time" ]); + } elsif (!xCAT::NetworkUtils->isIpaddr($value)) { + return ([ 1, "Invalid parameter for option $key: $value" ]); + } + $set_net_info{"ip"} = 1; + } elsif($num_subcommand > 1) { + return ([ 1, "Setting ip=dhcp must be issued without other options." ]); + } + } + } else { + if ($key eq "sshcfg" and $num_subcommand > 1) { + return ([ 1, "Configure sshcfg must be issued without other options." ]); + } + elsif ($key eq "gard") { + if ($num_subcommand > 2) { + return ([ 1, "Clear GARD cannot be issued with other options." ]); + } elsif (!defined($ARGV[1]) or $ARGV[1] !~ /^-c$|^--clear$/) { + return ([ 1, "Invalid parameter for $command $key" ]); + } + return; + } + elsif ($key eq "dump") { + my $dump_option = ""; + $dump_option = $ARGV[1] if (defined $ARGV[1]); + if ($dump_option =~ /^-d$|^--download$/) { + return ([ 1, "No dump file ID specified" ]) unless ($ARGV[2]); + return ([ 1, "Invalid parameter for $command $key $dump_option $ARGV[2]" ]) if ($ARGV[2] !~ /^\d*$/ and $ARGV[2] ne "all"); + } elsif ($dump_option =~ /^-c$|^--clear$/) { + return ([ 1, "No dump file ID specified. To clear all, specify 'all'." ]) unless ($ARGV[2]); + return ([ 1, "Invalid parameter for $command $key $dump_option $ARGV[2]" ]) if ($ARGV[2] !~ /^\d*$/ and $ARGV[2] ne "all"); + } elsif ($dump_option and $dump_option !~ /^-l$|^--list$|^-g$|^--generate$/) { + return ([ 1, "Invalid parameter for $command $dump_option" ]); + } + return; + } + } + } + if ($set) { + if (!exists($set_net_info{"ip"}) or !exists($set_net_info{"netmask"}) or !exists($set_net_info{"gateway"})) { + if (exists($set_net_info{"vlan"})) { + return ([ 1, "VLAN must be configured with IP, netmask and gateway" ]); + } else { + return ([ 1, "IP, netmask and gateway must be configured together." ]); + } + } + + } } elsif ($command eq "reventlog") { $subcommand = "all" if (!defined($ARGV[0])); if ($subcommand =~ /^resolved=(.*)/) { From 0c06d6d836f7c4c82693aaf536568f34b1787049 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 13 Mar 2018 16:31:45 -0400 Subject: [PATCH 016/161] remaining OpenBMC testcases --- .../testcase/UT_openbmc/rflash_cases0 | 6 +- .../UT_openbmc/supported_commands_case0 | 122 +++++++++++++++++- 2 files changed, 123 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 index ec306a460..f191d85c8 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 @@ -77,7 +77,5 @@ os:Linux hcp:openbmc cmd: rflash $$CN -l | grep \* | grep BMC | awk '{print $2}' | xargs -i{} rflash $$CN --delete {} check:rc==1 -check:output=~ - - -./xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 +check:output=~$$CN: Error: Deleting currently active firmware is not supported +end diff --git a/xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 b/xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 index 82e8dbdc3..5e5cc23f3 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/supported_commands_case0 @@ -25,7 +25,7 @@ check:rc==0 check:output=~$$CN: SYSTEM SerialNumber cmd: rinv $$CN firm check:rc==0 -check:output=~$$CN: HOST Firmware +check:output=~$$CN: Host Firmware check:output=~$$CN: BMC Firmware cmd: rinv $$CN cpu check:rc==0 @@ -34,3 +34,123 @@ cmd: rinv $$CN dimm check:rc==0 check:output=~$$CN: DIMM end + +start:supported_cmds_rvitals +description: Make sure that the rvitals command works... +os:Linux +hcp:openbmc +cmd: rvitals $$CN +check:rc==0 +check:output=~$$CN: +cmd: rvitals $$CN temp +check:rc==0 +check:output=~$$CN: Ambient: +cmd: rvitals $$CN voltage +check:rc==0 +check:output=~$$CN: Ps0 Input Voltage: +cmd: rvitals $$CN wattage +check:rc==0 +check:output=~$$CN: Total Power: +cmd: rvitals $$CN fanspeed +check:rc==0 +check:output=~$$CN: Fan +cmd: rvitals $$CN power +check:rc==0 +check:output=~$$CN: Total Power: +cmd: rvitals $$CN leds +check:rc==0 +check:output=~$$CN: Front +check:output=~$$CN: Front Fans +check:output=~$$CN: Rear +cmd: rvitals $$CN all +check:rc==0 +check:output=~$$CN: Ambient: +end + +start:supported_cmds_rbeacon +description: Make sure the rbeacon command works ... +os:Linux +hcp:openbmc +cmd:rbeacon $$CN on +check:rc==0 +check:output=~$$CN: on +cmd: rbeacon $$CN off +check:rc==0 +check:output=~$$CN: off +end + +start:supported_cmds_reventlog +description: Make sure the reventlog command works ... +os:Linux +hcp:openbmc +cmd:reventlog $$CN +check:rc==0 +check:output=~$$CN: +cmd: reventlog $$CN 1 +check:rc==0 +check:output=~$$CN: +cmd: reventlog $$CN all +check:rc==0 +check:output=~$$CN: +end + +start:supported_cmds_rflash +description: Make sure the rflash command works ... +os:Linux +hcp:openbmc +cmd:rflash $$CN -c +check:rc==0 +check:output=~$$CN: BMC Firmware Product: +check:output=~$$CN: HOST Firmware Product: +cmd:rflash $$CN -l +check:rc==0 +check:output=~$$CN: ID +end + +start:supported_cmds_rsetboot +description: Make sure the rsetboot command works ... +os:Linux +hcp:openbmc +cmd:rsetboot $$CN stat +check:rc==0 +check:output=~$$CN: +end + +start:supported_cmds_rspconfig +description: Make sure the rspconfig command works ... +os:Linux +hcp:openbmc +cmd:rspconfig $$CN ipsrc +check:rc==0 +check:output=~$$CN: BMC IP Source: +cmd:rspconfig $$CN ip +check:rc==0 +check:output=~$$CN: BMC IP: +cmd:rspconfig $$CN netmask +check:rc==0 +check:output=~$$CN: BMC Netmask: +cmd:rspconfig $$CN gateway +check:rc==0 +check:output=~$$CN: BMC Gateway: +cmd:rspconfig $$CN hostname +check:rc==0 +check:output=~$$CN: BMC Hostname: +cmd:rspconfig $$CN vlan +check:rc==0 +check:output=~$$CN: BMC VLAN ID: +cmd:rspconfig $$CN dump -l +check:rc==0 +check:output=~$$CN: +cmd:rspconfig $$CN powerrestorepolicy +check:rc==0 +check:output=~$$CN: BMC PowerRestorePolicy +cmd:rspconfig $$CN powersupplyredundancy +check:rc==0 +check:output=~$$CN: BMC PowerSupplyRedundancy +cmd:rspconfig $$CN autoreboot +check:rc==0 +check:output=~$$CN: BMC AutoReboot +cmd:rspconfig $$CN bootmode +check:rc==0 +check:output=~$$CN: BMC BootMode +end From 3dc4b0a60aedbdb6b33d20ef4d9be1a3d188b8b3 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 14 Mar 2018 05:27:32 -0400 Subject: [PATCH 017/161] update parse_args based on comments --- xCAT-server/lib/xcat/plugins/openbmc2.pm | 37 ++++++++++-------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index ebc5e26a9..162a5bf02 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -89,10 +89,6 @@ sub preprocess_request { $callback->({ errorcode => [$parse_result->[0]], data => [$error_data] }); $request = {}; return; - } elsif ($command eq 'rspconfig') { - $callback->({ data => ["rspconfig is fine"]}); - $request = {}; - return; } my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN"); @@ -272,7 +268,7 @@ sub parse_args { } if ($set and $get) { return ([1, "Can not set and query OpenBMC information at the same time"]); - } elsif ($set and $value eq '') { + } elsif ($set and $value eq '' and ($key ne "ntpservers")) { return ([1, "Invalid parameter for option $key"]); } if (($set and !grep /$key/, @rspconfig_set_options) or @@ -282,32 +278,27 @@ sub parse_args { if ($set) { if ($key =~ /^hostname$|^admin_passwd$|^ntpservers$/ and $num_subcommand > 1) { return([1, "The option '$key' can not work with other options"]); - } - elsif ($key eq "admin_passwd") { - if ($value =~ /(.*),(.*)/) { + } elsif ($key eq "admin_passwd") { + if ($value =~ /^([^,]*),([^,]*)$/) { if ($1 eq '' or $2 eq '') { return([1, "Invalid parameter for option $key: $value"]); } } else { return([1, "Invalid parameter for option $key: $value"]); } - } - elsif ($key eq "netmask") { + } elsif ($key eq "netmask") { if (!xCAT::NetworkUtils->isIpaddr($value)) { return ([ 1, "Invalid parameter for option $key: $value" ]); } $set_net_info{"netmask"} = 1; - } - elsif ($key eq "gateway") { + } elsif ($key eq "gateway") { if ($value ne "0.0.0.0" and !xCAT::NetworkUtils->isIpaddr($value)) { return ([ 1, "Invalid parameter for option $key: $value" ]); } $set_net_info{"gateway"} = 1; - } - elsif ($key eq "vlan") { + } elsif ($key eq "vlan") { $set_net_info{"vlan"} = 1; - } - elsif ($key eq "ip") { + } elsif ($key eq "ip") { if ($value ne "dhcp") { if (@$noderange > 1) { return ([ 1, "Can not configure more than 1 nodes' ip at the same time" ]); @@ -322,32 +313,34 @@ sub parse_args { } else { if ($key eq "sshcfg" and $num_subcommand > 1) { return ([ 1, "Configure sshcfg must be issued without other options." ]); - } - elsif ($key eq "gard") { + } elsif ($key eq "gard") { if ($num_subcommand > 2) { return ([ 1, "Clear GARD cannot be issued with other options." ]); } elsif (!defined($ARGV[1]) or $ARGV[1] !~ /^-c$|^--clear$/) { return ([ 1, "Invalid parameter for $command $key" ]); } return; - } - elsif ($key eq "dump") { + } elsif ($key eq "dump") { my $dump_option = ""; $dump_option = $ARGV[1] if (defined $ARGV[1]); if ($dump_option =~ /^-d$|^--download$/) { return ([ 1, "No dump file ID specified" ]) unless ($ARGV[2]); return ([ 1, "Invalid parameter for $command $key $dump_option $ARGV[2]" ]) if ($ARGV[2] !~ /^\d*$/ and $ARGV[2] ne "all"); + return ([ 1, "dump $dump_option must be issued without other options." ]) if ($num_subcommand > 3); } elsif ($dump_option =~ /^-c$|^--clear$/) { return ([ 1, "No dump file ID specified. To clear all, specify 'all'." ]) unless ($ARGV[2]); return ([ 1, "Invalid parameter for $command $key $dump_option $ARGV[2]" ]) if ($ARGV[2] !~ /^\d*$/ and $ARGV[2] ne "all"); - } elsif ($dump_option and $dump_option !~ /^-l$|^--list$|^-g$|^--generate$/) { + return ([ 1, "dump $dump_option must be issued without other options." ]) if ($num_subcommand > 3); + } elsif ($dump_option =~ /^-l$|^--list$|^-g$|^--generate$/) { + return ([ 1, "dump $dump_option must be issued without other options." ]) if ($num_subcommand > 2); + } elsif ($dump_option) { return ([ 1, "Invalid parameter for $command $dump_option" ]); } return; } } } - if ($set) { + if ($set and scalar(keys %set_net_info) > 0) { if (!exists($set_net_info{"ip"}) or !exists($set_net_info{"netmask"}) or !exists($set_net_info{"gateway"})) { if (exists($set_net_info{"vlan"})) { return ([ 1, "VLAN must be configured with IP, netmask and gateway" ]); From a6a14d3bfedd81adcae6e4842ea71f1cbf8faf42 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Thu, 15 Mar 2018 14:13:13 +0800 Subject: [PATCH 018/161] group validation (#4945) --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index abc9174d0..f51543a5f 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -4721,12 +4721,20 @@ sub initialize_variables sub isobjnamevalid{ my $objname=shift; my $objtype=shift; + my %options; + $options{keepmissing}=1; + $options{genericrange}=1; $objtype="node" unless(defined $objtype and ($objtype ne "")); if($objtype eq "node"){ #the ip address as a valid node object name is a hack for p7IH support if(($objname !~ /^[a-zA-Z0-9-_]+$/) and !xCAT::NetworkUtils->isIpaddr($objname)){ return 0; } + } elsif ($objtype eq "group"){ + my @tmpnodes=xCAT::NodeRange::noderange($objname,0,0,%options); + if(scalar(@tmpnodes)>1 || $tmpnodes[0] ne $objname ){ + return 0; + } } return 1; } From 75940bfda15951d73f60d119b96dda9a5f2d3737 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 15 Mar 2018 03:10:06 -0400 Subject: [PATCH 019/161] add value check for rspconfig options powersupplyredundancy,... --- xCAT-server/lib/xcat/plugins/openbmc2.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index 162a5bf02..f5e4a8920 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -144,7 +144,13 @@ sub process_request { my @rsp_common_options = qw/autoreboot bootmode powersupplyredundancy powerrestorepolicy timesyncmethod ip netmask gateway hostname vlan ntpservers/; my @rspconfig_set_options = (@rsp_common_options, qw/admin_passwd/); - +my %rsp_set_valid_values = ( + autoreboot => "0|1", + bootmode => "regular|safe|setup", + powersupplyredundancy => "disabled|enabled", + powerrestorepolicy => "restore|always_on|always_off", + timesyncmethod => "ntp|manual", +); my @rspconfig_get_options = (@rsp_common_options, qw/ipsrc sshcfg gard dump/); #------------------------------------------------------- @@ -270,6 +276,10 @@ sub parse_args { return ([1, "Can not set and query OpenBMC information at the same time"]); } elsif ($set and $value eq '' and ($key ne "ntpservers")) { return ([1, "Invalid parameter for option $key"]); + } elsif ($set and $value ne '' and exists($rsp_set_valid_values{$key})) { + unless ($value =~ /^($rsp_set_valid_values{$key})$/) { + return([1, "Invalid value '$value' for '$key', Valid values: " . join(',', split('\|',$rsp_set_valid_values{$key}))]); + } } if (($set and !grep /$key/, @rspconfig_set_options) or ($get and !grep /$key/, @rspconfig_get_options)) { From 38e547c493a7038223b0f0226dbe6a757f98ea3b Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 15 Mar 2018 16:14:41 +0800 Subject: [PATCH 020/161] fix issue If multiple IP addresses used in xcatmaster field, updatenode will not work leaving node in bad state #3688 (#4932) --- perl-xCAT/xCAT/InstUtils.pm | 9 ++++-- xCAT-server/lib/perl/xCAT/Postage.pm | 7 +++++ xCAT-server/lib/xcat/plugins/updatenode.pm | 34 +++++++++++++++++++++- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index eca717056..1775ba1d7 100755 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -716,7 +716,8 @@ sub getOSnodes Determines the server node names as known by a lists of nodes. Arguments: - A list of node names. + $nodes: A list of node names. + $skipfacing: do not get facing ip when noderes.xcatmaster is not set Returns: A hash ref of arrays, the key is the service node pointing to @@ -736,6 +737,7 @@ sub get_server_nodes my $class = shift; my $callback = shift; my $nodes = shift; + my $skipfacing=shift; my @nodelist; if ($nodes) @@ -760,12 +762,15 @@ sub get_server_nodes my $xcatmaster = $xcatmasters->{$node}->[0]->{xcatmaster}; $serv = xCAT::NetworkUtils->getipaddr($xcatmaster); } - else + elsif (!$skipfacing) { # get ip facing node my @servd = xCAT::NetworkUtils->my_ip_facing($node); unless ($servd[0]) { $serv = $servd[1]; } } + else{ + continue; + } chomp $serv; if (xCAT::NetworkUtils->validate_ip($serv)) { diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index d0ef0f3ab..7fe50d925 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -573,6 +573,13 @@ sub makescript { $master_ip = "$ipaddr"; } + unless($master_ip){ + my $rsp; + $rsp->{data}->[0] = "makescript failed: unable to resolve xcatmaster \"$master\" for $node"; + xCAT::MsgUtils->message("SE", $rsp, $callback, 1); + return; + } + #ok, now do everything else.. #$inc =~ s/#XCATVAR:([^#]+)#/envvar($1)/eg; #$inc =~ s/#ENV:([^#]+)#/xCAT::Template::envvar($1)/eg; diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 729fed4dd..e97fd06da 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -306,6 +306,37 @@ sub preprocess_updatenode return; } + + # get server names as known by the nodes + my %servernodes = + %{ xCAT::InstUtils->get_server_nodes($callback, $request->{node}) }; + + # it's possible that the nodes could have diff server names + # do all the nodes for a particular server at once + + my @invalidnodes; + if($servernodes{undef}){ + push @invalidnodes,@{$servernodes{undef}}; + } + + if ($servernodes{""}){ + push @invalidnodes,@{$servernodes{""}}; + } + + if (@invalidnodes){ + my %allnodes=map {$_,1} @{$request->{node}}; + foreach my $node (@invalidnodes){ + xCAT::MsgUtils->report_node_error($callback,$node,"Could not determine or resolve xcatmaster for $node. Will skip this node.") + delete $allnodes{$node}; + } + $request->{node}=[]; + push $request->{node}, map $_ ,keys %allnodes; + } + + unless (scalar @{$request->{node}}){ + return; + } + # preprocess generate mypostscripts files (-g) for hierarchy # if no sharedtftp then we need to broadcast this updatenode -g to all service nodes inorder # to be able to support service node pools @@ -1524,7 +1555,7 @@ sub updatenoderunps # get server names as known by the nodes my %servernodes = - %{ xCAT::InstUtils->get_server_nodes($callback, \@$nodes) }; + %{ xCAT::InstUtils->get_server_nodes($callback, \@$nodes,1) }; # it's possible that the nodes could have diff server names # do all the nodes for a particular server at once @@ -1534,6 +1565,7 @@ sub updatenoderunps if ((!defined($snkey)) or ($snkey eq "")) { # if we could not find the xcatmaster my $rsp = {}; + $rsp->{errorcode}->[0]=1; $rsp->{error}->[0] = "Could not find xcatmaster for @{$servernodes{$snkey}}. Will skip this node. "; $callback->($rsp); next; From 06f178c7e7b04f7c9b608d16640f612f8e6cef98 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Mar 2018 04:22:46 -0400 Subject: [PATCH 021/161] Enhance rpower bmcreboot, clear dumps if reboot to new firmware --- .../agent/hwctl/executor/openbmc_power.py | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index 024f455cf..43d2c2429 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -159,13 +159,32 @@ class OpenBMCPowerTask(ParallelNodesCommand): new_status = '' try: obmc.login() + except (SelfServerException, SelfClientException) as e: + return self.callback.error(e.message, node) + + firm_obj_dict = {} + try: + has_functional, firm_obj_dict = obmc.list_firmware() + except (SelfServerException, SelfClientException) as e: + self.callback.syslog('%s: %s' % (node, e.message)) + + clear_flag = False + for key, value in firm_obj_dict.items(): + if not value.functional and value.priority == 0: + clear_flag = True + break + + if clear_flag: + self.callback.info('%s: Firmware will be flashed on reboot, deleting all BMC diagnostics...' % node) + try: + obmc.clear_dump('all') + except (SelfServerException, SelfClientException) as e: + self.callback.warn('%s: Could not clear BMC diagnostics successfully %s, ignoring...' % (node, e.message)) + + try: + obmc.reboot_bmc(optype) except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) else: - try: - obmc.reboot_bmc(optype) - except (SelfServerException, SelfClientException) as e: - self.callback.error(e.message, node) - else: - self.callback.info('%s: %s' % (node, openbmc.RPOWER_STATES['bmcreboot'])) + self.callback.info('%s: %s' % (node, openbmc.RPOWER_STATES['bmcreboot'])) From aedccbf49f3ef6372386d090aa27e439a2bdb6d3 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 15 Mar 2018 05:03:25 -0400 Subject: [PATCH 022/161] add test case --- .../testcase/xcat-inventory/cases.node | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.node b/xCAT-test/autotest/testcase/xcat-inventory/cases.node index 6a266624c..ef626acf5 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.node +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.node @@ -1,4 +1,4 @@ -start:export_import_single_ppc_by_json +star:texport_import_single_ppc_by_json description:This case is used to test xcat-inventory export and import one ppc definition by json between 2 exact same MNs. This case can cover hmc,lpar. Before running this case, make sure these two MNs have been installed same exactly, and the current MN can connect the other MN by ssh without password. This case also can be run in one MN, this is, export from currnet node then import back to currnet node, in this case, just need to set $$DSTMN= Attribute: $$DSTMN - the ip of MN which is used to run import operation. cmd:mkdir -p /tmp/export_import_single_ppc_by_json @@ -223,7 +223,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_json/srcbogusnode.stanza check:rc==0 @@ -275,7 +275,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_pdu_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=pdu nodetype=pdu addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain authkey=authkey authtype=MD5 cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping community=community cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou outlet=outlet password=password pdu=pdu pdutype=pdutype postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn privkey=privkey privtype=AES productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames seclevel=noAuthNoPriv serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpuser=snmpuser snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_pdu_by_yaml/srcbogusnode.stanza check:rc==0 @@ -327,7 +327,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_boston_by_yaml/srcbogusnode.stanza check:rc==0 @@ -378,7 +378,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_boston_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=ipmi addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcport=bmcport bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot slotid=slotid storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_boston_by_json/srcbogusnode.stanza check:rc==0 @@ -429,7 +429,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_witherspoon_by_yaml/srcbogusnode.stanza check:rc==0 @@ -480,7 +480,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_witherspoon_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=addkcmdline arch=ppc64le authdomain=authdomain bmc=bmc bmcpassword=bmcpassword bmcusername=bmcusername bmcvlantag=bmcvlantag cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand consport=consport cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype hwtype=hwtype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_witherspoon_by_json/srcbogusnode.stanza check:rc==0 @@ -532,7 +532,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_json_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=DES snmpusername=snmpusername snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=DES snmpusername=snmpusername snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_json/srcbogusnode.stanza check:rc==0 @@ -583,7 +583,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_import_single_switch_by_yaml_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype id=5 installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=DES snmpusername=snmpusername snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=switch nodetype=switch addkcmdline=addkcmdline arch=ppc64 authdomain=authdomain cfgmgr=cfgmgr cfgmgtroles=cfgmgtroles cfgserver=cfgserver chain=chain chassis=chassis cmdmapping=cmdmapping cons=cons conserver=conserver consoleondemand=consoleondemand cpucount=cpucount cputype=cputype dhcpinterfaces=dhcpinterfaces disksize=disksize domainadminpassword=domainadminpassword domainadminuser=domainadminuser domaintype=domaintype getmac=getmac height=height hidden=hidden hostcluster=hostcluster hostinterface=hostinterface hostmanager=hostmanager hostnames=hostnames hosttype=hosttype installnic=installnic interface=interface ip=10.10.10.10 iscsipassword=iscsipassword iscsiserver=iscsiserver iscsitarget=iscsitarget iscsiuserid=iscsiuserid linkports=linkports mac=42:d6:0a:03:05:08 memory=memory migrationdest=migrationdest monserver=monserver mpa=mpa mtm=mtm nameservers=nameservers netboot=grub2 nfsdir=nfsdir nfsserver=nfsserver nimserver=nimserver node=node ondiscover=ondiscover osvolume=osvolume otherinterfaces=otherinterfaces ou=ou password=password pdu=pdu postbootscripts=postbootscripts postscripts=postscripts power=power prescripts-begin=prescripts-begin prescripts-end=prescripts-end primarynic=primarynic primarysn=primarysn productkey=productkey protocol=ssh provmethod=provmethod rack=rack room=room routenames=routenames serial=serial serialflow=serialflow serialport=serialport serialspeed=serialspeed servicenode=servicenode setupconserver=0 setupdhcp=0 setupftp=setupftp setupipforward=0 setupldap=0 setupnameserver=0 setupnfs=0 setupnim=setupnim setupntp=0 setupproxydhcp=0 setuptftp=0 sfp=sfp side=side slot=slot snmpauth=SHA snmppassword=snmppassword snmpprivacy=DES snmpusername=snmpusername snmpversion=SNMPv1 storagcontroller=storagcontroller storagetype=storagetype supernode=supernode supportedarchs=supportedarchs supportproxydhcp=supportproxydhcp switch=switch switchinterface=switchinterface switchport=50 switchtype=switchtype switchvlan=switchvlan syslog=syslog termport=termport termserver=termserver tftpdir=tftpdir tftpserver=tftpserver unit=unit usercomment=usercomment username=username vmbeacon=vmbeacon vmbootorder=vmbootorder vmcfgstore=vmcfgstore vmcluster=vmcluster vmmanager=vmmanager vmmaster=vmmaster vmnicnicmodel=vmnicnicmodel vmphyslots=vmphyslots vmstorage=vmstorage vmstoragecache=vmstoragecache vmstorageformat=vmstorageformat vmstoragemodel=vmstoragemodel vmtextconsole=vmtextconsole vmvirtflags=vmvirtflags vmvncport=vmvncport xcatmaster=xcatmaster zonename=zonename nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused check:rc==0 cmd:lsdef bogusnode -z|sort -t'=' -k1 |tee /tmp/export_import_single_switch_by_yaml/srcbogusnode.stanza check:rc==0 @@ -1716,7 +1716,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_yaml_then_import_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=ppc64 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=10.10.10.10 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=42:d6:0a:03:05:08 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=grub2 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1 setupdhcp=1 setupftp=1111 setupipforward=1 setupldap=1 setupnameserver=1 setupnfs=1 setupnim=1111 setupntp=1 setupproxydhcp=1 setuptftp=1 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=ppc64 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 installnic=1111 interface=1111 ip=10.10.10.10 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=42:d6:0a:03:05:08 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=grub2 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1 setupdhcp=1 setupftp=1111 setupipforward=1 setupldap=1 setupnameserver=1 setupnfs=1 setupnim=1111 setupntp=1 setupproxydhcp=1 setuptftp=1 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused cmd:lsdef bogusnode -z|sed 's/1111/2222/g'|sed 's/unused/used/g'|sed 's/10.10.100.9/20.10.200.9/g'|sort -t'=' -k1 |tee /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza check:rc==0 cmd:sed -i 's/arch=ppc64/arch=ppc64le/g' /tmp/export_single_node_then_modify_yaml_then_import/srcbogusnode.stanza @@ -1794,7 +1794,7 @@ cmd:ssh $$DSTMN 'lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef check:rc==0 cmd:ssh $$DSTMN 'lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/export_single_node_then_modify_json_then_import_$$DSTMN/bogusgroup.stanza; rmdef -t group bogusgroup;fi' check:rc==0 -cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=ppc64 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 id=1111 installnic=1111 interface=1111 ip=10.10.10.10 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=42:d6:0a:03:05:08 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=grub2 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1 setupdhcp=1 setupftp=1111 setupipforward=1 setupldap=1 setupnameserver=1 setupnfs=1 setupnim=1111 setupntp=1 setupproxydhcp=1 setuptftp=1 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused +cmd:mkdef -t node -o bogusnode groups=bogusgroup mgt=openbmc nodetype=mp addkcmdline=1111 arch=ppc64 authdomain=1111 bmc=1111 bmcpassword=1111 bmcusername=1111 bmcvlantag=1111 cfgmgr=1111 cfgmgtroles=1111 cfgserver=1111 chain=1111 chassis=1111 cmdmapping=1111 cons=1111 conserver=1111 consoleondemand=1111 consport=1111 cpucount=1111 cputype=1111 dhcpinterfaces=1111 disksize=1111 domainadminpassword=1111 domainadminuser=1111 domaintype=1111 getmac=1111 height=1111 hidden=1111 hostcluster=1111 hostinterface=1111 hostmanager=1111 hostnames=1111 hosttype=1111 hwtype=1111 installnic=1111 interface=1111 ip=10.10.10.10 iscsipassword=1111 iscsiserver=1111 iscsitarget=1111 iscsiuserid=1111 mac=42:d6:0a:03:05:08 memory=1111 migrationdest=1111 monserver=1111 mpa=1111 mtm=1111 nameservers=1111 netboot=grub2 nfsdir=1111 nfsserver=1111 nimserver=1111 node=1111 ondiscover=1111 osvolume=1111 otherinterfaces=1111 ou=1111 pdu=1111 postbootscripts=1111 postscripts=1111 power=1111 prescripts-begin=1111 prescripts-end=1111 primarynic=1111 primarysn=1111 productkey=1111 provmethod=1111 rack=1111 room=1111 routenames=1111 serial=1111 serialflow=1111 serialport=1111 serialspeed=1111 servicenode=1111 setupconserver=1 setupdhcp=1 setupftp=1111 setupipforward=1 setupldap=1 setupnameserver=1 setupnfs=1 setupnim=1111 setupntp=1 setupproxydhcp=1 setuptftp=1 sfp=1111 side=1111 slot=1111 storagcontroller=1111 storagetype=1111 supernode=1111 supportedarchs=1111 supportproxydhcp=1111 switch=1111 switchinterface=1111 switchport=1111 switchvlan=1111 syslog=1111 termport=1111 termserver=1111 tftpdir=1111 tftpserver=1111 unit=1111 usercomment=1111 vmbeacon=1111 vmbootorder=1111 vmcfgstore=1111 vmcluster=1111 vmmanager=1111 vmmaster=1111 vmnicnicmodel=1111 vmphyslots=1111 vmstorage=1111 vmstoragecache=1111 vmstorageformat=1111 vmstoragemodel=1111 vmtextconsole=1111 vmvirtflags=1111 vmvncport=1111 xcatmaster=1111 zonename=1111 nicaliases.eth0="moe larry curly" nicaliases.eth1="tom|jerry" niccustomscripts.eth0="configeth eth0" niccustomscripts.ib0="configib ib0" nicdevices.bond0="eth0|eth2" nicdevices.br0=bond0 nicextraparams.eth0="MTU=1500" nicextraparams.ib0="MTU=65520 CONNECTED_MODE=yes" nichostnameprefixes.eth0="eth0-" nichostnameprefixes.ib0="ib-" nichostnamesuffixes.eth0="-eth0" nichostnamesuffixes.ib0="-ib0" nicips.ib0=10.10.100.9 nicips.enP48p1s0f0=129.40.234.11 nicips.ib1=10.11.100.9 nicnetworks.enP5p1s0f1.4=xcat_bmc nicnetworks.enP48p1s0f1=xcat_util nicnetworks.ib0=IB00 nicnetworks.enP48p1s0f0=pub_yellow nicnetworks.ib3=IB03 nicnetworks.ib2=IB02 nicnetworks.enP5p1s0f1=xcat_compute nicnetworks.ib1=IB01 nicnetworks.enP5p1s0f1.5=xcat_infra nicnetworks.enP5p1s0f1.6=xcat_pdu nicsadapter.enP3p3s0f1="mac=98:be:94:59:fa:cd linkstate=DOWN" nicsadapter.enP3p3s0f2="mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" nictypes.enP5p1s0f1.4=unused nictypes.enP48p1s0f1=unused nictypes.ib0=Infiniband nictypes.enP48p1s0f0=Ethernet nictypes.ib3=unused nictypes.ib2=unused nictypes.enP5p1s0f1=unused nictypes.ib1=Infiniband nictypes.enP5p1s0f1.5=unused nictypes.enP5p1s0f1.6=unused cmd:lsdef bogusnode -z|sed 's/1111/2222/g'|sed 's/unused/used/g'|sed 's/10.10.100.9/20.10.200.9/g'|sort -t'=' -k1 |tee /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza check:rc==0 cmd:sed -i 's/arch=ppc64/arch=ppc64le/g' /tmp/export_single_node_then_modify_json_then_import/srcbogusnode.stanza @@ -2008,7 +2008,7 @@ echo '{ }' > /tmp/import_validation_json_node_obj_type/node.json check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~obj_type check:rc!=0 cmd:lsdef bogusnode @@ -2036,7 +2036,7 @@ echo '{ }' > /tmp/import_validation_json_node_obj_type/node.json check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~obj_type check:rc!=0 cmd:lsdef bogusnode @@ -2064,7 +2064,7 @@ echo '{ }' > /tmp/import_validation_json_node_obj_type/node.json check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2091,7 +2091,7 @@ echo '{ }' > /tmp/import_validation_json_node_obj_type/node.json check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef -t group -o bogusgroup check:output=~Object name: bogusgroup @@ -2128,7 +2128,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~obj_type check:rc!=0 cmd:lsdef bogusnode @@ -2148,7 +2148,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~obj_type check:rc!=0 cmd:lsdef bogusnode @@ -2168,7 +2168,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2188,7 +2188,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef -t group -o bogusgroup check:output=~Object name: bogusgroup @@ -2231,7 +2231,7 @@ echo '{ }' > /tmp/import_validation_json_node_group/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_group/node.inv -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~group check:rc!=0 cmd:lsdef bogusnode @@ -2265,7 +2265,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_group/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_group/node.inv -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~group check:rc!=0 cmd:lsdef bogusnode @@ -2301,7 +2301,7 @@ echo '{ }' > /tmp/import_validation_json_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~devtype check:rc!=0 cmd:lsdef bogusnode @@ -2322,7 +2322,7 @@ echo '{ }' > /tmp/import_validation_json_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~devtype check:rc!=0 cmd:lsdef bogusnode @@ -2350,7 +2350,7 @@ echo '{ }' > /tmp/import_validation_json_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2372,7 +2372,7 @@ echo '{ }' > /tmp/import_validation_json_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2394,7 +2394,7 @@ echo '{ }' > /tmp/import_validation_json_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2416,7 +2416,7 @@ echo '{ }' > /tmp/import_validation_json_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2438,7 +2438,7 @@ echo '{ }' > /tmp/import_validation_json_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2471,7 +2471,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~devtype check:rc!=0 cmd:lsdef bogusnode @@ -2487,7 +2487,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Error: failed to validate schema entry +check:output=~Error: failed to validate attribute check:output=~devtype check:rc!=0 cmd:lsdef bogusnode @@ -2503,7 +2503,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2520,7 +2520,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2537,7 +2537,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2554,7 +2554,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2575,7 +2575,7 @@ echo "node: role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv check:rc==0 cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~import object successfully +check:output=~Inventory import successfully check:rc==0 cmd:lsdef bogusnode check:output=~Object name: bogusnode @@ -2590,3 +2590,5 @@ cmd:rm -rf /tmp/import_validation_yaml_node_device_type check:rc==0 end + + From 9e1450fe1253e0341efca9ed93230ddaf973582a Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 15 Mar 2018 17:44:20 +0800 Subject: [PATCH 023/161] fix syntax issue (#4950) --- xCAT-server/lib/xcat/plugins/updatenode.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index e97fd06da..dba0ac5f6 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -326,7 +326,7 @@ sub preprocess_updatenode if (@invalidnodes){ my %allnodes=map {$_,1} @{$request->{node}}; foreach my $node (@invalidnodes){ - xCAT::MsgUtils->report_node_error($callback,$node,"Could not determine or resolve xcatmaster for $node. Will skip this node.") + xCAT::MsgUtils->report_node_error($callback,$node,"Could not determine or resolve xcatmaster for $node. Will skip this node."); delete $allnodes{$node}; } $request->{node}=[]; From 016164594f7a7fa80b42ae40e932b71a9f41b233 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 15 Mar 2018 13:49:29 -0400 Subject: [PATCH 024/161] Do not allow firmware delete if active --- xCAT-server/lib/xcat/plugins/openbmc.pm | 125 +++++++++++++++--- .../testcase/UT_openbmc/rflash_cases0 | 2 +- 2 files changed, 108 insertions(+), 19 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 5bbc34877..2571857f2 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -276,6 +276,10 @@ my %status_info = ( process => \&rflash_response, }, + RFLASH_DELETE_CHECK_STATE_RESPONSE => { + process => \&rflash_response, + }, + RINV_REQUEST => { method => "GET", init_url => "$openbmc_project_url/inventory/enumerate", @@ -2034,9 +2038,10 @@ sub parse_command_status { $next_status{RFLASH_LIST_REQUEST} = "RFLASH_LIST_RESPONSE"; } if ($delete) { - # Delete uploaded image from BMC - $next_status{LOGIN_RESPONSE} = "RFLASH_DELETE_IMAGE_REQUEST"; - $next_status{RFLASH_DELETE_IMAGE_REQUEST} = "RFLASH_DELETE_IMAGE_RESPONSE"; + # Request to delete uploaded image from BMC or Host + # Firsh check if image is allowed to be deleted + $next_status{LOGIN_RESPONSE} = "RFLASH_LIST_REQUEST"; + $next_status{RFLASH_LIST_REQUEST} = "RFLASH_DELETE_CHECK_STATE_RESPONSE"; } if ($upload) { # Upload specified update file to BMC @@ -2632,32 +2637,42 @@ sub rpower_response { my $bmc_short_state = (split(/\./, $bmc_state))[-1]; if (defined($bmc_state) and $bmc_state !~ /State.BMC.BMCState.Ready$/) { if ($node_info{$node}{bmcstate_check_times} > 0) { - $node_info{$node}{bmcstate_check_times}--; - if ($node_info{$node}{wait_start}) { - $node_info{$node}{wait_end} = time(); + $node_info{$node}{bmcstate_check_times}--; + if ($node_info{$node}{wait_start}) { + $node_info{$node}{wait_end} = time(); + } else { + $node_info{$node}{wait_start} = time(); + } + retry_after($node, "RPOWER_BMC_STATUS_REQUEST", $::BMC_CHECK_INTERVAL); + return; } else { - $node_info{$node}{wait_start} = time(); + my $wait_time_X = $node_info{$node}{wait_end} - $node_info{$node}{wait_start}; + xCAT::SvrUtils::sendmsg([1, "Error: Sent bmcreboot but state did not change to BMC Ready after waiting $wait_time_X seconds. (State=BMC $bmc_short_state)."], $callback, $node); + $node_info{$node}{cur_status} = ""; + $wait_node_num--; + return; } - retry_after($node, "RPOWER_BMC_STATUS_REQUEST", $::BMC_CHECK_INTERVAL); - return; - } else { - my $wait_time_X = $node_info{$node}{wait_end} - $node_info{$node}{wait_start}; - xCAT::SvrUtils::sendmsg([1, "Error: Sent bmcreboot but state did not change to BMC Ready after waiting $wait_time_X seconds. (State=BMC $bmc_short_state)."], $callback, $node); - $node_info{$node}{cur_status} = ""; - $wait_node_num--; - return; - } } xCAT::SvrUtils::sendmsg("BMC $bmc_short_state", $callback, $node); - }else { + } else { if ($chassis_state =~ /Off$/) { # Chassis state is Off, but check if we can detect transition states if ((defined($::OPENBMC_PWR) and ($::OPENBMC_PWR eq "YES")) and $host_state =~ /Off$/ and $host_transition_state =~ /On$/) { xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_ON", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + if (defined $status_info{RPOWER_STATUS_RESPONSE}{argv} and $status_info{RPOWER_STATUS_RESPONSE}{argv} =~ /fw_delete$/) { + # We are here just to check the state of the Host to determine if ok to remove active FW + # The state is Off so FW can be removed + $next_status{"RPOWER_STATUS_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; + $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + gen_send_request($node); + return; + } else { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + } } $all_status = $::POWER_STATE_OFF; } elsif ($chassis_state =~ /On$/) { @@ -2673,6 +2688,11 @@ sub rpower_response { $host_transition_state =~ /Off$/ and $chassis_state =~ /On$/) { xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_OFF", $callback, $node); } else { + if (defined $status_info{RPOWER_STATUS_RESPONSE}{argv} and $status_info{RPOWER_STATUS_RESPONSE}{argv} =~ /fw_delete$/) { + xCAT::SvrUtils::sendmsg([1, "Deleting currently active firmware on powered on host is not supported"], $callback, $node); + $wait_node_num--; + return; + } xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); } $all_status = $::POWER_STATE_ON; @@ -4227,6 +4247,75 @@ sub rflash_response { } xCAT::SvrUtils::sendmsg("", $callback, $node); #Separate output in case more than 1 endpoint } + if ($node_info{$node}{cur_status} eq "RFLASH_DELETE_CHECK_STATE_RESPONSE") { + # Verify selected FW ID is not active. If active display error message, + # If not active, proceed to delete + my $to_delete_id = (split ('/', $status_info{RFLASH_DELETE_IMAGE_REQUEST}{init_url}))[4]; + # Get the functional IDs to accurately mark the active running FW + my $functional = get_functional_software_ids($response_info); + foreach my $key_url (keys %{$response_info->{data}}) { + $update_id = (split(/\//, $key_url))[ -1 ]; + if ($update_id ne $to_delete_id) { + # Not a match on the id, try next one + next; + } + # Initialize values to Unknown for each loop, incase they are not defined in the BMC + $update_activation = "Unknown"; + $update_purpose = "Unknown"; + $update_version = "Unknown"; + + my %content = %{ ${ $response_info->{data} }{$key_url} }; + + if (defined($content{Version}) and $content{Version}) { + $update_version = $content{Version}; + } + else { + # Entry has no Version attribute, skip listing it + next; + } + if (defined($content{Purpose}) and $content{Purpose}) { + $update_purpose = (split(/\./, $content{Purpose}))[ -1 ]; + } + my $update_priority = -1; + # Just check defined, because priority=0 is a valid value + if (defined($content{Priority})) { + $update_priority = (split(/\./, $content{Priority}))[ -1 ]; + } + + # Check if this is active firmware + if (exists($functional->{$update_id}) ) { + if ($update_purpose eq "BMC") { + # Active BMC firmware can not be deleted + xCAT::SvrUtils::sendmsg([1, "Deleting currently active BMC firmware is not supported"], $callback, $node); + $wait_node_num--; + return; + } elsif ($update_purpose eq "Host") { + # Active Host firmware can NOT be deleted if host is ON + # Active Host firmware can be deleted if host is OFF + + # Send the request to check Host state + $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RPOWER_STATUS_REQUEST"; + $next_status{"RPOWER_STATUS_REQUEST"} = "RPOWER_STATUS_RESPONSE"; + # Set special argv to deleter_fw if Host is off + $status_info{RPOWER_STATUS_RESPONSE}{argv} = "fw_delete"; + last; + } else { + xCAT::SvrUtils::sendmsg([1, "Unable to determine the purpose of the firmware to delete"], $callback, $node); + # Can not figure out if Host or BMC, attempt to delete anyway. + # Worst case, BMC will not allow FW deletion if we are wrong + $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; + $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; + last; + } + } + else { + # FW is not active, it can be deleted. Send the request to do the deletion + $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; + $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; + last; + } + } + } if ($node_info{$node}{cur_status} eq "RFLASH_FILE_UPLOAD_REQUEST") { # # Special processing for file upload diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 index f191d85c8..63911d67b 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rflash_cases0 @@ -77,5 +77,5 @@ os:Linux hcp:openbmc cmd: rflash $$CN -l | grep \* | grep BMC | awk '{print $2}' | xargs -i{} rflash $$CN --delete {} check:rc==1 -check:output=~$$CN: Error: Deleting currently active firmware is not supported +check:output=~$$CN: Error: Deleting currently active BMC firmware is not supported end From 49d19b9017214a7186fe6ec54232407add1f431c Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Mar 2018 23:04:24 -0400 Subject: [PATCH 025/161] modified depending on comments --- .../lib/python/agent/hwctl/executor/openbmc_power.py | 2 +- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index 43d2c2429..807c23f16 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -179,7 +179,7 @@ class OpenBMCPowerTask(ParallelNodesCommand): try: obmc.clear_dump('all') except (SelfServerException, SelfClientException) as e: - self.callback.warn('%s: Could not clear BMC diagnostics successfully %s, ignoring...' % (node, e.message)) + self.callback.warn('%s: Could not clear BMC diagnostics successfully %s' % (node, e.message)) try: obmc.reboot_bmc(optype) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 5bbc34877..09f4de63b 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -3879,7 +3879,7 @@ sub rspconfig_dump_response { my $dump_id = $status_info{RSPCONFIG_DUMP_CLEAR_RESPONSE}{argv}; xCAT::MsgUtils->message("I", { data => ["[$dump_id] clear"] }, $callback) unless ($next_status{ $node_info{$node}{cur_status} }); } else { - my $error_msg = "Could not clear BMC diagnostics successfully (". $response_info->{'message'} . "), ignoring..."; + my $error_msg = "Could not clear BMC diagnostics successfully (". $response_info->{'message'} . ")"; xCAT::MsgUtils->message("W", { data => ["$node: $error_msg"] }, $callback) if ($next_status{ $node_info{$node}{cur_status} }); } } From 5ff300df35e5d60de77469db9183f77f52065e32 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 15 Mar 2018 23:01:00 -0400 Subject: [PATCH 026/161] modified depending on comments --- .../lib/python/agent/common/utils.py | 12 ++++------ .../agent/hwctl/executor/openbmc_bmcconfig.py | 24 +++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/common/utils.py b/xCAT-openbmc-py/lib/python/agent/common/utils.py index 5df571320..d05768a7d 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/utils.py +++ b/xCAT-openbmc-py/lib/python/agent/common/utils.py @@ -82,19 +82,15 @@ def sort_string_with_numbers(origin_list): new_list.sort() return [string for __,string in new_list] -def exchange_mask(mask): +def mask_str2int(mask): count_bit = lambda bin_str: len([i for i in bin_str if i=='1']) mask_splited = mask.split('.') mask_count = [count_bit(bin(int(i))) for i in mask_splited] return sum(mask_count) -def exchange_maskint(mask_int): - bin_arr = ['0' for i in range(32)] - for i in range(mask_int): - bin_arr[i] = '1' - tmpmask = [''.join(bin_arr[i * 8:i * 8 + 8]) for i in range(4)] - tmpmask = [str(int(tmpstr, 2)) for tmpstr in tmpmask] - return '.'.join(tmpmask) +def mask_int2str(mask_int): + mask_num = (0x1 << 32) - (0x1 << (32 - mask_int)) + return "%s.%s.%s.%s" % (str((mask_num >> 24) & 0xff), str((mask_num >>16)&0xff), str((mask_num >> 8) & 0xff), str(mask_num & 0xff)) class Messager(object): def __init__(self, name=None): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 46045c361..1c278e70d 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -167,7 +167,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): if (20-i) % 8 == 0: self.callback.info('%s: Still waiting for dump %s to be generated... ' % (node, dump_id)) - gevent.sleep( 15 ) + sleep( 15 ) if flag: self._dump_download(obmc, node, str(dump_id), flag_dump_process=True) @@ -430,7 +430,9 @@ rmdir \"/tmp/$userid\" \n") if not nic: return self.callback.error('Can not get facing NIC for %s' % bmcip, node) - if (ip == netinfo[nic]['ip'] and netmask == utils.exchange_maskint(netinfo[nic]['netmask']) and + prefix = int(utils.mask_str2int(netmask)) + + if (ip == netinfo[nic]['ip'] and prefix == netinfo[nic]['netmask'] and gateway == netinfo[nic]['gateway']): if not vlan or vlan == str(netinfo[nic]['vlanid']): self._print_bmc_netinfo(node, ip, netmask, gateway, vlan) @@ -443,31 +445,29 @@ rmdir \"/tmp/$userid\" \n") pre_nic = nic.split('_')[0] try: obmc.set_vlan(pre_nic, vlan) - gevent.sleep( 15 ) + sleep( 15 ) except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) return nic = pre_nic + '_' + vlan - prefix = int(utils.exchange_mask(netmask)) try: obmc.set_netinfo(nic, ip, prefix, gateway) - gevent.sleep( 5 ) + sleep( 5 ) nic_netinfo = obmc.get_nic_netinfo(nic) except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) return - if not netinfo: + if not nic_netinfo: return self.callback.error('Did not get info for NIC %s' % nic, node) set_success = False for net_id, attr in nic_netinfo.items(): - if attr['ip'] == ip: - attr_netmask = utils.exchange_maskint(attr["netmask"]) - if (attr_netmask == netmask and - attr['gateway'] == gateway): - set_success = True + if (attr['ip'] == ip and + attr["netmask"] == prefix and + attr['gateway'] == gateway): + set_success = True if not set_success: return self.callback.error('Config BMC IP failed', node) @@ -519,7 +519,7 @@ rmdir \"/tmp/$userid\" \n") if dic_length > 1: addon_string = " for %s" % nic netinfodict['ip'].append("BMC IP"+addon_string+": %s" % attrs["ip"]) - netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % utils.exchange_maskint(attrs["netmask"])) + netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % utils.mask_int2str(attrs["netmask"])) netinfodict['gateway'].append("BMC Gateway"+addon_string+": %s (default: %s)" % (attrs["gateway"], defaultgateway)) netinfodict['vlan'].append("BMC VLAN ID"+addon_string+": %s" % attrs["vlanid"]) netinfodict['ipsrc'].append("BMC IP Source"+addon_string+": %s" % attrs["ipsrc"]) From 3e622bf94ed7ff3241be26f2de377f01919d43ac Mon Sep 17 00:00:00 2001 From: yangsong Date: Fri, 16 Mar 2018 14:19:26 +0800 Subject: [PATCH 027/161] fix typo (#4956) --- perl-xCAT/xCAT/InstUtils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index 1775ba1d7..a8f987b34 100755 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -769,7 +769,7 @@ sub get_server_nodes unless ($servd[0]) { $serv = $servd[1]; } } else{ - continue; + next; } chomp $serv; From 4b680167d9c27c116dbc2f269cc98e1b96517f31 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 16 Mar 2018 14:03:27 -0400 Subject: [PATCH 028/161] OpenBMC rbeacon stat support in Python --- .../agent/hwctl/executor/openbmc_sensor.py | 11 ++++++++--- xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py | 5 +++-- .../lib/python/agent/xcatagent/openbmc.py | 16 ++++++++++------ xCAT-server/lib/xcat/plugins/openbmc2.pm | 4 ++-- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py index 3bee6bf98..7abd4c31d 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py @@ -32,9 +32,14 @@ SENSOR_POWER_UNITS = ("Amperes", "Joules", "Watts") class OpenBMCSensorTask(ParallelNodesCommand): """Executor for sensor-related actions.""" - def _get_beacon_info(self, beacon_dict): + def _get_beacon_info(self, beacon_dict, display_type='full'): info_list = [] + # display_type == 'full' for detailed output for 'rvitals leds' command + # display_type == 'compact' for compact output for 'rbeacon stat' command + if display_type == 'compact': + info_list.append('Front:%s Rear:%s' % (beacon_dict.get('front_id'), beacon_dict.get('rear_id', 'N/A'))) + return info_list info_list.append('Front . . . . . : Power:%s Fault:%s Identify:%s' % (beacon_dict.get('front_power', 'N/A'), beacon_dict.get('front_fault', 'N/A'), @@ -92,7 +97,7 @@ class OpenBMCSensorTask(ParallelNodesCommand): return sensor_info - def get_beacon_info(self, **kw): + def get_beacon_info(self, display_type, **kw): node = kw['node'] obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, @@ -102,7 +107,7 @@ class OpenBMCSensorTask(ParallelNodesCommand): try: obmc.login() beacon_dict = obmc.get_beacon_info() - beacon_info = self._get_beacon_info(beacon_dict) + beacon_info = self._get_beacon_info(beacon_dict, display_type) if not beacon_info: beacon_info = ['No attributes returned from the BMC.'] diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py index ad8727311..510b2c920 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py @@ -19,13 +19,14 @@ class SensorInterface(object): """ return task.run('get_sensor_info', sensor_type) - def get_beacon_info(self, task): + def get_beacon_info(self, task, display_type='full'): """Return the beacon info of the task's nodes. + :param task: type of display to produce - full (rvitals leds) or compact (rbeacon stat) :param task: a Task instance containing the nodes to act on. :return: beacon info list """ - return task.run('get_beacon_info') + return task.run('get_beacon_info', display_type) class DefaultSensorManager(SensorInterface): """Interface for sensor-related actions.""" diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 6d382d140..880f6f707 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -48,7 +48,7 @@ VERBOSE = False all_nodes_result = {} # global variables of rbeacon -BEACON_SET_OPTIONS = ('on', 'off') +BEACON_OPTIONS = ('on', 'off', 'stat') # global variables of rflash RFLASH_OPTIONS = { @@ -614,7 +614,7 @@ class OpenBMCManager(base.BaseManager): # 1, parse args rbeacon_usage = """ Usage: - rbeacon [-V|--verbose] [on|off] + rbeacon [-V|--verbose] [on|off|stat] Options: -V --verbose rbeacon verbose mode. @@ -631,16 +631,20 @@ class OpenBMCManager(base.BaseManager): # 2, validate the args if action is None: - self.messager.error("Not specify the subcommand for rbeacon") + self.messager.error("Subcommand for rbeacon was not specified") return - if action not in BEACON_SET_OPTIONS: + if action not in BEACON_OPTIONS: self.messager.error("Not supported subcommand for rbeacon: %s" % action) return # 3, run the subcommands - runner = OpenBMCBeaconTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) - DefaultBeaconManager().set_beacon_state(runner, beacon_state=action) + runnerB = OpenBMCBeaconTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + runnerS = OpenBMCSensorTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + if action == 'stat': + DefaultSensorManager().get_beacon_info(runnerS, display_type='compact') + else: + DefaultBeaconManager().set_beacon_state(runnerB, beacon_state=action) def rinv(self, nodesinfo, args): diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index ea84911e0..2e7801376 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -186,8 +186,8 @@ sub parse_args { } if ($command eq "rbeacon") { - unless ($subcommand =~ /^on$|^off$/) { - return ([ 1, "Only 'on' or 'off' is supported for OpenBMC managed nodes."]); + unless ($subcommand =~ /^on$|^off$|^stat$/) { + return ([ 1, "Only 'on', 'off' or 'stat' is supported for OpenBMC managed nodes."]); } } elsif ($command eq "rflash") { my ($activate, $check, $delete, $directory, $list, $upload) = (0) x 6; From 0761c3b836283df8a53b9ef183425ce96d23437c Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 16 Mar 2018 14:29:29 -0400 Subject: [PATCH 029/161] Usage and man page updates --- docs/source/guides/admin-guides/references/man1/rbeacon.1.rst | 4 ++-- perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rbeacon.1.pod | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rbeacon.1.rst b/docs/source/guides/admin-guides/references/man1/rbeacon.1.rst index 8ace5fc08..d120615c0 100644 --- a/docs/source/guides/admin-guides/references/man1/rbeacon.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rbeacon.1.rst @@ -31,7 +31,7 @@ OpenPOWER OpenBMC: ================== -\ **rbeacon**\ \ *noderange*\ {\ **on | off**\ } +\ **rbeacon**\ \ *noderange*\ {\ **on | off | stat**\ } @@ -40,7 +40,7 @@ DESCRIPTION *********** -\ **rbeacon**\ Turns beacon (a light on the front of the physical server) on/off/blink or gives status of a node or noderange. +\ **rbeacon**\ Turns beacon (a light on the front and/or rear of the physical server) on/off/blink or gives status of a node or noderange. ******** diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 14052c8be..25ef54d5d 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -86,7 +86,7 @@ my %usage = ( ", "rbeacon.openbmc" => "OpenPOWER (OpenBMC) specific: - rbeacon [on|off] + rbeacon [on|off|stat] ", "rvitals" => "", "rvitals.common" => diff --git a/xCAT-client/pods/man1/rbeacon.1.pod b/xCAT-client/pods/man1/rbeacon.1.pod index 8fc04ad4e..4db578fa4 100644 --- a/xCAT-client/pods/man1/rbeacon.1.pod +++ b/xCAT-client/pods/man1/rbeacon.1.pod @@ -17,12 +17,12 @@ B I {B|B|B|B} =head2 OpenPOWER OpenBMC: -B I {B|B} +B I {B|B|B} =head1 DESCRIPTION -B Turns beacon (a light on the front of the physical server) on/off/blink or gives status of a node or noderange. +B Turns beacon (a light on the front and/or rear of the physical server) on/off/blink or gives status of a node or noderange. =head1 EXAMPLES From 849505fd21c1cdcc63ad5c0588bc5eb54fed3fb9 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Sun, 18 Mar 2018 08:54:05 -0400 Subject: [PATCH 030/161] refine test case xcatconfig_c --- xCAT-test/autotest/testcase/xcatconfig/case0 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index 294fe2aeb..8b33d036e 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -96,18 +96,17 @@ description:To regenerate cretials os:Linux #step1:backup: /etc/xcat/ca /etc/xcat/cert cmd:cp -r /etc/xcat/ca /etc/xcat/cabak;cp -r /etc/xcat/cert /etc/xcat/certbak - #step2:run command and check the output -cmd:xcatconfig -c >/tmp/xcatconfig.test 2>&1 +cmd:xcatconfig -c 2>&1 | tee /tmp/xcatconfig.test check:rc==0 -cmd:if [[ `cat /tmp/xcatconfig.test |grep FAILED` ]] || [[ `cat /tmp/xcatconfig.test |grep error` ]] || [[ `cat /tmp/xcatconfig.test |grep "fail"` ]] || [[ `cat /tmp/xcatconfig.test |grep Error` ]];then exit 1;fi +cmd:if [[ `cat /tmp/xcatconfig.test |grep -i fail` ]] || [[ `cat /tmp/xcatconfig.test |grep -i error` ]] ;then exit 1;else exit 0;fi check:rc==0 cmd:if [[ `cat /tmp/xcatconfig.test |grep "Created xCAT certificate"` ]] && [[ `cat /tmp/xcatconfig.test |grep "Signature ok"` ]];then exit 0;else exit 1;fi check:rc==0 #step3:make sure the /etc/xcat/ca /etc/xcat/cert is rewrite -cmd:diff /etc/xcat/ca /etc/xcat/cabak +cmd:diff -y /etc/xcat/ca /etc/xcat/cabak check:rc!=0 -cmd:diff /etc/xcat/cert /etc/xcat/certbak +cmd:diff -y /etc/xcat/cert /etc/xcat/certbak check:rc!=0 #step4:restore test environment cmd:rm -rf /tmp/xcatconfig.test From c5950c1ad6dfef51b5a20c9e71cfc7ffcf9fb444 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Sun, 18 Mar 2018 08:59:05 -0400 Subject: [PATCH 031/161] add kdump test case --- .../testcase/kdump/linux_diskless_kdump | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 xCAT-test/autotest/testcase/kdump/linux_diskless_kdump diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump new file mode 100644 index 000000000..6c44e3f27 --- /dev/null +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -0,0 +1,84 @@ +start:linux_diskless_kdump +os:Linux +cmd:fdisk -l +cmd:df -T +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 + +cmd:makedns -n +check:rc==0 +cmd:makeconservercf $$CN +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi +check:rc==0 +cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\n" >> $pkglistfile;fi +check:rc==0 + +cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`; sed -i '/boot/d' $exlistfile +check:rc==0 + +cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/200/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=200m 0 2" $postinstallfile;fi +check:rc==0 + +cmd:if [ ! -d /kdumpdir ]; then mkdir -p /kdumpdir && chmod 777 /kdumpdir; fi +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/kdumpdir +check:rc==0 + +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute crashkernelsize=auto +check:rc==0 + +cmd:chdef -t node $$CN -p postscripts=enablekdump +check:rc==0 + + +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:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-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 +cmd:sleep 900 +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 +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +check:output=~on / type tmpfs +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN + +cmd:xdsh $$CN echo 1 > /proc/sys/kernel/sysrq +cmd:xdsh $$CN echo c > /proc/sysrq-trigger +cmd:sleep 600 + +cmd:find /kdumpdir -name vmcore +check:rc==0 +end From 8cdb9b67303604ea1bb3444d1b0ee55cd7e91c12 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Mon, 19 Mar 2018 11:17:28 +0800 Subject: [PATCH 032/161] record error response even debugmode is 0 (#4957) * record error response even debugmode is 0 --- .../lib/python/agent/hwctl/openbmc_client.py | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 876da403c..b1654a884 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -254,14 +254,19 @@ class OpenBMCRest(object): self.root_url = HTTP_PROTOCOL + self.bmcip + PROJECT_URL self.download_root_url = HTTP_PROTOCOL + self.bmcip + '/' - def _print_record_log (self, msg, cmd): + def _print_record_log (self, msg, cmd, error_flag=False): - if self.verbose : + if self.verbose or error_flag: localtime = time.asctime( time.localtime(time.time()) ) log = self.name + ': [openbmc_debug] ' + cmd + ' ' + msg - self.messager.info(localtime + ' ' + log) + if self.verbose: + self.messager.info(localtime + ' ' + log) logger.debug(log) + def _print_error_log (self, msg, cmd): + + self._print_record_log(msg, cmd, True) + def _log_request (self, method, url, headers, data=None, files=None, file_path=None, cmd=''): header_str = ' '.join([ "%s: %s" % (k, v) for k,v in headers.items() ]) @@ -289,7 +294,7 @@ class OpenBMCRest(object): if code != requests.codes.ok: description = ''.join(data['data']['description']) error = '[%d] %s' % (code, description) - self._print_record_log(error, cmd) + self._print_error_log(error, cmd) raise SelfClientException(error, code) self._print_record_log(data['message'], cmd) @@ -313,11 +318,11 @@ class OpenBMCRest(object): except SelfServerException as e: e.message = 'BMC did not respond. ' \ 'Validate BMC configuration and retry the command.' - self._print_record_log(e.message, cmd) + self._print_error_log(e.message, cmd) raise except ValueError: error = 'Received wrong format response: %s' % response - self._print_record_log(error, cmd) + self._print_error_log(error, cmd) raise SelfServerException(error) def download(self, method, resource, file_path, headers=None, cmd=''): @@ -332,15 +337,15 @@ class OpenBMCRest(object): try: response = self.session.request_download(method, url, httpheaders, file_path) except SelfServerException as e: - self._print_record_log(e.message, cmd=cmd) + self._print_error_log(e.message, cmd=cmd) raise except SelfClientException as e: error = e.message - self._print_record_log(error, cmd=cmd) + self._print_error_log(error, cmd=cmd) raise if not response: - self._print_record_log('No response received for command %s' % request_cmd, cmd=cmd) + self._print_error_log('No response received for command %s' % request_cmd, cmd) return True self._print_record_log(str(response.status_code), cmd=cmd) @@ -357,22 +362,22 @@ class OpenBMCRest(object): try: response = self.session.request_upload(method, url, httpheaders, files) - except SelfServerException: - self._print_record_log(error, cmd=cmd) + except SelfServerException as e: + self._print_error_log(e.message, cmd=cmd) raise try: data = json.loads(response) except ValueError: error = 'Received wrong format response when running command \'%s\': %s' % \ (request_cmd, response) - self._print_record_log(error, cmd=cmd) + self._print_error_log(error, cmd=cmd) raise SelfServerException(error) if data['message'] != '200 OK': error = 'Failed to upload update file %s : %s-%s' % \ (files, data['message'], \ ''.join(data['data']['description'])) - self._print_record_log(error, cmd=cmd) + self._print_error_log(error, cmd=cmd) raise SelfClientException(error, code) self._print_record_log(data['message'], cmd=cmd) From f047cc73e3f43c2ff7a6b967982d45041e4d026b Mon Sep 17 00:00:00 2001 From: yangsong Date: Mon, 19 Mar 2018 11:20:23 +0800 Subject: [PATCH 033/161] [fvt] updatenode did not work on rhels 6.9 and sles11.4 from xct 20180316 build #4962 (#4965) --- xCAT-server/lib/xcat/plugins/updatenode.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index dba0ac5f6..899dd34f4 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -330,7 +330,7 @@ sub preprocess_updatenode delete $allnodes{$node}; } $request->{node}=[]; - push $request->{node}, map $_ ,keys %allnodes; + push @{$request->{node}}, map $_ ,keys %allnodes; } unless (scalar @{$request->{node}}){ From b7bd03f151d9fc33a9df20b3e31e82ccdb48fbcf Mon Sep 17 00:00:00 2001 From: chenglch Date: Mon, 19 Mar 2018 11:38:45 +0800 Subject: [PATCH 034/161] Fix command error in gocons caused by the env variable In hierarchical mode, xCAT insert variables in the command line, but goconserver do not support this format. This patch put the definition for environment variable to `{params}->{env}` field so that the first argument of `{params}->{cmd}` is executable. --- xCAT-server/lib/perl/xCAT/Goconserver.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index 172e1010e..fdbdc4d5b 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -73,17 +73,14 @@ sub gen_request_data { if ($cmeth eq "openbmc") { push @openbmc_nodes, $k; } else { - $cmd = $::XCATROOT . "/share/xcat/cons/$cmeth"." ".$k; - if (!(!$isSN && $v->{conserver} && xCAT::NetworkUtils->thishostisnot($v->{conserver}))) { - my $env; - my $locerror = $isSN ? "PERL_BADLANG=0 " : ''; - if (defined($ENV{'XCATSSLVER'})) { - $env = "XCATSSLVER=$ENV{'XCATSSLVER'} "; - } - $cmd = $locerror.$env.$cmd; + my $env = ""; + my $locerror = $isSN ? "PERL_BADLANG=0 " : ''; + if (defined($ENV{'XCATSSLVER'})) { + $env = "XCATSSLVER=$ENV{'XCATSSLVER'} "; } + $data->{$k}->{params}->{env} = $locerror.$env; $data->{$k}->{driver} = "cmd"; - $data->{$k}->{params}->{cmd} = $cmd; + $data->{$k}->{params}->{cmd} = $::XCATROOT . "/share/xcat/cons/$cmeth"." ".$k; $data->{$k}->{name} = $k; } if (defined($v->{consoleondemand})) { From 3d5cd23d0d478ce2fa002307465f0a9134158336 Mon Sep 17 00:00:00 2001 From: yangsong Date: Mon, 19 Mar 2018 16:28:05 +0800 Subject: [PATCH 035/161] fix issue chroot, rpm -qa error: Failed to initialize NSS library #4959 (#4967) --- xCAT-server/share/xcat/netboot/rh/genimage | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 2b535fea6..d78832f27 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -520,7 +520,7 @@ unless ($onlyinitrd) { # Hack uname when deal otherpkgs use_hackuname($arch, $kernelver); use_devnull(); - + use_devurandom(); foreach $pass (sort { $a <=> $b } (keys(%extra_hash))) { $yumcmd = $yumcmd_base; @@ -2355,6 +2355,18 @@ sub use_devnull { } } +#in rhels7.5, the /dev/urandom does not exist in rootimg directory +#which cause any rpm command fail with `error: Failed to initialize NSS library` +#create urandom in genimage to avoid the error +sub use_devurandom { + if (-e "$rootimg_dir/dev/urandom" and !-c "$rootimg_dir/dev/urandom") { + system("rm -f $rootimg_dir/dev/urandom"); + } + if (!-e "$rootimg_dir/dev/urandom") { + system("mknod -m444 $rootimg_dir/dev/urandom c 1 9"); + } +} + # Hack uname functions to match what's installed in the rootimg # instead of what's running on the management node. # Needed for some RPMs, especially kernel modules via DKMS. From aa41b1fd921254d24ead6d33e0f7e1fef72ec219 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 19 Mar 2018 11:24:58 -0400 Subject: [PATCH 036/161] Fix for review comment --- xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 880f6f707..34fd808e1 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -639,12 +639,13 @@ class OpenBMCManager(base.BaseManager): return # 3, run the subcommands - runnerB = OpenBMCBeaconTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) - runnerS = OpenBMCSensorTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) if action == 'stat': - DefaultSensorManager().get_beacon_info(runnerS, display_type='compact') + runner = OpenBMCSensorTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + + DefaultSensorManager().get_beacon_info(runner, display_type='compact') else: - DefaultBeaconManager().set_beacon_state(runnerB, beacon_state=action) + runner = OpenBMCBeaconTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + DefaultBeaconManager().set_beacon_state(runner, beacon_state=action) def rinv(self, nodesinfo, args): From cdaf8df706454055880e0a9cfc07f801072ae27f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 19 Mar 2018 13:30:30 -0400 Subject: [PATCH 037/161] Fix for review comments --- xCAT-server/lib/xcat/plugins/openbmc.pm | 116 +++++++++++++----------- 1 file changed, 61 insertions(+), 55 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 2571857f2..1a85ba9e8 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -4248,72 +4248,78 @@ sub rflash_response { xCAT::SvrUtils::sendmsg("", $callback, $node); #Separate output in case more than 1 endpoint } if ($node_info{$node}{cur_status} eq "RFLASH_DELETE_CHECK_STATE_RESPONSE") { - # Verify selected FW ID is not active. If active display error message, + # Verify selected FW ID is not active. If active, display error message, # If not active, proceed to delete my $to_delete_id = (split ('/', $status_info{RFLASH_DELETE_IMAGE_REQUEST}{init_url}))[4]; - # Get the functional IDs to accurately mark the active running FW + # Get the functional IDs to determint if active running FW can be deleted my $functional = get_functional_software_ids($response_info); - foreach my $key_url (keys %{$response_info->{data}}) { - $update_id = (split(/\//, $key_url))[ -1 ]; - if ($update_id ne $to_delete_id) { - # Not a match on the id, try next one - next; - } - # Initialize values to Unknown for each loop, incase they are not defined in the BMC - $update_activation = "Unknown"; - $update_purpose = "Unknown"; - $update_version = "Unknown"; + if (!%{$functional}) { + # Can not figure out if FW functional, attempt to delete anyway. + # Worst case, BMC will not allow FW deletion if we are wrong + $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; + $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; + } else { + foreach my $key_url (keys %{$response_info->{data}}) { + $update_id = (split(/\//, $key_url))[ -1 ]; + if ($update_id ne $to_delete_id) { + # Not a match on the id, try next one + next; + } + # Initialize values to Unknown for each loop, incase they are not defined in the BMC + $update_activation = "Unknown"; + $update_purpose = "Unknown"; + $update_version = "Unknown"; - my %content = %{ ${ $response_info->{data} }{$key_url} }; + my %content = %{ ${ $response_info->{data} }{$key_url} }; - if (defined($content{Version}) and $content{Version}) { - $update_version = $content{Version}; - } - else { - # Entry has no Version attribute, skip listing it - next; - } - if (defined($content{Purpose}) and $content{Purpose}) { - $update_purpose = (split(/\./, $content{Purpose}))[ -1 ]; - } - my $update_priority = -1; - # Just check defined, because priority=0 is a valid value - if (defined($content{Priority})) { - $update_priority = (split(/\./, $content{Priority}))[ -1 ]; - } - - # Check if this is active firmware - if (exists($functional->{$update_id}) ) { - if ($update_purpose eq "BMC") { - # Active BMC firmware can not be deleted - xCAT::SvrUtils::sendmsg([1, "Deleting currently active BMC firmware is not supported"], $callback, $node); - $wait_node_num--; - return; - } elsif ($update_purpose eq "Host") { - # Active Host firmware can NOT be deleted if host is ON - # Active Host firmware can be deleted if host is OFF - - # Send the request to check Host state - $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RPOWER_STATUS_REQUEST"; - $next_status{"RPOWER_STATUS_REQUEST"} = "RPOWER_STATUS_RESPONSE"; - # Set special argv to deleter_fw if Host is off - $status_info{RPOWER_STATUS_RESPONSE}{argv} = "fw_delete"; - last; + if (defined($content{Version}) and $content{Version}) { + $update_version = $content{Version}; } else { - xCAT::SvrUtils::sendmsg([1, "Unable to determine the purpose of the firmware to delete"], $callback, $node); - # Can not figure out if Host or BMC, attempt to delete anyway. - # Worst case, BMC will not allow FW deletion if we are wrong + # Entry has no Version attribute, skip listing it + next; + } + if (defined($content{Purpose}) and $content{Purpose}) { + $update_purpose = (split(/\./, $content{Purpose}))[ -1 ]; + } + my $update_priority = -1; + # Just check defined, because priority=0 is a valid value + if (defined($content{Priority})) { + $update_priority = (split(/\./, $content{Priority}))[ -1 ]; + } + + # Check if this is active firmware + if (exists($functional->{$update_id}) ) { + if ($update_purpose eq "BMC") { + # Active BMC firmware can not be deleted + xCAT::SvrUtils::sendmsg([1, "Deleting currently active BMC firmware is not supported"], $callback, $node); + $wait_node_num--; + return; + } elsif ($update_purpose eq "Host") { + # Active Host firmware can NOT be deleted if host is ON + # Active Host firmware can be deleted if host is OFF + + # Send the request to check Host state + $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RPOWER_STATUS_REQUEST"; + $next_status{"RPOWER_STATUS_REQUEST"} = "RPOWER_STATUS_RESPONSE"; + # Set special argv to fw_delete if Host is off + $status_info{RPOWER_STATUS_RESPONSE}{argv} = "fw_delete"; + last; + } else { + xCAT::SvrUtils::sendmsg([1, "Unable to determine the purpose of the firmware to delete"], $callback, $node); + # Can not figure out if Host or BMC, attempt to delete anyway. + # Worst case, BMC will not allow FW deletion if we are wrong + $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; + $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; + last; + } + } + else { + # FW is not active, it can be deleted. Send the request to do the deletion $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; last; } } - else { - # FW is not active, it can be deleted. Send the request to do the deletion - $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; - $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; - last; - } } } if ($node_info{$node}{cur_status} eq "RFLASH_FILE_UPLOAD_REQUEST") { From f7704119c46b8ef37be883db94623996ff6ac2cb Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 12 Mar 2018 16:20:04 -0400 Subject: [PATCH 038/161] conserver message change --- xCAT-server/lib/xcat/plugins/conserver.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index db0473f76..357f774ae 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -205,7 +205,7 @@ sub process_request { if (-x "/usr/bin/goconserver") { require xCAT::Goconserver; if (xCAT::Goconserver::is_goconserver_running()) { - my $rsp->{data}->[0] = "goconserver is started, please stop it at first."; + my $rsp->{data}->[0] = "goconserver is being used as the console service, did you mean: makegocons ? If not, stop goconserver and retry."; xCAT::MsgUtils->message("E", $rsp, $cb); return; } From 30b6cee2ffdadd08fcb62be575cacc7eecbc4109 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 19 Mar 2018 23:34:27 -0400 Subject: [PATCH 039/161] update case according to comments --- .../testcase/kdump/linux_diskless_kdump | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 6c44e3f27..f3f872594 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -1,17 +1,10 @@ start:linux_diskless_kdump os:Linux -cmd:fdisk -l -cmd:df -T cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN -check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN -cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -25,16 +18,22 @@ check:rc==0 cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi check:rc==0 + +cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;cp $pkglistfile $pkglistfile.bak cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\n" >> $pkglistfile;fi check:rc==0 +cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;cp $exlistfile $exlistfile.bak cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`; sed -i '/boot/d' $exlistfile check:rc==0 +cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;cp $postinstallfile $postinstallfile.bak cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/200/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=200m 0 2" $postinstallfile;fi check:rc==0 cmd:if [ ! -d /kdumpdir ]; then mkdir -p /kdumpdir && chmod 777 /kdumpdir; fi +cmd:if [ ! -f /etc/exports ] ;then touch /etc/exports;else cp /etc/exports /etc/exports.bak;fi +cmd:echo -e "/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports && exportfs /etc/exports fi; cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/kdumpdir check:rc==0 @@ -54,7 +53,6 @@ cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ne 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 900 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 @@ -67,18 +65,17 @@ check:output=~booted cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d -cmd:xdsh $$CN mount -check:rc==0 -check:output=~on / type tmpfs -cmd:sleep 120 -cmd:ping $$CN -c 3 -check:rc==0 -check:output=~64 bytes from $$CN cmd:xdsh $$CN echo 1 > /proc/sys/kernel/sysrq cmd:xdsh $$CN echo c > /proc/sysrq-trigger cmd:sleep 600 -cmd:find /kdumpdir -name vmcore -check:rc==0 +cmd:if [[ -s /hello ]]; then echo "this file is not empty";else echo "this file is empty"; fi +check:output=~not empty + +cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;mv -f $pkglistfile.bak $pkglistfile +cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;mv -f $exlistfile.bak $exlistfile +cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile + +cmd:if [ -f /etc/exports.bak ] ;then mv -f /etc/exports.bak /etc/exports; fi end From 3f31da435199cfb8361b27b8809e0ec06c4b9ce8 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 20 Mar 2018 02:17:04 -0400 Subject: [PATCH 040/161] modified depending on comments --- xCAT-server/lib/xcat/plugins/ipmi.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 7e38aa817..b0edfa5df 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -8275,9 +8275,9 @@ sub preprocess_request { my $error_data = ""; foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Please enter an action (eg: boot,off,on, etc)"; + $error_data .= "$_: Please enter an action (eg: boot,off,on, etc) for ipmi management method"; } - $callback->({ errorcode => [1], data => [ $error_data, $usage_string ] }); + $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; return 0; } @@ -8294,9 +8294,9 @@ sub preprocess_request { my $error_data = ""; foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Error: Unsupported command: $command $subcmd"; + $error_data .= "$_: Error: Unsupported command: $command $subcmd for ipmi management method"; } - $callback->({ errorcode => [1], data => [ $error_data, $usage_string ] }); + $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; return; } @@ -8335,7 +8335,7 @@ sub preprocess_request { if ($optset eq 0) { foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command."; + $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command for ipmi management method."; } $callback->({ errorcode => [1], data => [ $error_data] }); $request = {}; @@ -8347,7 +8347,7 @@ sub preprocess_request { if ($optset eq 1) { foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command."; + $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command for ipmi management method."; } $callback->({ errorcode => [1], data => [ $error_data] }); $request = {}; @@ -8359,7 +8359,7 @@ sub preprocess_request { unless ($option =~ /^USERID$|^ip$|^netmask$|^gateway$|^vlan$|^userid$|^username$|^password$|^snmpdest|^thermprofile$|^alert$|^garp$|^community$|^backupgateway$/) { foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Error: Unsupported command: $command $option"; + $error_data .= "$_: Error: Unsupported command: $command $option for ipmi management method"; } $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; @@ -8374,7 +8374,7 @@ sub preprocess_request { my $error_data = ""; foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: option '-t' can only work with 'all' or 'vpd"; + $error_data .= "$_: option '-t' can only work with 'all' or 'vpd' for ipmi management method"; } $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; From 25bede4130d442606a47f309166c8f959aee26f1 Mon Sep 17 00:00:00 2001 From: chenglch Date: Mon, 19 Mar 2018 10:19:44 +0800 Subject: [PATCH 041/161] Modify goconserver msg for SN The message util from xCAT framework do not print where the message comes from by default. This patch add [service host] prefix for the message if message is from SN. --- perl-xCAT/xCAT/Client.pm | 15 ++-- perl-xCAT/xCAT/MsgUtils.pm | 69 ++++++++++++++++ xCAT-server/lib/perl/xCAT/Goconserver.pm | 87 ++++++--------------- xCAT-server/lib/xcat/plugins/goconserver.pm | 26 +++--- 4 files changed, 119 insertions(+), 78 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index ae0d19d98..ba52dcfbc 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -1148,6 +1148,10 @@ sub handle_response { $xCAT::Client::EXITCODE |= $rsp->{errorcode}; } # assume it is a non-reference scalar } + my $host = ""; + if ($rsp->{host}) { + $host = "[".$rsp->{host}->[0]."]" if !$msgsource; + } if ($rsp->{error}) { @@ -1156,14 +1160,14 @@ sub handle_response { foreach my $text (@{ $rsp->{error} }) { my $desc = "$text"; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Error: $desc" unless ($rsp->{NoErrorPrefix}); + $desc = "Error$host: $desc" unless ($rsp->{NoErrorPrefix}); print STDERR "$desc\n"; } } else { my $desc = $rsp->{error}; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Error: $desc" unless ($rsp->{NoErrorPrefix}); + $desc = "Error$host: $desc" unless ($rsp->{NoErrorPrefix}); print STDERR "$desc\n"; } } @@ -1174,23 +1178,22 @@ sub handle_response { foreach my $text (@{ $rsp->{warning} }) { my $desc = "$text"; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix}); + $desc = "Warning$host: $desc" unless ($rsp->{NoWarnPrefix}); print STDERR "$desc\n"; } } else { my $desc = $rsp->{warning}; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix}); + $desc = "Warning$host: $desc" unless ($rsp->{NoWarnPrefix}); print STDERR "$desc\n"; } } if ($rsp->{info}) { - #print "printing info\n"; if (ref($rsp->{info}) eq 'ARRAY') { foreach my $text (@{ $rsp->{info} }) { - my $desc = "$text"; + my $desc = "$host$text"; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); print "$desc\n"; } diff --git a/perl-xCAT/xCAT/MsgUtils.pm b/perl-xCAT/xCAT/MsgUtils.pm index 079b5e3a7..47cec0ff4 100644 --- a/perl-xCAT/xCAT/MsgUtils.pm +++ b/perl-xCAT/xCAT/MsgUtils.pm @@ -18,6 +18,8 @@ use Socket; use File::Path; use constant PERF_LOG => "/var/log/xcat/perf.log"; +my $host = ""; +my $isSN = xCAT::Utils->isServiceNode(); $::NOK = -1; $::OK = 0; @@ -546,6 +548,73 @@ sub message return; } + +#----------------------------------------------------------------------------- + +=head3 error_message + + A wrap function for message. If $callback is not defined, send the log to + syslog, otherwise, send error message to client. Print service host if runs + on service node. + + Example: + + $rsp->{data}->[0] = "message"; + xCAT::MsgUtils->error_message($rsp, $callback); +=cut + +#----------------------------------------------------------------------------- +sub error_message +{ + shift; + my $rsp = shift; + my $callback = shift; + if (!defined($callback)) { + message(undef, "S", $rsp, undef); + return; + } + if ($isSN && !$host) { + my @hostinfo = xCAT::NetworkUtils->determinehostname(); + $host = $hostinfo[-1]; + } + $rsp->{host} = $host if $host; + message(undef, "E", $rsp, $callback); +} + +#----------------------------------------------------------------------------- + +=head3 info_message + + A wrap function for message. If $callback is not defined, send the log to + syslog, otherwise, send info message to client. Print service host if runs + on service node. + + Example: + + $rsp->{data}->[0] = "message"; + xCAT::MsgUtils->info_message($rsp, $callback); +=cut + +#----------------------------------------------------------------------------- +sub info_message +{ + shift; + my $rsp = shift; + my $callback = shift; + if (!defined($callback)) { + message(undef, "S", $rsp, undef); + return; + } + if ($isSN && !$host) { + my @hostinfo = xCAT::NetworkUtils->determinehostname(); + $host = $hostinfo[-1]; + } + $rsp->{host} = $host if $host; + message(undef, "I", $rsp, $callback); +} + + + #-------------------------------------------------------------------------------- =head2 xCAT Logging Routines diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index fdbdc4d5b..255137cb4 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -60,7 +60,7 @@ sub http_request { sub gen_request_data { my ($cons_map, $siteondemand, $callback) = @_; - my (@openbmc_nodes, $data); + my (@openbmc_nodes, $data, $rsp); while (my ($k, $v) = each %{$cons_map}) { my $ondemand; if ($siteondemand) { @@ -104,11 +104,8 @@ sub gen_request_data { foreach my $node (@openbmc_nodes) { if (defined($openbmc_hash->{$node}->[0])) { if (!$openbmc_hash->{$node}->[0]->{'bmc'}) { - if($callback) { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node); - } else { - xCAT::MsgUtils->message("S", "$node: Error: Unable to get attribute bmc"); - } + $rsp->{data}->[0] = "$node: Failed to send delete request."; + xCAT::MsgUtils->error_message($rsp, $callback); delete $data->{$node}; next; } @@ -118,11 +115,8 @@ sub gen_request_data { } elsif ($passwd_hash and $passwd_hash->{username}) { $data->{$node}->{params}->{user} = $passwd_hash->{username}; } else { - if ($callback) { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node) - } else { - xCAT::MsgUtils->message("S", "$node: Error: Unable to get attribute username"); - } + $rsp->{data}->[0] = "$node: Unable to get attribute username."; + xCAT::MsgUtils->error_message($rsp, $callback); delete $data->{$node}; next; } @@ -131,11 +125,8 @@ sub gen_request_data { } elsif ($passwd_hash and $passwd_hash->{password}) { $data->{$node}->{params}->{password} = $passwd_hash->{password}; } else { - if ($callback) { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node) - } else { - xCAT::MsgUtils->message("S", "$node: Error: Unable to get attribute password"); - } + $rsp->{data}->[0] = "$node: Unable to get attribute password."; + xCAT::MsgUtils->error_message($rsp, $callback); delete $data->{$node}; next; } @@ -268,22 +259,14 @@ sub delete_nodes { $ret = 0; my $response = http_request("DELETE", $url, $data); if (!defined($response)) { - if ($callback) { - $rsp->{data}->[0] = "Failed to send delete request."; - xCAT::MsgUtils->message("E", $rsp, $callback) - } else { - xCAT::MsgUtils->message("S", "Failed to send delete request."); - } + $rsp->{data}->[0] = "Failed to send delete request."; + xCAT::MsgUtils->error_message($rsp, $callback); return 1; } elsif ($delmode) { while (my ($k, $v) = each %{$response}) { if ($v ne "Deleted") { - if ($callback) { - $rsp->{data}->[0] = "$k: Failed to delete entry in goconserver: $v"; - xCAT::MsgUtils->message("E", $rsp, $callback) - } else { - xCAT::MsgUtils->message("S", "$k: Failed to delete entry in goconserver: $v"); - } + $rsp->{data}->[0] = "$k: Failed to delete entry in goconserver: $v"; + xCAT::MsgUtils->error_message($rsp, $callback); $ret = 1; } else { if ($callback) { @@ -296,12 +279,8 @@ sub delete_nodes { } if (@update_nodes) { if (disable_nodes_in_db(\@update_nodes)) { - if ($callback) { - $rsp->{data}->[0] = "Failed to update consoleenabled status in db."; - xCAT::MsgUtils->message("E", $rsp, $callback); - } else { - xCAT::MsgUtils->message("S", "Failed to update consoleenabled status in db."); - } + $rsp->{data}->[0] = "Failed to update consoleenabled status in db."; + xCAT::MsgUtils->error_message($rsp, $callback); } } return $ret; @@ -318,22 +297,14 @@ sub create_nodes { $ret = 0; my $response = http_request("POST", $url, $data); if (!defined($response)) { - if ($callback) { - $rsp->{data}->[0] = "Failed to send create request."; - xCAT::MsgUtils->message("E", $rsp, $callback) - } else { - xCAT::MsgUtils->message("S", "Failed to send create request."); - } + $rsp->{data}->[0] = "Failed to send create request."; + xCAT::MsgUtils->error_message($rsp, $callback); return 1; } elsif ($response) { while (my ($k, $v) = each %{$response}) { if ($v ne "Created") { - if ($callback) { - $rsp->{data}->[0] = "$k: Failed to create console entry in goconserver: $v"; - xCAT::MsgUtils->message("E", $rsp, $callback); - } else { - xCAT::MsgUtils->message("S", "$k: Failed to create console entry in goconserver: $v"); - } + $rsp->{data}->[0] = "$k: Failed to create console entry in goconserver: $v"; + xCAT::MsgUtils->error_message($rsp, $callback); $ret = 1; } else { $rsp->{data}->[0] = "$k: $v"; @@ -344,12 +315,8 @@ sub create_nodes { } if (@update_nodes) { if (enable_nodes_in_db(\@update_nodes)) { - if ($callback) { - $rsp->{data}->[0] = "Failed to update consoleenabled status in db."; - xCAT::MsgUtils->message("E", $rsp, $callback); - } else { - CAT::MsgUtils->message("S", "Failed to update consoleenabled status in db."); - } + $rsp->{data}->[0] = "Failed to update consoleenabled status in db."; + xCAT::MsgUtils->error_message($rsp, $callback); } } return $ret; @@ -361,13 +328,13 @@ sub list_nodes { my $rsp; my $response = http_request("GET", $url); if (!defined($response)) { - $rsp->{data}->[0] = "Failed to send list request."; - xCAT::MsgUtils->message("E", $rsp, $callback); + $rsp->{data}->[0] = "Failed to send list request. Is goconserver service started?"; + xCAT::MsgUtils->error_message($rsp, $callback); return 1; } if (!$response->{nodes}) { $rsp->{data}->[0] = "Could not find any node."; - xCAT::MsgUtils->message("I", $rsp, $callback); + xCAT::MsgUtils->info_message($rsp, $callback); return 0; } $rsp->{data}->[0] = sprintf("\n".PRINT_FORMAT, "NODE", "SERVER", "STATE"); @@ -379,7 +346,7 @@ sub list_nodes { $node_map->{$node->{name}}->{vis} = 1; if (!$node->{host} || !$node->{state}) { $rsp->{data}->[0] = sprintf(PRINT_FORMAT, $node->{name}, "", "Unable to parse the response message"); - xCAT::MsgUtils->message("E", $rsp, $callback); + xCAT::MsgUtils->error_message("E", $rsp, $callback); next; } $rsp->{data}->[0] = sprintf(PRINT_FORMAT, $node->{name}, $node->{host}, substr($node->{state}, 0, 16)); @@ -403,12 +370,8 @@ sub cleanup_nodes { my $rsp; my $response = http_request("GET", "$api_url/nodes"); if (!defined($response)) { - if ($callback) { - $rsp->{data}->[0] = "Failed to send list request."; - xCAT::MsgUtils->message("E", $rsp, $callback); - } else { - xCAT::MsgUtils->message("S", "Failed to send list request."); - } + $rsp->{data}->[0] = "Failed to send list request. Is goconserver service started?"; + xCAT::MsgUtils->error_message("E", $rsp, $callback); return 1; } if (!$response->{nodes}) { diff --git a/xCAT-server/lib/xcat/plugins/goconserver.pm b/xCAT-server/lib/xcat/plugins/goconserver.pm index a4c1e8ea2..1b397df6c 100644 --- a/xCAT-server/lib/xcat/plugins/goconserver.pm +++ b/xCAT-server/lib/xcat/plugins/goconserver.pm @@ -143,13 +143,13 @@ sub start_goconserver { my ($rsp, $running, $ready, $ret); unless (-x "/usr/bin/goconserver") { $rsp->{data}->[0] = "goconserver is not installed."; - xCAT::MsgUtils->message("E", $rsp, $::callback); + xCAT::MsgUtils->error_message($rsp, $::callback); return 1; } # if goconserver is installed, check the status of conserver service. if (xCAT::Goconserver::is_conserver_running()) { $rsp->{data}->[0] = "conserver is started, please stop it at first."; - xCAT::MsgUtils->message("E", $rsp, $::callback); + xCAT::MsgUtils->error_message($rsp, $::callback); return 1; } $running = xCAT::Goconserver::is_goconserver_running(); @@ -164,18 +164,18 @@ sub start_goconserver { $ret = xCAT::Goconserver::build_conf(); if ($ret) { $rsp->{data}->[0] = "Failed to create configuration file for goconserver."; - xCAT::MsgUtils->message("E", $rsp, $::callback); + xCAT::MsgUtils->error_message($rsp, $::callback); return 1; } } $ret = xCAT::Goconserver::restart_service(); if ($ret) { $rsp->{data}->[0] = "Failed to start goconserver service."; - xCAT::MsgUtils->message("E", $rsp, $::callback); + xCAT::MsgUtils->error_message($rsp, $::callback); return 1; } $rsp->{data}->[0] = "Starting goconserver service ..."; - xCAT::MsgUtils->message("I", $rsp, $::callback); + xCAT::MsgUtils->info_message($rsp, $::callback); sleep(3); return 0; } @@ -197,19 +197,22 @@ sub makegocons { ); my $svboot = 0; + my $rsp; if (exists($req->{svboot})) { $svboot = 1; } if ($cleanupmode) { if (exists($req->{_allnodes}) && $req->{_allnodes}->[0] != 1) { - xCAT::SvrUtils::sendmsg([ 1, "Can not specify noderange together with -C|--cleanup." ], $::callback); + $rsp->{data}->[0] = "Failed to start goconserver service."; + xCAT::MsgUtils->error_message($rsp, $::callback); return 1; } return xCAT::Goconserver::cleanup_nodes($::callback); } my %cons_map = xCAT::Goconserver::get_cons_map($req); if (! %cons_map) { - xCAT::SvrUtils::sendmsg([ 1, "Could not get any console request entry" ], $::callback); + $rsp->{data}->[0] = "Could not get any console request entry."; + xCAT::MsgUtils->error_message($rsp, $::callback); return 1; } my $api_url = "https://$host:". xCAT::Goconserver::get_api_port(); @@ -230,13 +233,15 @@ sub makegocons { } elsif (lc($site_entry) ne "no") { # consoleondemand attribute is set, but it is not "yes" or "no" - xCAT::SvrUtils::sendmsg([ 1, "Unexpected value $site_entry for consoleondemand attribute in site table" ], $::callback); + $rsp->{data}->[0] = "Unexpected value $site_entry for consoleondemand attribute in site table."; + xCAT::MsgUtils->error_message($rsp, $::callback); } } my (@nodes); my $data = xCAT::Goconserver::gen_request_data(\%cons_map, $siteondemand, $::callback); if (! $data) { - xCAT::SvrUtils::sendmsg([ 1, "Could not generate the request data" ], $::callback); + $rsp->{data}->[0] = "Could not generate the request data."; + xCAT::MsgUtils->error_message($rsp, $::callback); return 1; } $ret = xCAT::Goconserver::delete_nodes($api_url, $data, $delmode, $::callback); @@ -245,7 +250,8 @@ sub makegocons { } $ret = xCAT::Goconserver::create_nodes($api_url, $data, $::callback); if ($ret != 0) { - xCAT::SvrUtils::sendmsg([ 1, "Failed to create console entry in goconserver. "], $::callback); + $rsp->{data}->[0] = "Failed to create console entry in goconserver."; + xCAT::MsgUtils->error_message($rsp, $::callback); return $ret; } return 0; From 4dbd36c3dafcc4a941372cbb5402d184129fc27c Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 20 Mar 2018 05:27:16 -0400 Subject: [PATCH 042/161] add more test cases for validation --- .../testcase/xcat-inventory/cases.node | 341 ++++++++++++++++++ xCAT-test/xcattest | 6 +- 2 files changed, 346 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.node b/xCAT-test/autotest/testcase/xcat-inventory/cases.node index ef626acf5..c91b9c24d 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.node +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.node @@ -2591,4 +2591,345 @@ check:rc==0 end +start:import_validation_json_node_arch_type +description:This case is used to test node validation function of xcat-inventory import json file. To test "arch" attribute +cmd:mkdir -p /tmp/import_validation_json_node_arch_type +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_arch_type/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_arch_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_info": { + "arch": "ppc" + }, + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv +check:output=~Error: failed to validate attribute +check:output=~arch +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_info": { + "arch": "ppc64" + }, + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=ppc64 +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_info": { + "arch": "ppc64el" + }, + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=ppc64el +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_info": { + "arch": "ppc64le" + }, + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=ppc64le +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_info": { + "arch": "x86_64" + }, + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=x86_64 +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo '{ + "node": { + "bogusnode": { + "device_info": { + "arch": "armv71" + }, + "device_type": "server", + "obj_info": { + "groups": "bogusgroup" + }, + "obj_type": "node", + "role": "compute" + } + }, +}' > /tmp/import_validation_json_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=armv71 +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:if [[ -e /tmp/import_validation_json_node_arch_type/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_arch_type/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_json_node_arch_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_arch_type/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_json_node_arch_type +check:rc==0 +end +start:import_validation_yaml_node_arch_type +description:This case is used to test node validation function of xcat-inventory import yaml file. To test "arch" attribute +cmd:mkdir -p /tmp/import_validation_yaml_node_arch_type +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_arch_type/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_arch_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_info: + arch: ppc + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv +check:output=~Error: failed to validate attribute +check:output=~arch +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_info: + arch: ppc64 + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=ppc64 +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_info: + arch: ppc64el + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=ppc64el +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_info: + arch: ppc64le + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=ppc64le +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_info: + arch: x86_64 + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=x86_64 +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + device_info: + arch: armv71 + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv +check:output=~Inventory import successfully +check:rc==0 +cmd:lsdef bogusnode +check:output=~Object name: bogusnode +check:output=~arch=armv71 +check:rc==0 +cmd:rmdef bogusnode +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_arch_type/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_arch_type/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_arch_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_arch_type/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_yaml_node_arch_type +check:rc==0 +end + +start:import_validation_yaml_node_securitylevel +description:This case is used to test node validation function of xcat-inventory import yaml file. To test "securitylevel" attribute +cmd:mkdir -p /tmp/import_validation_yaml_node_securitylevel +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_securitylevel/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_securitylevel/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:#!/bin/bash +echo "node: + bogusnode: + deprecated: + pdunodetype: pdu + device_info: + characteristics: pdu + device_type: server + obj_info: + groups: bogusgroup + obj_type: node + role: compute + security_info: + snmp: + securitylevel: noAuthNoPriv" >/tmp/import_validation_yaml_node_securitylevel/node.inv +check:rc==0 +cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_securitylevel/node.inv +check:output=~Error: failed to validate attribute +check:output=~securitylevel +check:rc!=0 +cmd:lsdef bogusnode +check:output=~Error: Could not find an object named 'bogusnode' +check:rc!=0 + +cmd:if [[ -e /tmp/import_validation_yaml_node_securitylevel/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_securitylevel/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_yaml_node_securitylevel/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_securitylevel/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_yaml_node_securitylevel +check:rc==0 +end diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index dedc49867..dbb218414 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -847,7 +847,11 @@ sub load_case { return 1; } while ($line = <$fd>) { - $line =~ s/^\s+|#[^!].+|\s+$//g; + if($newcmdstart){ + $line =~ s/\s+$//g ; + }else{ + $line =~ s/^\s+|#[^!].+|\s+$//g ; + } #skip blank and comment lines next if (length($line) == 0 || ($line =~ /^\s*#/)); From f9f5c4f8ad83c908e249a649c477c959350920d2 Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Tue, 20 Mar 2018 17:38:58 +0800 Subject: [PATCH 043/161] Change Milestone or Labels missing from error to warning in CI test (#4943) * Change Milestone or Labels missing from error to warning * Remove the plaintext of user name and password in CI log --- .travis.yml | 2 -- travis.pl | 11 ++++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 25ab2393e..0c936bf7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,6 @@ script: - echo $TRAVIS_JOB_NUMBER - echo $TRAVIS_BRANCH - echo $TRAVIS_COMMIT_MESSAGE -- echo $USERNAME -- echo $PASSWORD - echo $GITHUB_TOKEN - git log --pretty=format:"%s %b" -2 diff --git a/travis.pl b/travis.pl index 9478ab275..6fb7708f4 100644 --- a/travis.pl +++ b/travis.pl @@ -129,9 +129,14 @@ sub check_pr_format{ $check_result_str .= "> **PR FORMAT CORRECT**"; send_back_comment("$check_result_str"); }else{ - $check_result_str .= "> **PR FORMAT ERROR** : $checkrst"; - send_back_comment("$check_result_str"); - return 1; + if($checkrst =~ /milestone/ || $checkrst =~ /labels/){ + $check_result_str .= "> **PR FORMAT WARNING** : $checkrst"; + send_back_comment("$check_result_str"); + }else{ + $check_result_str .= "> **PR FORMAT ERROR** : $checkrst"; + send_back_comment("$check_result_str"); + return 1; + } } } return 0; From 3216511a325c438069be6ec3b60aed4c5c4749ae Mon Sep 17 00:00:00 2001 From: bybai Date: Tue, 20 Mar 2018 05:53:03 -0400 Subject: [PATCH 044/161] fix rflash -d hang when there is no firmaware tars in SN --- xCAT-server/lib/xcat/plugins/openbmc.pm | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 09f4de63b..c15d360a2 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -60,7 +60,6 @@ $::RSETBOOT_URL_PATH = "boot"; $::UPLOAD_AND_ACTIVATE = 0; $::UPLOAD_ACTIVATE_STREAM = 0; $::RFLASH_STREAM_NO_HOST_REBOOT = 0; -$::TAR_FILE_PATH = ""; $::NO_ATTRIBUTES_RETURNED = "No attributes returned from the BMC."; $::UPLOAD_WAIT_ATTEMPT = 6; @@ -1388,12 +1387,6 @@ sub parse_args { if ($invalid_options) { return ([ 1, "Invalid option specified $invalid_options"]); } - if (!opendir(DIR, $tarball_path[0])) { - return ([1, "Can't open directory : $tarball_path[0]"]); - } else { - $::TAR_FILE_PATH = $tarball_path[0]; - closedir(DIR); - } } elsif ($option_flag =~ /^-c$|^--check$|^-u$|^--upload$|^-a$|^--activate$/) { return ([ 1, "Invalid firmware specified with $option_flag" ]); } else { @@ -1897,8 +1890,15 @@ sub parse_command_status { my $purpose_tag = '"purpose="'; my $purpose_value; my $version_value; - + my $tarfile_path; if (defined $update_file) { + if ($streamline) { + if ($update_file =~ /^\//){ + $tarfile_path = $update_file; + } else { + $tarfile_path =xCAT::Utils->full_path($update_file, $::cwd); + } + } # Filename or file id was specified if ($update_file =~ /.*\.tar$/) { # Filename ending on .tar was specified @@ -1950,13 +1950,18 @@ sub parse_command_status { # Display firmware version of the specified .tar file xCAT::SvrUtils::sendmsg("TAR $purpose_value Firmware Product Version\: $version_value", $callback); } - } elsif (opendir(DIR, $::TAR_FILE_PATH)) { + } elsif (defined $tarfile_path) { + if (!opendir(DIR, $tarfile_path)) { + xCAT::SvrUtils::sendmsg("Can't open directory : $tarfile_path", $callback); + closedir(DIR); + return 1; + } my @tar_files = readdir(DIR); foreach my $file (@tar_files) { if ($file !~ /.*\.tar$/) { next; } else { - my $full_path_file = $::TAR_FILE_PATH."/".$file; + my $full_path_file = $tarfile_path."/".$file; $full_path_file=~s/\/\//\//g; my $firmware_version_in_file = `$grep_cmd $version_tag $full_path_file`; my $purpose_version_in_file = `$grep_cmd $purpose_tag $full_path_file`; From ce19f4a4dfc41e9114b1b696866273432d90f592 Mon Sep 17 00:00:00 2001 From: zet809 Date: Tue, 20 Mar 2018 17:53:52 +0800 Subject: [PATCH 045/161] Fix the rcons Console not ready issue but the bmc is accessible in fact (#4975) --- xCAT-server/lib/perl/xCAT/OPENBMC.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index bc583ee87..a3c1a78be 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -255,7 +255,7 @@ sub run_cmd_in_perl { } # List of commands currently not supported in Python - my @unsupported_in_python_commands = ('rflash', 'rspconfig', 'reventlog'); + my @unsupported_in_python_commands = ('rflash', 'rspconfig', 'reventlog', 'getopenbmccons'); if ($command ~~ @unsupported_in_python_commands) { # Command currently not supported in Python From b8a489899b9117c9aa7dbaa632cd48d277c22199 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 19 Mar 2018 04:17:58 -0400 Subject: [PATCH 046/161] rflash in python for OpenBMC --- .../lib/python/agent/common/rest.py | 2 +- .../lib/python/agent/common/utils.py | 7 +- .../agent/hwctl/executor/openbmc_flash.py | 562 ++++++++++++++++ .../agent/hwctl/executor/openbmc_inventory.py | 27 +- .../agent/hwctl/executor/openbmc_power.py | 25 +- .../lib/python/agent/hwctl/flash.py | 54 ++ .../lib/python/agent/hwctl/inventory.py | 5 +- .../lib/python/agent/hwctl/openbmc_client.py | 51 +- .../lib/python/agent/xcatagent/openbmc.py | 629 ++---------------- .../python/agent/xcatagent/openbmc_rest.py | 113 ---- xCAT-server/lib/xcat/plugins/openbmc2.pm | 1 - 11 files changed, 751 insertions(+), 725 deletions(-) create mode 100644 xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py create mode 100644 xCAT-openbmc-py/lib/python/agent/hwctl/flash.py delete mode 100644 xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc_rest.py diff --git a/xCAT-openbmc-py/lib/python/agent/common/rest.py b/xCAT-openbmc-py/lib/python/agent/common/rest.py index 88c836998..46a9f7b2e 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/rest.py +++ b/xCAT-openbmc-py/lib/python/agent/common/rest.py @@ -122,7 +122,7 @@ class RestSession(object): response, err = sub.communicate() if not response: - error = 'Error: Did not receive response from server after ' \ + error = 'Did not receive response from server after ' \ 'running command \'%s\'' % request_cmd raise SelfServerException(error) diff --git a/xCAT-openbmc-py/lib/python/agent/common/utils.py b/xCAT-openbmc-py/lib/python/agent/common/utils.py index d05768a7d..e84bca7b1 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/utils.py +++ b/xCAT-openbmc-py/lib/python/agent/common/utils.py @@ -7,7 +7,7 @@ import struct import sys import inspect -import re +import re, os import logging from logging.handlers import SysLogHandler @@ -92,6 +92,11 @@ def mask_int2str(mask_int): mask_num = (0x1 << 32) - (0x1 << (32 - mask_int)) return "%s.%s.%s.%s" % (str((mask_num >> 24) & 0xff), str((mask_num >>16)&0xff), str((mask_num >> 8) & 0xff), str(mask_num & 0xff)) +def get_full_path(cwd, directory): + if not os.path.isabs(directory): + directory = '%s/%s' % (cwd, directory) + return directory + class Messager(object): def __init__(self, name=None): self.logger = logging.getLogger(name or 'xcatagent') diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py new file mode 100644 index 000000000..ecfc19f13 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py @@ -0,0 +1,562 @@ +#!/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 +import os, re + +from common import utils +from common.task import ParallelNodesCommand +from common.exceptions import SelfClientException, SelfServerException +from hwctl import openbmc_client as openbmc + +import logging +logger = logging.getLogger('xcatagent') + +XCAT_LOG_DIR = "/var/log/xcat" +XCAT_LOG_RFLASH_DIR = XCAT_LOG_DIR + "/rflash/" + +class OpenBMCFlashTask(ParallelNodesCommand): + """Executor for flash-related actions.""" + activate_result = {} + firmware = {} + firmware_file = None + log_handle = {} + nodes_num = 0 + + def _msg_process(self, node, msg, msg_type='I', update_rc=False, checkv=False): + + if msg_type == 'E': + self.callback.error(msg, node) + elif not checkv: + self.callback.info('%s: %s' % (node, msg)) + elif self.verbose: + self.callback.info('%s: %s' % (node, msg)) + + if update_rc: + self.activate_result.update({node: msg}) + + if node not in self.log_handle: + log_file = XCAT_LOG_RFLASH_DIR + '/' + node + '.log' + self.log_handle.update({node: open(log_file, 'a')}) + try: + self.log_handle[node].writelines(msg + '\n') + self.log_handle[node].flush() + except Exception as e: + self.callback.error('Failed to record rflash log for node %s' % node) + + def _firmware_file_check(self, firmware_file, **kw): + + target_file = utils.get_full_path(self.cwd, firmware_file) + self.firmware_file = target_file + + if (not os.access(target_file, os.F_OK) or + not os.access(target_file, os.R_OK)): + error = 'Cannot access %s. Check the management ' \ + 'node and/or service nodes.' % target_file + self.callback.error(error) + raise Exception('Invalid firmware file %s' % target_file) + + def validate_activate_firm(self, task, activate_arg, **kw): + + if activate_arg.endswith('.tar'): + self._firmware_file_check(activate_arg) + else: + if not re.match('\A[0-9a-fA-F]+\Z', activate_arg): + self.callback.error('Invalid firmware ID %s' % activate_arg) + + def validate_delete_firm(self, task, delete_id, **kw): + + if not re.match('\A[0-9a-fA-F]+\Z', delete_id): + self.callback.error('Invalid firmware ID %s' % activate_arg) + + def validate_upload_firm(self, task, upload_file, **kw): + + self._firmware_file_check(upload_file) + + def _get_firmware_version(self, target_file): + + grep_cmd = '/usr/bin/grep -a' + version_cmd = grep_cmd + ' ^version= ' + target_file + purpose_cmd = grep_cmd + ' purpose= ' + target_file + firmware = os.popen(version_cmd).readlines()[0].split('=')[-1].strip() + purpose = os.popen(purpose_cmd).readlines()[0].split('=')[-1].strip().split('.')[-1] + return { firmware: {'purpose': purpose} } + + def pre_activate_firm(self, task, activate_arg, **kw): + + if not os.path.exists(XCAT_LOG_RFLASH_DIR): + os.makedirs(XCAT_LOG_RFLASH_DIR) + + if activate_arg.endswith('.tar'): + version = self._get_firmware_version() + self.firmware.update(version) + self.callback.info('Attempting to upload %s, please wait...' % self.firmware_file) + else: + self.callback.info('Attempting to activate ID=%s, please wait..' % activate_arg) + self.nodes_num = len(self.inventory) + + def pre_delete_firm(self, task, delete_id, **kw): + + self.callback.info('Attempting to delete ID=%s, please wait..' % delete_id) + + def pre_flash_process(self, task, directory, no_host_reboot, **kw): + + if not os.path.exists(XCAT_LOG_RFLASH_DIR): + os.makedirs(XCAT_LOG_RFLASH_DIR) + + directory = utils.get_full_path(self.cwd, directory) + tmp_dict = {'BMC': [], 'Host': []} + for filename in os.listdir(directory): + if filename.endswith('.tar'): + filename = os.path.join(directory, filename) + try: + version = self._get_firmware_version(filename) + except Exception as e: + continue + self.firmware.update(version) + for key, value in version.items(): + tmp_dict[ value['purpose'] ].append(filename) + self.firmware[key].update({'file': filename}) + + bmc_file_num = len(tmp_dict['BMC']) + host_file_num = len(tmp_dict['Host']) + error = None + if not bmc_file_num: + error = 'No BMC tar file found in %s' % directory + elif not host_file_num: + error = 'No HOST tar file found in %s' % directory + elif bmc_file_num > 1: + error = 'More than 1 BMC tar file %s found in %s' \ + % (' '.join(tmp_dict['BMC']), directory) + elif host_file_num > 1: + error = 'More than 1 HOST tar file %s found in %s' \ + % (' '.join(tmp_dict['Host']), directory) + if error: + self.callback.error(error) + raise Exception('No or More tar file found') + + self.callback.info('Attempting to upload %s and %s, please wait..' \ + % (tmp_dict['BMC'][0], tmp_dict['Host'][0])) + self.nodes_num = len(self.inventory) + + def pre_upload_firm(self, task, upload_arg, **kw): + + if not os.path.exists(XCAT_LOG_RFLASH_DIR): + os.makedirs(XCAT_LOG_RFLASH_DIR) + self.callback.info('Attempting to upload %s, please wait...' % self.firmware_file) + + def _get_firm_id(self, obmc, node): + + mapping_ids = [] + if self.firmware: + version_list = self.firmware.keys() + else: + return [] + + for i in range(6): + try: + has_functional, firm_obj_dict = obmc.list_firmware() + except (SelfServerException, SelfClientException) as e: + self._msg_process(node, e.message, msg_type='E', update_rc=True) + return [] + + for key, value in firm_obj_dict.items(): + if value.version and value.version in version_list: + firm_id = key.split('-')[-1] + mapping_ids.append(firm_id) + msg = 'Firmware upload successful. ' \ + 'Attempting to activate firmware: %s (ID: %s)' \ + % (value.version, firm_id) + self._msg_process(node, msg, update_rc=True) + version_list.remove(value.version) + + if not version_list: + return mapping_ids + for i in version_list: + msg = 'Could not find ID for firmware %s to '\ + 'activate, waiting %d seconds and retry...' \ + % (i, 10) + self._msg_process(node, msg, update_rc=True, checkv=True) + gevent.sleep ( 10 ) + + error = [] + for i in version_list: + msg = 'Could not find firmware %s after waiting %d seconds.' % (i, 10*6) + error.qppend(msg) + self._msg_process(node, msg, msg_type='E') + + if error: + msg = ' '.join(error) + self.activate_result.update({node: msg}) + return [] + + def _check_id_status(self, obmc, check_ids, node, only_act=True): + + firm_ids = check_ids + priority_ids = [] + process_status = {} + for i in range(80): + try: + has_functional, firm_obj_dict = obmc.list_firmware() + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E', update_rc=True) + + for key, value in firm_obj_dict.items(): + key_id = key.split('-')[-1] + if key_id in firm_ids: + activation_state = value.active + firm_version = value.version + if activation_state == 'Failed': + activation_msg = 'Firmware %s activation failed.' % (firm_version) + self._msg_process(node, activation_msg, msg_type='E', update_rc=True) + firm_ids.remove(key_id) + if activation_state == 'Active': + activation_msg = 'Firmware %s activation successful.' % (firm_version) + self._msg_process(node, activation_msg, update_rc=True) + firm_ids.remove(key_id) + if value.priority != 0: + priority_ids.append(key_id) + if activation_state == 'Activating': + activating_progress_msg = 'Activating %s ... %s%%' \ + % (firm_version, value.progress) + process_status[key_id] = activating_progress_msg + self._msg_process(node, activating_progress_msg, checkv=True) + + if not firm_ids: + break + gevent.sleep( 15 ) + + error = [] + for i in firm_ids: + msg = 'After %d seconds check the firmware id %s current status is "%s"' \ + % (80*15, process_status[i], i) + error.append(msg) + self._msg_process(node, msg, msg_type='E') + + if error: + msg = ' '.join(error) + self.activate_result.update({node: msg}) + return + + for i in priority_ids: + try: + obmc.set_priority(i) + except (SelfServerException, SelfClientException) as e: + msg = e.message + error.append(msg) + self._msg_process(node, msg, msg_type='E') + + if error: + msg = ' '.join(error) + self.activate_result.update({node: msg}) + return + + self.activate_result.update({node: 'SUCCESS'}) + + def _reboot_to_effect(self, obmc, no_host_reboot, node): + + self._msg_process(node, 'Firmware will be flashed on reboot, deleting all BMC diagnostics...') + try: + obmc.clear_dump('all') + except (SelfServerException, SelfClientException) as e: + self.callback.warn('%s: Could not clear BMC diagnostics successfully %s, ignoring...' % (node, e.message)) + + try: + obmc.reboot_bmc() + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E', update_rc=True) + + self._msg_process(node, openbmc.RPOWER_STATES['bmcreboot'], update_rc=True) + + gevent.sleep( 10 ) + + bmc_state = None + for i in range(20): + try: + obmc.login() + state = obmc.get_bmc_state() + bmc_state = state.get('bmc') + + if bmc_state == 'Ready': + break + except (SelfServerException, SelfClientException) as e: + self._msg_process(node, e.message, checkv=True) + + self._msg_process(node, 'Retry BMC state, wait for 15 seconds ...', update_rc=True) + gevent.sleep( 15 ) + + if bmc_state != 'Ready': + error = 'Sent bmcreboot but state did not change to BMC Ready after ' \ + 'waiting %s seconds. (State=BMC %s).' % (20*15, bmc_state) + return self._msg_process(node, error, msg_type='E', update_rc=True) + + self._msg_process(node, 'BMC %s' % bmc_state, update_rc=True) + + if no_host_reboot: + self.activate_result.update({node: 'SUCCESS'}) + return + + try: + obmc.set_power_state('off') + self.callback.update_node_attributes('status', node, 'powering-off') + + off_flag = False + start_timeStamp = int(time.time()) + for i in range (0, 30): + states = obmc.list_power_states() + state = obmc.get_host_state(states) + if openbmc.RPOWER_STATES.get(state) == 'off': + off_flag = True + break + gevent.sleep( 2 ) + + end_timeStamp = int(time.time()) + + if not off_flag: + error = 'Error: Sent power-off command but state did not change ' \ + 'to off after waiting %s seconds. (State= %s).' % (end_timeStamp - start_timeStamp, status) + return self._msg_process(node, error, update_rc=True) + + ret = obmc.set_power_state('on') + self.callback.update_node_attributes('status', node, 'powering-on') + + self._msg_process(node, 'reset') + self.activate_result.update({node: 'SUCCESS'}) + except (SelfServerException, SelfClientException) as e: + self._msg_process(node, e.message, update_rc=True) + + def activate_firm(self, activate_arg, **kw): + + node = kw['node'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + obmc.login() + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E', update_rc=True) + + firmware_version = '' + if self.firmware_file: + firmware_version = self.firmware.keys()[0] + try: + obmc.upload_firmware(self.firmware_file) + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E', update_rc=True) + + activate_ids = self._get_firm_id(obmc, node) + if not activate_ids: + return + activate_id = activate_ids[0] + else: + activate_id = activate_arg + + error = '' + try: + obmc.activate_firmware(activate_id) + except SelfServerException as e: + error = e.message + except SelfClientException as e: + if e.code == 403: + error = 'Invalid ID provided to activate. ' \ + 'Use the -l option to view valid firmware IDs.' + else: + error = e.message + if error: + return self._msg_process(node, error, msg_type='E', update_rc=True) + + msg = 'rflash %s started, please wait...' % firmware_version + self._msg_process(node, msg, checkv=True) + + check_ids = [activate_id] + self._check_id_status(obmc, check_ids, node) + + def delete_firm(self, delete_id, **kw): + + node = kw['node'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + error = '' + try: + obmc.login() + except (SelfServerException, SelfClientException) as e: + return self.callback.error(e.message, node) + + try: + has_functional, firm_obj_dict = obmc.list_firmware() + except (SelfServerException, SelfClientException) as e: + return self.callback.error(e.message, node) + + host_flag = False + for key, value in firm_obj_dict.items(): + key_id = key.split('-')[-1] + if key_id != delete_id: + continue + if value.functional or (value.priority == 0 and not has_functional): + if value.purpose == 'BMC': + return self.callback.error('Deleting currently active BMC firmware' \ + ' is not supported', node) + elif value.purpose == 'Host': + host_flag = True + break + else: + self.callback.error('Unable to determine the purpose of the ' \ + 'firmware to delete', node) + + if host_flag: + try: + states = obmc.list_power_states() + state = obmc.get_host_state(states) + if openbmc.RPOWER_STATES.get(state) == 'on': + return self.callback.error('Deleting currently active firmware on' \ + ' powered on host is not supported', node) + except (SelfServerException, SelfClientException) as e: + return self.callback.error(e.message, node) + + try: + obmc.delete_firmware(delete_id) + except SelfServerException as e: + error = e.message + except SelfClientException as e: + if e.code == 404: + error = 'Invalid ID provided to delete. ' \ + 'Use the -l option to view valid firmware IDs.' + else: + error = e.message + + if error: + self.callback.error(error, node) + else: + self.callback.info('%s: [%s] Firmware removed' % (node, delete_id)) + + def flash_process(self, directory, no_host_reboot, **kw): + + node = kw['node'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + obmc.login() + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E', update_rc=True) + + try: + for key, value in self.firmware.items(): + obmc.upload_firmware(value['file']) + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E', update_rc=True) + + activate_ids = self._get_firm_id(obmc, node) + if not activate_ids: + return + + for i in activate_ids: + error = '' + try: + obmc.activate_firmware(i) + except SelfServerException as e: + error = e.message + except SelfClientException as e: + if e.code == 403: + error = 'Invalid ID %s provided to activate. Use the -l option ' \ + 'to view valid firmware IDs.' % i + else: + error = e.message + if error: + return self._msg_process(node, error, msg_type='E', update_rc=True) + + for key in self.firmware: + msg = 'rflash %s started, please wait...' % key + self._msg_process(node, msg, checkv=True) + + self._check_id_status(obmc, activate_ids, node, only_act=False) + + self._reboot_to_effect(obmc, no_host_reboot, node) + + def list_firm_info(self, **kw): + + node = kw['node'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + firm_info = [] + try: + obmc.login() + has_functional, firm_obj_dict = obmc.list_firmware() + + except (SelfServerException, SelfClientException) as e: + return self.callback.error(e.message, node) + + firm_info.append('%-8s %-7s %-10s %-s' % ('ID', 'Purpose', 'State', 'Version')) + firm_info.append('-' * 55) + + for key, value in firm_obj_dict.items(): + status = value.active + if value.functional: + status += '(*)' + elif value.priority == 0: + if not has_functional: + status += '(*)' + else: + status += '(+)' + + firm_info.append('%-8s %-7s %-10s %-s' % (key.split('-')[-1], + value.purpose, status, value.version)) + + for info in firm_info: + self.callback.info('%s: %s' % (node, info)) + + return firm_info + + def upload_firm(self, upload_file, **kw): + + node = kw['node'] + obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + obmc.login() + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E') + + try: + obmc.upload_firmware(self.firmware_file) + self._msg_process(node, 'Firmware upload successful. Use -l option to list.') + except (SelfServerException, SelfClientException) as e: + return self._msg_process(node, e.message, msg_type='E') + + def _flash_summary(self): + + if not self.activate_result: + return self.callback.error('No summary infomation') + + success_num = failed_num = 0 + failed_list = [] + for key, value in self.activate_result.items(): + if value == 'SUCCESS': + success_num += 1 + else: + failed_num += 1 + failed_list.append('%s: %s' % (key, value)) + + self.callback.info('-' * 55) + self.callback.info('%s complete: Total=%d Success=%d Failed=%d' % \ + ('Firmware update', self.nodes_num, success_num, failed_num)) + + for i in failed_list: + self.callback.info(i) + self.callback.info('-' * 55) + + def post_activate_firm(self, task, activate_arg, **kw): + + self._flash_summary() + + def post_flash_process(self, task, directory, no_host_reboot, **kw): + + self._flash_summary() diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py index 4ff829b46..6cd2ea871 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py @@ -8,6 +8,7 @@ from __future__ import print_function import gevent import time +import os from common.task import ParallelNodesCommand from common.exceptions import SelfClientException, SelfServerException @@ -20,6 +21,30 @@ logger = logging.getLogger('xcatagent') class OpenBMCInventoryTask(ParallelNodesCommand): """Executor for inventory-related actions.""" + def pre_get_firm_info(self, task, target_file=None, **kw): + + if not target_file: + return + + target_file = utils.get_full_path(self.cwd, target_file) + + grep_cmd = '/usr/bin/grep -a' + version_cmd = grep_cmd + ' ^version= ' + target_file + purpose_cmd = grep_cmd + ' purpose= ' + target_file + purpose_ver = os.popen(purpose_cmd).readlines() + firmware_ver = os.popen(version_cmd).readlines() + if purpose_ver: + purpose_ver = purpose_ver[0].split('=')[-1].strip() + else: + purpose_ver = '' + if firmware_ver: + firmware_ver = firmware_ver[0].split('=')[-1].strip() + else: + firmware_ver = '' + + self.callback.info('TAR %s Firmware Product Version: %s' \ + % (purpose_ver,firmware_ver)) + def _get_firm_info(self, firm_info_list): (has_functional, firm_obj_dict) = firm_info_list firm_info = [] @@ -97,7 +122,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand): return inventory_info - def get_firm_info(self, **kw): + def get_firm_info(self, target_file=None, **kw): node = kw['node'] obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index 024f455cf..ae3d8fd8c 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -26,25 +26,6 @@ POWER_STATE_DB = { class OpenBMCPowerTask(ParallelNodesCommand): """Executor for power-related actions.""" - def _determine_state(self, states): - - chassis_state = states.get('chassis') - host_state = states.get('host') - state = 'Unknown' - if chassis_state == 'Off': - state = chassis_state - - elif chassis_state == 'On': - if host_state == 'Off': - state = 'chassison' - elif host_state in ['Quiesced', 'Running']: - state = host_state - else: - state = 'Unexpected host state=%s' % host_state - else: - state = 'Unexpected chassis state=%s' % chassis_state - return state - def get_state(self, **kw): node = kw['node'] @@ -54,7 +35,7 @@ class OpenBMCPowerTask(ParallelNodesCommand): try: obmc.login() states = obmc.list_power_states() - state = self._determine_state(states) + state = obmc.get_host_state(states) self.callback.info('%s: %s' % (node, openbmc.RPOWER_STATES.get(state, state))) except (SelfServerException, SelfClientException) as e: @@ -115,7 +96,7 @@ class OpenBMCPowerTask(ParallelNodesCommand): try: obmc.login() states = obmc.list_power_states() - status = self._determine_state(states) + status = obmc.get_host_state(states) new_status ='' if optype == 'reset' and status in ['Off', 'chassison']: @@ -130,7 +111,7 @@ class OpenBMCPowerTask(ParallelNodesCommand): start_timeStamp = int(time.time()) for i in range (0, 30): states = obmc.list_power_states() - status = self._determine_state(states) + status = obmc.get_host_state(states) if openbmc.RPOWER_STATES.get(status) == 'off': off_flag = True break diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py new file mode 100644 index 000000000..8f30612ca --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# + +class FlashInterface(object): + """Interface for flash-related actions.""" + interface_type = 'flash' + version = '1.0' + + def activate_firm(self, task, activate_arg): + """Activate firmware. + + :param task: a Task instance containing the nodes to act on. + :activate_arg: arg for activate + """ + return task.run('activate_firm', activate_arg) + + def delete_firm(self, task, delete_id): + """Delete firmware. + + :param task: a Task instance containing the nodes to act on. + :param delete_id: firmware id want to delete + """ + return task.run('delete_firm', delete_id) + + def flash_process(self, task, directory, no_host_reboot): + """Upload and activate firmware + + :param task: a Task instance containing the nodes to act on. + :directory: firmware directory + """ + return task.run('flash_process', directory, no_host_reboot) + + def list_firm_info(self, task): + """List firmware + + :param task: a Task instance containing the nodes to act on. + """ + return task.run('list_firm_info') + + def upload_firm(self, task, upload_file): + """Upload firmware file. + + :param task: a Task instance containing the nodes to act on. + :param upload_file: the file want to upload + """ + return task.run('upload_firm', upload_file) + +class DefaultFlashManager(FlashInterface): + """Interface for flash-related actions.""" + pass diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py index 9a85daa09..9709f1659 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py @@ -19,13 +19,14 @@ class InventoryInterface(object): """ return task.run('get_info', inventory_type) - def get_firm_info(self, task): + def get_firm_info(self, task, target_arg=None): """Return the firm info of the task's nodes. :param task: a Task instance containing the nodes to act on. + :param check_arg: firmware file to check, for rflash check :return firm info list """ - return task.run('get_firm_info') + return task.run('get_firm_info', target_arg) class DefaultInventoryManager(InventoryInterface): """Interface for inventory-related actions.""" diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index b1654a884..da347fa82 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -145,15 +145,15 @@ BOOTSOURCE_SET_STATE = { FIRM_URLS = { "activate" : { - "path" : "/software/%(id)s/attr/RequestedActivation", - "field" : "Software.Activation.RequestedActivations.Active", + "path" : "/software/%s/attr/RequestedActivation", + "field" : "xyz.openbmc_project.Software.Activation.RequestedActivations.Active", }, "delete" : { - "path" : "/software/%(id)s/action/Delete", + "path" : "/software/%s/action/Delete", "field" : [], }, "priority" : { - "path" : "/software/%(id)s/attr/Priority", + "path" : "/software/%s/attr/Priority", "field" : False, }, "list" : { @@ -426,6 +426,25 @@ class OpenBMCRest(object): # TODO: Need special handling for bmc reset, as it is normal bmc may return error pass + def get_host_state(self, states): + + chassis_state = states.get('chassis') + host_state = states.get('host') + state = 'Unknown' + if chassis_state == 'Off': + state = chassis_state + + elif chassis_state == 'On': + if host_state == 'Off': + state = 'chassison' + elif host_state in ['Quiesced', 'Running']: + state = host_state + else: + state = 'Unexpected host state=%s' % host_state + else: + state = 'Unexpected chassis state=%s' % chassis_state + return state + def set_one_time_boot_enable(self, enabled): payload = { "data": enabled } @@ -542,6 +561,18 @@ class OpenBMCRest(object): error = 'Received wrong format response: %s' % inventory_data raise SelfServerException(error) + def activate_firmware(self, activate_id): + + payload = { "data": FIRM_URLS['activate']['field'] } + url = FIRM_URLS['activate']['path'] % activate_id + return self.request('PUT', url, payload=payload, cmd='activate_firmware') + + def delete_firmware(self, delete_id): + + payload = { "data": FIRM_URLS['delete']['field'] } + url = FIRM_URLS['delete']['path'] % delete_id + return self.request('POST', url, payload=payload, cmd='delete_firmware') + def list_firmware(self): data = self.request('GET', FIRM_URLS['list']['path'], cmd='list_firmware') @@ -564,6 +595,18 @@ class OpenBMCRest(object): return bool(func_list), fw_dict + def upload_firmware(self, upload_file): + + headers = {'Content-Type': 'application/octet-stream'} + path = HTTP_PROTOCOL + self.bmcip + '/upload/image/' + self.upload('PUT', path, upload_file, headers=headers, cmd='upload_firmware') + + def set_priority(self, firm_id): + + payload = { "data": FIRM_URLS['priority']['field'] } + url = FIRM_URLS['priority']['path'] % firm_id + return self.request('PUT', url, payload=payload, cmd='set_priority') + # Extract all eventlog info and parse it def get_eventlog_info(self): diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 6d382d140..6dff2526f 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -16,6 +16,7 @@ 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 @@ -23,6 +24,7 @@ from hwctl.executor.openbmc_bmcconfig import OpenBMCBmcConfigTask from hwctl.executor.openbmc_eventlog import OpenBMCEventlogTask from hwctl.beacon import DefaultBeaconManager from hwctl.setboot import DefaultBootManager +from hwctl.flash import DefaultFlashManager from hwctl.inventory import DefaultInventoryManager from hwctl.power import DefaultPowerManager from hwctl.sensor import DefaultSensorManager @@ -30,7 +32,6 @@ from hwctl.bmcconfig import DefaultBmcConfigManager from hwctl.eventlog import DefaultEventlogManager from xcatagent import base -import openbmc_rest import logging logger = logging.getLogger('xcatagent') if not logger.handlers: @@ -50,38 +51,6 @@ all_nodes_result = {} # global variables of rbeacon BEACON_SET_OPTIONS = ('on', 'off') -# global variables of rflash -RFLASH_OPTIONS = { - "-a" : "activate", - "--activate" : "activate", - "-c" : "check", - "--check" : "check", - "-d" : "direcory", - "--delete" : "delete", - "-l" : "list", - "--list" : "list", - "-u" : "upload", - "--upload" : "upload", -} - -RFLASH_URLS = { - "activate" : { - "url" : PROJECT_URL + "/software/#ACTIVATE_ID#/attr/RequestedActivation", - "field" : "xyz.openbmc_project.Software.Activation.RequestedActivations.Active", - }, - "delete" : { - "url" : PROJECT_URL + "/software/#DELETE_ID#/action/Delete", - "field" : [], - }, - "upload" : { - "url" : "/upload/image/", - }, - "priority" : { - "url" : PROJECT_URL + "/software/#PRIORITY_ID#/attr/Priority", - "field" : False, - } -} - RSPCONFIG_GET_OPTIONS = ['ip','ipsrc','netmask','gateway','vlan','ntpservers','hostname','bootmode','autoreboot','powersupplyredundancy','powerrestorepolicy'] RSPCONFIG_SET_OPTIONS = { 'ip':'.*', @@ -126,12 +95,6 @@ The supported attributes and its values to set are: powerrestorepolicy={always_on|always_off|restore} """ % RSPCONFIG_GET_OPTIONS -XCAT_LOG_DIR = "/var/log/xcat" -XCAT_LOG_RFLASH_DIR = XCAT_LOG_DIR + "/rflash/" - -# global variable of firmware information -FIRM_URL = PROJECT_URL + "/software/enumerate" - #global variables of rinv INVENTORY_OPTIONS = ('all', 'cpu', 'dimm', 'firm', 'model', 'serial') @@ -151,452 +114,6 @@ VITALS_OPTIONS = ('all', 'altitude', 'fanspeed', 'leds', 'power', # global variables of reventlog EVENTLOG_OPTIONS = ('list', 'clear', 'resolved') -class OpenBMC(base.BaseDriver): - - headers = {'Content-Type': 'application/json'} - - def __init__(self, messager, name, node_info): - super(OpenBMC, self).__init__(messager) - self.node = name - for key, value in node_info.items(): - setattr(self, key, value) - global DEBUGMODE - self.client = openbmc_rest.OpenBMCRest(name, messager, DEBUGMODE) - - def _login(self): - """ Login - :raise: error message if failed - """ - url = HTTP_PROTOCOL + self.bmcip + '/login' - data = { "data": [ self.username, self.password ] } - self.client.request('POST', url, OpenBMC.headers, data, 'login') - return RESULT_OK - - def _msg_process_rflash (self, msg, update_dict, checkv): - """deal with msg during rflash - :param msg: the msg want to process - """ - if not checkv: - self.messager.info('%s: %s' % (self.node, msg)) - elif VERBOSE: - self.messager.info('%s: %s' % (self.node, msg)) - self.rflash_log_handle.writelines(msg + '\n') - self.rflash_log_handle.flush() - if update_dict: - utils.update2Ddict(update_dict, self.node, 'result', [msg]) - - def _firm_info(self, status): - """List firmware information including additional - called by rflash check and rinv firm - :returns: firmware information - """ - firm_output = [] - try: - (has_functional, firm_info) = self._get_firm_info(status) - except (xcat_exception.SelfServerException, - xcat_exception.SelfClientException) as e: - firm_output.append(e.message) - return firm_output - - keys = firm_info.keys() - keys.sort() - for key in keys: - flag = '' - if 'is_functional' in firm_info[key]: - flag = '*' - elif ('Priority' in firm_info[key] and - firm_info[key]['Priority'] == '0'): - if not has_functional: - flag = '*' - else: - flag = '+' - - if not flag and not VERBOSE: - continue - - firm_output.append('%s Firmware Product: %s (%s)%s' % - (firm_info[key]['Purpose'], - firm_info[key]['Version'], - firm_info[key]['Activation'], flag)) - if 'ExtendedVersion' in firm_info[key]: - extendeds = firm_info[key]['ExtendedVersion'].split(',') - extendeds.sort() - for extended in extendeds: - firm_output.append('%s Firmware Product: ' \ - '-- additional info: %s' % \ - (firm_info[key]['Purpose'], extended)) - - return firm_output - - def _get_firm_info(self, status): - """get firmware information - :param status: current status - :returns: firmware version information - """ - firm_info = {} - has_functional = False - url = HTTP_PROTOCOL + self.bmcip + FIRM_URL - response = self.client.request('GET', url, OpenBMC.headers, '', status) - functional_url = PROJECT_URL + '/software/functional' - - for key in response['data']: - key_id = key.split('/')[-1] - if key_id == 'functional': - for endpoint in response['data'][key]['endpoints']: - purpose = response['data'][endpoint]['Purpose'].split('.')[-1] - key_sort = purpose + '-' + endpoint.split('/')[-1] - - utils.update2Ddict(firm_info, key_sort, 'is_functional', True) - has_functional = True - - if 'Version' in response['data'][key]: - purpose = response['data'][key]['Purpose'].split('.')[-1] - key_sort = purpose + '-' + key_id - if (functional_url in response['data'] and - key in response['data'][functional_url]['endpoints']): - utils.update2Ddict(firm_info, key_sort, 'is_functional', True) - utils.update2Ddict(firm_info, key_sort, 'Version', - response['data'][key]['Version']) - utils.update2Ddict(firm_info, key_sort, 'Purpose', purpose) - utils.update2Ddict(firm_info, key_sort, 'Activation', - response['data'][key]['Activation'].split('.')[-1]) - if 'Priority' in response['data'][key]: - utils.update2Ddict(firm_info, key_sort, 'Priority', - str(response['data'][key]['Priority'])) - if 'ExtendedVersion' in response['data'][key]: - utils.update2Ddict(firm_info, key_sort, 'ExtendedVersion', - response['data'][key]['ExtendedVersion']) - if 'Progress' in response['data'][key]: - utils.update2Ddict(firm_info, key_sort, 'Progress', - response['data'][key]['Progress']) - - return (has_functional, firm_info) - - def _get_firm_id(self, firm_list): - """get firmware id - :param firm_list: the list of firmware versions - :return: result and info list - """ - firm_ids = [] - url = HTTP_PROTOCOL + self.bmcip + FIRM_URL - - for i in range(6): - try: - response = self.client.request('GET', url, OpenBMC.headers, - '', 'rflash_check_id') - except (xcat_exception.SelfServerException, - xcat_exception.SelfClientException) as e: - self._msg_process_rflash(e.message, all_nodes_result, False) - return (RESULT_FAIL, []) - - for key in response['data']: - if 'Version' in response['data'][key]: - if response['data'][key]['Version'] in firm_list: - firm_id = key.split('/')[-1] - upload_msg = 'Firmware upload successful. ' \ - 'Attempting to activate firmware: ' \ - '%s (ID: %s)' % \ - (response['data'][key]['Version'], firm_id) - self._msg_process_rflash(upload_msg, {}, False) - firm_ids.append(firm_id) - firm_list.remove(response['data'][key]['Version']) - - if firm_list: - for firm_ver in firm_list: - retry_msg = 'Could not find ID for firmware %s to '\ - 'activate, waiting %d seconds and retry...' \ - % (firm_ver, 10) - self._msg_process_rflash(upload_msg, {}, True) - gevent.sleep( 10 ) - else: - break - - if firm_list: - for firm_ver in firm_list: - error = 'Could not find firmware %s after waiting %d seconds.' \ - % (firm_ver, 10*6) - self._msg_process_rflash(upload_msg, {}, False) - error_list.append(error) - utils.update2Ddict(all_nodes_result, self.node, 'result', error_list) - return (RESULT_FAIL, []) - - return (RESULT_OK, firm_ids) - - def _check_id_status(self, firm_id_list): - """check firm id status - :param firm_id_list: list of firm ids want to check - :return: result - """ - result = RESULT_OK - set_priority_ids = [] - process_status = {} - failed_msg = [] - for i in range(80): - try: - (has_functional, firm_info) = self._get_firm_info('rflash_check_status') - except (xcat_exception.SelfServerException, - xcat_exception.SelfClientException) as e: - self._msg_process_rflash(e.message, all_nodes_result, False) - return (RESULT_FAIL, set_priority_ids) - - activation_num = 0 - for key in firm_info: - firm_id = key.split('-')[-1] - if firm_id in firm_id_list: - activation_state = firm_info[key]['Activation'] - firm_version = firm_info[key]['Version'] - if activation_state == 'Failed': - activation_msg = 'Firmware %s activation failed.' % (firm_version) - self._msg_process_rflash(activation_msg, {}, False) - failed_msg.append(activation_msg) - result = RESULT_FAIL - firm_id_list.rempove(firm_id) - if activation_state == 'Active': - activation_msg = 'Firmware %s activation successful.' % (firm_version) - self._msg_process_rflash(activation_msg, {}, False) - firm_id_list.remove(firm_id) - priority = firm_info[key]['Priority'] - if priority != '0': - set_priority_ids.append(firm_id) - if activation_state == 'Activating': - activating_progress_msg = 'Activating %s ... %s%%' \ - % (firm_version, firm_info[key]['Progress']) - self._msg_process_rflash(activating_progress_msg, {}, True) - process_status[firm_id] = activating_progress_msg - - if not firm_id_list: - break - gevent.sleep( 15 ) - - if firm_id_list: - result = RESULT_FAIL - for firm_id in firm_id_list: - if firm_id in process_status: - failed_msg.append('After %d seconds check the current status is %s' \ - % (80*15, process_status[firm_id])) - - if failed_msg: - utils.update2Ddict(all_nodes_result, self.node, 'result', [failed_msg]) - - return (result, set_priority_ids) - - def _set_priority(self, priority_ids): - """set firmware priority to 0 - :param priority_ids: list of firmware ids - :return ok if success - :return error msg if failed - """ - for priority_id in priority_ids: - url = (HTTP_PROTOCOL + self.bmcip + - RFLASH_URLS['priority']['url'].replace('#PRIORITY_ID#', priority_id)) - data = { "data": RFLASH_URLS['priority']['field'] } - try: - response = self.client.request('PUT', url, OpenBMC.headers, - data, 'rflash_set_priority') - except (xcat_exception.SelfServerException, - xcat_exception.SelfClientException) as e: - return e.message - - return RESULT_OK - - def _rflash_activate_id(self, activate_id): - """rflash activate id - :param activate_id: the id want to activate - :raise: error message if failed - """ - url = (HTTP_PROTOCOL + self.bmcip + - RFLASH_URLS['activate']['url'].replace('#ACTIVATE_ID#', activate_id)) - data = { "data": RFLASH_URLS['activate']['field'] } - try: - response = self.client.request('PUT', url, OpenBMC.headers, - data, 'rflash_activate') - except xcat_exception.SelfServerException as e: - return e.message - except xcat_exception.SelfClientException as e: - code = e.code - if code == 403: - return 'Error: Invalid ID provided to activate. ' \ - 'Use the -l option to view valid firmware IDs.' - return e.message - - return RESULT_OK - - def _rflash_activate(self, activate_arg): - """ACTIVATE firmware - called by rflash activate - :param activate_arg: firmware tar ball or firmware id - :return: ok if success - :raise: error message if failed - """ - activate_id = activate_version = '' - if 'activate_id' in activate_arg: - activate_id = activate_arg['activate_id'] - if 'update_file' in activate_arg: - result = self._rflash_upload(activate_arg['update_file']) - if result != RESULT_OK: - self._msg_process_rflash(result, all_nodes_result, False) - return - - activate_version = activate_arg['activate_version'] - (result, info) = self._get_firm_id([activate_version]) - if result == RESULT_OK: - activate_id = info.pop(0) - else: - return - - result = self._rflash_activate_id(activate_id) - if result != RESULT_OK: - self._msg_process_rflash(result, all_nodes_result, False) - return - else: - flash_started_msg = 'rflash %s started, please wait...' % activate_version - self._msg_process_rflash(flash_started_msg, {}, False) - - firm_id_list = [activate_id] - (result, priority_ids) = self._check_id_status(firm_id_list) - if result == RESULT_OK: - utils.update2Ddict(all_nodes_result, self.node, 'result', 'OK') - if priority_ids: - self._set_priority(priority_ids) - - def _rflash_delete(self, delete_id): - """Delete firmware on OpenBMC - called by rflash delete - :param delete_id: firmware id want to delete - :returns: ok if success - :raise: error message if failed - """ - url = (HTTP_PROTOCOL + self.bmcip + - RFLASH_URLS['delete']['url'].replace('#DELETE_ID#', delete_id)) - data = { "data": RFLASH_URLS['delete']['field'] } - try: - response = self.client.request('POST', url, OpenBMC.headers, - data, 'rflash_delete') - except xcat_exception.SelfServerException as e: - return e.message - except xcat_exception.SelfClientException as e: - code = e.code - if code == 404: - return 'Error: Invalid ID provided to delete. ' \ - 'Use the -l option to view valid firmware IDs.' - return e.message - - return RESULT_OK - - - def _rflash_list(self): - """List firmware information - called by rflash list - :returns: firmware version if success - :raise: error message if failed - """ - firm_output = [] - try: - (has_functional, firm_info) = self._get_firm_info('rflash_list') - except (xcat_exception.SelfServerException, - xcat_exception.SelfClientException) as e: - firm_output.append(e.message) - return firm_output - - firm_output.append('%-8s %-7s %-10s %-s' % ('ID', 'Purpose', 'State', 'Version')) - firm_output.append('-' * 55) - - for key in firm_info: - status = firm_info[key]['Activation'] - if 'is_functional' in firm_info[key]: - status += '(*)' - elif 'Priority' in firm_info[key] and firm_info[key]['Priority'] == '0': - if not has_functional: - status += '(*)' - else: - status += '(+)' - - firm_output.append('%-8s %-7s %-10s %-s' % (key.split('-')[-1], - firm_info[key]['Purpose'], status, firm_info[key]['Version'])) - - return firm_output - - def _rflash_upload(self, upload_file): - """ Upload *.tar file to OpenBMC server - :param upload_file: file to upload - """ - url = HTTP_PROTOCOL + self.bmcip + RFLASH_URLS['upload']['url'] - headers = {'Content-Type': 'application/octet-stream'} - uploading_msg = 'Uploading %s ...' % upload_file - self._msg_process_rflash(uploading_msg, {}, True) - try: - self.client.request_upload('PUT', url, headers, - upload_file, 'rflash_upload') - except (xcat_exception.SelfServerException, - xcat_exception.SelfClientException) as e: - result = e.message - return result - - return RESULT_OK - - def rflash(self, args): - """handle rflash command - :param args: subcommands and parameters for rflash - """ - subcommand = args[0] - if subcommand == 'activate' or subcommand == 'upload': - self.rflash_log_file = XCAT_LOG_RFLASH_DIR + '/' + self.node + '.log' - self.rflash_log_handle = open(self.rflash_log_file, 'a') - - try: - result = self._login() - except (xcat_exception.SelfServerException, - xcat_exception.SelfClientException) as e: - result = e.message - - if result != RESULT_OK: - self.messager.info('%s: %s'% (self.node,result)) - if subcommand == 'activate' or subcommand == 'upload': - self.rflash_log_handle.writelines(result + '\n') - self.rflash_log_handle.flush() - if subcommand == 'activate': - utils.update2Ddict(all_nodes_result, self.node, 'result', [result]) - return - - if subcommand == 'activate': - activate_arg = args[1] - self._rflash_activate(activate_arg) - - if subcommand == 'check': - firm_info = self._firm_info('rflash_check') - for i in firm_info: - result = '%s: %s' % (self.node, i) - self.messager.info(result) - - if subcommand == 'delete': - firmware_id = args[1] - result = self._rflash_delete(firmware_id) - if result == RESULT_OK: - result = '%s: [%s] Firmware removed' % (self.node, firmware_id) - self.messager.info(result) - else: - result = '%s: %s' % (self.node, result) - self.messager.info(result) - - if subcommand == 'list': - firm_info = self._rflash_list() - for i in firm_info: - result = '%s: %s' % (self.node, i) - self.messager.info(result) - - if subcommand == 'upload': - upload_file = args[1] - result = self._rflash_upload(upload_file) - if result == RESULT_OK: - result = 'Firmware upload successful. Use -l option to list.' - self._msg_process_rflash(result, {}, False) - else: - self._msg_process_rflash(result, {}, False) - - if subcommand == 'activate' or subcommand == 'upload': - self.rflash_log_handle.close() - - class OpenBMCManager(base.BaseManager): def __init__(self, messager, cwd, nodes=None, envs=None): super(OpenBMCManager, self).__init__(messager, cwd) @@ -642,6 +159,51 @@ class OpenBMCManager(base.BaseManager): runner = OpenBMCBeaconTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) DefaultBeaconManager().set_beacon_state(runner, beacon_state=action) + def rflash(self, nodesinfo, args): + + # 1, parse agrs + rflash_usage = """ + Usage: + rflash [[-a|--activate ] | [-c|--check ] | [-d [--no-host-reboot]] | [--delete ] | [-l|--list] | [-u|--upload ]] [-V|--verbose] + + Options: + -V,--verbose Show verbose message + -a,--activate Activate firmware + -c,--check Check firmware info + -d Upload and activate all firmware files under directory + -l,--list List firmware info + -u,--upload Upload firmware file + --delete Delete firmware + --no-host-reboot Not reboot host after activate + """ + + try: + opts = docopt(rflash_usage, argv=args) + self.verbose = opts.pop('--verbose') + except Exception as e: + self.messager.error("Failed to parse arguments for rflash: %s" % args) + return + + if opts['--check']: + check_arg = None + if opts['']: + check_arg = opts[''] + runner = runner = OpenBMCInventoryTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose, cwd=self.cwd[0]) + DefaultInventoryManager().get_firm_info(runner, check_arg) + return + + runner = OpenBMCFlashTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose, cwd=self.cwd[0]) + if opts['--activate']: + DefaultFlashManager().activate_firm(runner, opts['--activate'][0]) + elif opts['--list']: + DefaultFlashManager().list_firm_info(runner) + elif opts['-d']: + DefaultFlashManager().flash_process(runner, opts['-d'], opts['--no-host-reboot']) + elif opts['--delete']: + DefaultFlashManager().delete_firm(runner, opts['--delete']) + elif opts['--upload']: + DefaultFlashManager().upload_firm(runner, opts['--upload'][0]) + def rinv(self, nodesinfo, args): # 1, parse agrs @@ -715,6 +277,7 @@ class OpenBMCManager(base.BaseManager): DefaultPowerManager().reboot(runner, optype=action) else: DefaultPowerManager().set_power_state(runner, power_state=action) + def rspconfig(self, nodesinfo, args): try: opts=docopt(RSPCONFIG_USAGE, argv=args) @@ -768,6 +331,7 @@ class OpenBMCManager(base.BaseManager): DefaultBmcConfigManager().set_attributes(runner, opts['']) else: self.messager.error("Failed to deal with rspconfig: %s" % args) + def rsetboot(self, nodesinfo, args): # 1, parse args @@ -884,98 +448,3 @@ class OpenBMCManager(base.BaseManager): else: DefaultEventlogManager().get_eventlog_info(runner, "all") - def _get_full_path(self,file_path): - if type(self.cwd) == 'unicode': - dir_path = self.cwd - else: - dir_path = self.cwd[0] - return '%s/%s' % (dir_path,file_path) - - def _check_verbose(self, args): - verbose_list = ('-V', '--verbose') - for i in verbose_list: - if i in args: - global VERBOSE - VERBOSE = True - args.remove(i) - - def _summary(self, nodes_num, title): - if all_nodes_result: - success_num = failed_num = 0 - failed_list = [] - for key in all_nodes_result: - if all_nodes_result[key]['result'] == 'OK': - success_num += 1 - else: - failed_num += 1 - for errors in all_nodes_result[key]['result']: - for error in errors: - failed_list.append('%s: %s' % (key, error)) - self.messager.info('-' * 55) - self.messager.info('%s complete: Total=%d Success=%d Failed=%d' % \ - (title, nodes_num, success_num, failed_num)) - if failed_list: - for i in failed_list: - self.messager.info(i) - self.messager.info('-' * 55) - - def rflash(self, nodeinfo, args): - if not os.path.exists(XCAT_LOG_RFLASH_DIR): - os.makedirs(XCAT_LOG_RFLASH_DIR) - nodes_num = len(self.nodes) - self._check_verbose(args) - - for key,value in RFLASH_OPTIONS.items(): - if key in args: - args.remove(key) - args.insert(0, value) - break - - upload_file = None - activate_arg = {} - args_num = len(args) - subcommand = args[0] - if (subcommand == 'upload' or subcommand == 'activate' or - (subcommand == 'check' and args_num > 1)): - arg_type = args[1].split('.')[-1] - if arg_type == 'tar': - upload_file = args[1] - if not os.path.isabs(upload_file): - upload_file = self._get_full_path(upload_file) - - if (not os.access(upload_file, os.F_OK) or - not os.access(upload_file, os.R_OK)): - error = 'Error: Cannot access %s. Check the management ' \ - 'node and/or service nodes.' % upload_file - self.messager.error(error) - return - activate_arg['update_file'] = upload_file - else: - activate_arg['activate_id'] = args[1] - - if (subcommand == 'check' or subcommand == 'activate') and upload_file: - grep_cmd = '/usr/bin/grep -a' - version_cmd = grep_cmd + ' ^version= ' + upload_file - purpose_cmd = grep_cmd + ' purpose= ' + upload_file - firmware_ver = os.popen(version_cmd).readlines()[0].split('=')[-1].strip() - purpose_ver = os.popen(purpose_cmd).readlines()[0].split('=')[-1].strip() - if subcommand == 'check': - self.messager.info('TAR %s Firmware Product Version: %s' \ - % (purpose_ver,firmware_ver)) - else: - activate_arg['activate_version'] = firmware_ver - activate_arg['purpose'] = purpose_ver.split('.')[-1] - - if subcommand == 'activate': - args[1] = activate_arg - - if subcommand == 'upload': - args[1] = upload_file - - if subcommand == 'upload' or subcommand == 'activate' and upload_file: - self.messager.info('Attempting to upload %s, please wait...' % upload_file) - - super(OpenBMCManager, self).process_nodes_worker('openbmc', 'OpenBMC', - self.nodes, nodeinfo, 'rflash', args) - self._summary(nodes_num, 'Firmware update') - diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc_rest.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc_rest.py deleted file mode 100644 index 9dcf8c99e..000000000 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc_rest.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python -import requests -import json -import time - -from common import rest -from common import exceptions as xcat_exception - -class OpenBMCRest: - - def __init__(self, name, messager, debugmode): - self.session = rest.RestSession() - self.name = name - self.messager = messager - self.debugmode = debugmode - - def _print_record_log (self, log_string, status): - if self.debugmode : - localtime = time.asctime( time.localtime(time.time()) ) - log = self.name + ': [openbmc_debug] ' + status + ' ' + log_string - self.messager.info(localtime + ' ' + log) - self.messager.syslog(log) - - def _request_log (self, method, url, headers, data, files): - log_string = 'curl -k -c cjar -b cjar' - log_string += ' -X %s' % method - for key,value in headers.items(): - header_data = key + ": " + value - log_string += ' -H "' + header_data + '"' - log_string += ' %s' % url - - if data: - log_string += ' -d \'%s\'' % data - if files: - log_string += ' -T \'%s\'' % files - - return log_string - - - def _response_check (self, response, response_dict, status): - if response.status_code != requests.codes.ok: - description = ''.join(response_dict['data']['description']) - error = 'Error: [%d] %s' % (response.status_code, description) - self._print_record_log(error, status) - code = response.status_code - raise xcat_exception.SelfClientException(error, code) - else: - self._print_record_log(response_dict['message'], status) - - def request (self, method, url, headers, in_data, status): - data = log_data = '' - - if in_data: - data = json.dumps(in_data) - log_data = data - if status == 'login': - in_data['data'][1] = 'xxxxxx' - log_data = json.dumps(in_data) - - log_string = self._request_log(method, url, headers, log_data, '') - self._print_record_log(log_string, status) - - try: - response = self.session.request(method, url, headers, data) - except xcat_exception.SelfServerException as e: - self._print_record_log(e.message, status) - raise xcat_exception.SelfServerException(e.message) - - try: - response_dict = response.json() - except ValueError: - error = 'Error: Received wrong format response: %s' % response - self._print_record_log(error, status) - raise xcat_exception.SelfServerException(error) - - self._response_check(response, response_dict, status) - - return response_dict - - - def request_upload (self, method, url, headers, files, status): - for key,value in headers.items(): - header_data = key + ': ' + value - request_cmd_log = 'curl -k -c cjar -b cjar -H "%s" -X %s -T %s %s -s' \ - % (header_data, method, files, url) - log_string = self._request_log(method, url, headers, '', files) - self._print_record_log(log_string, status) - - response = self.session.request_upload(method, url, header_data, files) - - if not response: - error = 'Error: Did not receive response from OpenBMC after ' \ - 'running command form \'%s\'' % request_cmd_log - raise xcat_exception.SelfServerException(error) - - try: - response_dict = json.loads(response) - except ValueError: - error = 'Error: Received wrong format response: %s: %s' % \ - (request_cmd_log, response) - self._print_record_log(error, status) - raise xcat_exception.SelfServerException(error) - - if response_dict['message'] != '200 OK': - error = 'Error: Failed to upload update file %s : %s-%s' % \ - (files, response_dict['message'], \ - ''.join(response_dict['data']['description'])) - self._print_record_log(error, status) - raise xcat_exception.SelfClientException(error, code) - - self._print_record_log(response_dict['message'], status) - - return diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index ea84911e0..50cd4d039 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -231,7 +231,6 @@ sub parse_args { } } if ($directory) { - return ([ 1, "Unsupported command: $command '-d'" ]); return ([ 1, "More than one directory specified is not supported."]) if ($#ARGV >= 1); return ([ 1, "Invalid option specified with '-d'."]) if (!@ARGV); } From e87d3510f5f1318c77718b0270ad82469976a447 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 21 Mar 2018 14:10:51 +0800 Subject: [PATCH 047/161] Script for doing extra setup steps for NVIDIA POWER9 CUDA driver on RHEL 7 --- xCAT/postscripts/cuda_power9_setup | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 xCAT/postscripts/cuda_power9_setup diff --git a/xCAT/postscripts/cuda_power9_setup b/xCAT/postscripts/cuda_power9_setup new file mode 100755 index 000000000..d2120f465 --- /dev/null +++ b/xCAT/postscripts/cuda_power9_setup @@ -0,0 +1,42 @@ +#!/bin/bash +# +# Copyright (C) 2018 International Business Machines +# Eclipse Public License, Version 1.0 (EPL-1.0) +# +# +# 2018-03-21 GONG Jie +# +# This script is used for doing extra setup steps for NVIDIA POWER9 CUDA driver +# on RHEL 7. Please refer document below for details. +# +# http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#power9-setup +# + +umask 0022 + +grep '^#' /usr/lib/systemd/system/nvidia-persistenced.service >/tmp/nvidia-persistenced.service +cat >>/tmp/nvidia-persistenced.service <<-EOF + +[Unit] +Description=NVIDIA Persistence Daemon +Wants=syslog.target + +[Service] +Type=forking +PIDFile=/var/run/nvidia-persistenced/nvidia-persistenced.pid +Restart=always +ExecStart=/usr/bin/nvidia-persistenced --user root --verbose +ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced + +[Install] +WantedBy=multi-user.target +EOF + +mv /tmp/nvidia-persistenced.service /usr/lib/systemd/system/nvidia-persistenced.service + +chown root.root /usr/lib/systemd/system/nvidia-persistenced.service +chmod 0644 /usr/lib/systemd/system/nvidia-persistenced.service + +systemctl enable nvidia-persistenced + +rm -f /lib/udev/rules.d/40-redhat.rules From a7f28efb72912b6970055b7b2bd57dd97331c767 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 21 Mar 2018 14:49:36 +0800 Subject: [PATCH 048/161] Updates for CUDA 9.2 and RHEL 7.5 Alternate --- .../cuda/rhel-cuda-diskfull-install.sh | 7 +++++-- .../cuda/rhel-cuda-diskless-install.sh | 21 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh index b5da8d579..9d174d8dd 100755 --- a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh +++ b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh @@ -3,11 +3,11 @@ ######## # Set all the variables below -LINUX_DISTRO="rhels7.4" +LINUX_DISTRO="rhels7.5-alternate" LINUX_ARCH="ppc64le" COMPUTE_NODE="c910f03c01p10" -SOURCE_DIR="/media/xcat" +SOURCE_DIR="/install/tmp" ######## @@ -57,6 +57,9 @@ do "dkms-"*".el7.noarch.rpm") DKMS_RPM="${r}" ;; + "nvidia-driver-local-repo-rhel"*"-"*".${LINUX_ARCH}.rpm") + CUDA_RPMS+=("${r}") + ;; esac done diff --git a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh index 731f324fc..bc97d8757 100755 --- a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh +++ b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh @@ -3,11 +3,11 @@ ######## # Set all the variables below -LINUX_DISTRO="rhels7.4" +LINUX_DISTRO="rhels7.5-alternate" LINUX_ARCH="ppc64le" COMPUTE_NODE="c910f03c01p10" -SOURCE_DIR="/media/xcat" +SOURCE_DIR="/install/tmp" ######## @@ -57,6 +57,9 @@ do "dkms-"*".el7.noarch.rpm") DKMS_RPM="${r}" ;; + "nvidia-driver-local-repo-rhel"*"-"*".${LINUX_ARCH}.rpm") + CUDA_RPMS+=("${r}") + ;; esac done @@ -123,13 +126,25 @@ ${OSIMAGE_NAME}: permission=755 pkgdir=/install/${LINUX_DISTRO}/${LINUX_ARCH} pkglist=/opt/xcat/share/xcat/netboot/rh/compute.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.pkglist - postinstall=/opt/xcat/share/xcat/netboot/rh/compute.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall + postinstall=/install/custom/netboot/rh/cudafull.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall profile=compute provmethod=netboot rootimgdir=${OSIMAGE_ROOTIMGDIR} EOF [ "$?" -ne "0" ] && echo "Make osimage definition failed." >&2 && exit 1 +( + cat "/opt/xcat/share/xcat/netboot/rh/compute.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" + cat <<-EOF + + cp /install/postscripts/cuda_power9_setup "${OSIMAGE_ROOTIMGDIR}/rootimg/tmp/cuda_power9_setup" + chroot "${OSIMAGE_ROOTIMGDIR}/rootimg" /tmp/cuda_power9_setup + + rm -f "${OSIMAGE_ROOTIMGDIR}/rootimg/tmp/cuda_power9_setup" + EOF +) >"/install/custom/netboot/rh/cudafull.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" +chmod 0755 "/install/custom/netboot/rh/cudafull.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" + rm -rf "${OSIMAGE_OTHERPKGDIR}" mkdir -p "${OSIMAGE_OTHERPKGDIR}" for f in "${CUDA_RPMS[@]}" From cfe6c0db7f0d53ba3d1aa8ebb54752ca307c4dce Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 21 Mar 2018 03:49:18 -0400 Subject: [PATCH 049/161] modify rspconfig usage --- perl-xCAT/xCAT/Usage.pm | 10 ++++++++++ xCAT-server/lib/xcat/plugins/openbmc.pm | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 25ef54d5d..aeb8cdfe2 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -185,6 +185,16 @@ my %usage = ( rspconfig [hostname|ntpservers] rspconfig [hostname=<*|hostname>|ntpservers=] rspconfig sshcfg + rspconfig powerrestorepolicy + rspconfig powerrestorepolicy={always_on|restore|always_off} + rspconfig powersupplyredundancy + rspconfig powersupplyredundancy={disabled|enabled} + rspconfig timesyncmethod + rspconfig timesyncmethod={ntp|manual} + rspconfig bootmode + rspconfig bootmode={safe|regular|setup} + rspconfig autoreboot + rspconfig autoreboot={0|1} ", "rspconfig.begin" => "BMC/MPA Common: diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 09f4de63b..6ddc6f2f0 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -789,11 +789,11 @@ sub preprocess_request { # Could not find usage for openbmc section, try getting usage for all sections $usage_string = xCAT::Usage->parseCommand($command, @exargs); } - else { + #else { # Usage for openbmc section was extracted, append autogenerated usage for # configured commands - $usage_string .= &build_config_api_usage($callback, $command); - } + # $usage_string .= &build_config_api_usage($callback, $command); + #} $callback->({ data => [$usage_string] }); $request = {}; From e80509c0ae4a2eb697987f4a06c2611930d2a69f Mon Sep 17 00:00:00 2001 From: chenglch Date: Wed, 21 Mar 2018 16:24:00 +0800 Subject: [PATCH 050/161] use msgsource directly --- perl-xCAT/xCAT/Client.pm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index ba52dcfbc..455c3524e 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -1129,12 +1129,15 @@ sub handle_response { return; } - my $msgsource; + my $msgsource = ""; if ($ENV{'XCATSHOWSVR'}) { unless ($rsp->{NoSvrPrefix}) { # some plugins could disable the prefix forcely by seting the flag in response. $msgsource = $rsp->{xcatdsource}->[0] if ($rsp->{xcatdsource}); } } + if ($rsp->{host}) { + $msgsource = $rsp->{xcatdsource}->[0] if ($rsp->{xcatdsource}); + } #print "in handle_response\n"; # Handle errors @@ -1148,10 +1151,6 @@ sub handle_response { $xCAT::Client::EXITCODE |= $rsp->{errorcode}; } # assume it is a non-reference scalar } - my $host = ""; - if ($rsp->{host}) { - $host = "[".$rsp->{host}->[0]."]" if !$msgsource; - } if ($rsp->{error}) { @@ -1160,14 +1159,14 @@ sub handle_response { foreach my $text (@{ $rsp->{error} }) { my $desc = "$text"; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Error$host: $desc" unless ($rsp->{NoErrorPrefix}); + $desc = "Error: $desc" unless ($rsp->{NoErrorPrefix}); print STDERR "$desc\n"; } } else { my $desc = $rsp->{error}; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Error$host: $desc" unless ($rsp->{NoErrorPrefix}); + $desc = "Error: $desc" unless ($rsp->{NoErrorPrefix}); print STDERR "$desc\n"; } } @@ -1178,14 +1177,14 @@ sub handle_response { foreach my $text (@{ $rsp->{warning} }) { my $desc = "$text"; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Warning$host: $desc" unless ($rsp->{NoWarnPrefix}); + $desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix}); print STDERR "$desc\n"; } } else { my $desc = $rsp->{warning}; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); - $desc = "Warning$host: $desc" unless ($rsp->{NoWarnPrefix}); + $desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix}); print STDERR "$desc\n"; } } @@ -1193,7 +1192,7 @@ sub handle_response { #print "printing info\n"; if (ref($rsp->{info}) eq 'ARRAY') { foreach my $text (@{ $rsp->{info} }) { - my $desc = "$host$text"; + my $desc = "$text"; $desc = "[$msgsource]: $desc" if ($msgsource && $desc); print "$desc\n"; } From 6698609aaa1658455995d8baabbb58c68afb52d5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Mar 2018 14:55:48 -0400 Subject: [PATCH 051/161] Catch BMC status error from get status request --- .../lib/python/agent/hwctl/executor/openbmc_power.py | 5 +++++ xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index 807c23f16..0772afe4a 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -82,6 +82,11 @@ class OpenBMCPowerTask(ParallelNodesCommand): if bmc_state != 'Ready': bmc_state = bmc_not_ready + bmc_state_error = state.get('error') + if bmc_state_error is not None: + # BMC is not ready and we have some error as to why + self.callback.info('%s: %s (%s)' % (node, openbmc.RPOWER_STATES.get(bmc_state, bmc_state), bmc_state_error)) + return bmc_state self.callback.info('%s: %s' % (node, openbmc.RPOWER_STATES.get(bmc_state, bmc_state))) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index b1654a884..73aacef58 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -320,6 +320,8 @@ class OpenBMCRest(object): 'Validate BMC configuration and retry the command.' self._print_error_log(e.message, cmd) raise + except SelfClientException as e: + raise SelfClientException(e.message, e.code) except ValueError: error = 'Received wrong format response: %s' % response self._print_error_log(error, cmd) @@ -410,9 +412,12 @@ class OpenBMCRest(object): def get_bmc_state(self): - state = self.request('GET', BMC_URLS['state']['path'], cmd='get_bmc_state') try: + state = self.request('GET', BMC_URLS['state']['path'], cmd='get_bmc_state') return {'bmc': state.split('.')[-1]} + except SelfClientException as e: + # Return error message received from the request + return {'bmc': "NotReady", 'error': e.message} except KeyError: error = 'Received wrong format response: %s' % state raise SelfServerException(error) From 1c69da5b4e90f0dd390fbfd08a0b06cc030c5ea9 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 21 Mar 2018 16:59:24 -0400 Subject: [PATCH 052/161] Another improvement after review --- xCAT-server/lib/xcat/plugins/openbmc.pm | 50 +++++++++++-------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 1a85ba9e8..5c54eacc7 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -4253,9 +4253,12 @@ sub rflash_response { my $to_delete_id = (split ('/', $status_info{RFLASH_DELETE_IMAGE_REQUEST}{init_url}))[4]; # Get the functional IDs to determint if active running FW can be deleted my $functional = get_functional_software_ids($response_info); - if (!%{$functional}) { + if ((!%{$functional}) || + (!exists($functional->{$to_delete_id}))) { # Can not figure out if FW functional, attempt to delete anyway. # Worst case, BMC will not allow FW deletion if we are wrong + # OR + # FW is not active, it can be deleted. Send the request to do the deletion $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; } else { @@ -4287,34 +4290,25 @@ sub rflash_response { $update_priority = (split(/\./, $content{Priority}))[ -1 ]; } - # Check if this is active firmware - if (exists($functional->{$update_id}) ) { - if ($update_purpose eq "BMC") { - # Active BMC firmware can not be deleted - xCAT::SvrUtils::sendmsg([1, "Deleting currently active BMC firmware is not supported"], $callback, $node); - $wait_node_num--; - return; - } elsif ($update_purpose eq "Host") { - # Active Host firmware can NOT be deleted if host is ON - # Active Host firmware can be deleted if host is OFF + if ($update_purpose eq "BMC") { + # Active BMC firmware can not be deleted + xCAT::SvrUtils::sendmsg([1, "Deleting currently active BMC firmware is not supported"], $callback, $node); + $wait_node_num--; + return; + } elsif ($update_purpose eq "Host") { + # Active Host firmware can NOT be deleted if host is ON + # Active Host firmware can be deleted if host is OFF - # Send the request to check Host state - $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RPOWER_STATUS_REQUEST"; - $next_status{"RPOWER_STATUS_REQUEST"} = "RPOWER_STATUS_RESPONSE"; - # Set special argv to fw_delete if Host is off - $status_info{RPOWER_STATUS_RESPONSE}{argv} = "fw_delete"; - last; - } else { - xCAT::SvrUtils::sendmsg([1, "Unable to determine the purpose of the firmware to delete"], $callback, $node); - # Can not figure out if Host or BMC, attempt to delete anyway. - # Worst case, BMC will not allow FW deletion if we are wrong - $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; - $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; - last; - } - } - else { - # FW is not active, it can be deleted. Send the request to do the deletion + # Send the request to check Host state + $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RPOWER_STATUS_REQUEST"; + $next_status{"RPOWER_STATUS_REQUEST"} = "RPOWER_STATUS_RESPONSE"; + # Set special argv to fw_delete if Host is off + $status_info{RPOWER_STATUS_RESPONSE}{argv} = "fw_delete"; + last; + } else { + xCAT::SvrUtils::sendmsg([1, "Unable to determine the purpose of the firmware to delete"], $callback, $node); + # Can not figure out if Host or BMC, attempt to delete anyway. + # Worst case, BMC will not allow FW deletion if we are wrong $next_status{"RFLASH_DELETE_CHECK_STATE_RESPONSE"} = "RFLASH_DELETE_IMAGE_REQUEST"; $next_status{"RFLASH_DELETE_IMAGE_REQUEST"} = "RFLASH_DELETE_IMAGE_RESPONSE"; last; From dcb3ea4270ef8e0cbc6126131aff142de0e0560e Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 22 Mar 2018 13:54:37 +0800 Subject: [PATCH 053/161] Update the CUDA installation document to CUDA 9.2 and RHEL 7.5 --- .../advanced/gpu/nvidia/deploy_cuda_node.rst | 8 +- docs/source/advanced/gpu/nvidia/index.rst | 2 +- .../advanced/gpu/nvidia/osimage/rhels.rst | 110 ++++++++++++------ .../source/advanced/gpu/nvidia/repo/rhels.rst | 25 ++-- .../gpu/nvidia/update_nvidia_driver.rst | 6 +- 5 files changed, 91 insertions(+), 60 deletions(-) diff --git a/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst b/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst index f20a6505c..b705e85d5 100644 --- a/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst +++ b/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst @@ -4,9 +4,9 @@ Deploy CUDA nodes Diskful ------- -* To provision diskful nodes using osimage ``rhels7.2-ppc64le-install-cudafull``: :: +* To provision diskful nodes using osimage ``rhels7.5-ppc64le-install-cudafull``: :: - nodeset osimage=rhels7.2-ppc64le-install-cudafull + nodeset osimage=rhels7.5-ppc64le-install-cudafull rsetboot net rpower boot @@ -14,9 +14,9 @@ Diskful Diskless -------- -* To provision diskless nodes using osimage ``rhels7.2-ppc64le-netboot-cudafull``: :: +* To provision diskless nodes using osimage ``rhels7.5-ppc64le-netboot-cudafull``: :: - nodeset osimage=rhels7.2-ppc64le-netboot-cudafull + nodeset osimage=rhels7.5-ppc64le-netboot-cudafull rsetboot net rpower boot diff --git a/docs/source/advanced/gpu/nvidia/index.rst b/docs/source/advanced/gpu/nvidia/index.rst index ea9459018..cf673106c 100644 --- a/docs/source/advanced/gpu/nvidia/index.rst +++ b/docs/source/advanced/gpu/nvidia/index.rst @@ -5,7 +5,7 @@ CUDA (Compute Unified Device Architecture) is a parallel computing platform and For more information, see NVIDIAs website: https://developer.nvidia.com/cuda-zone -xCAT supports CUDA installation for Ubuntu 14.04.3 and RHEL 7.2LE on PowerNV (Non-Virtualized) for both diskful and diskless nodes. +xCAT supports CUDA installation for Ubuntu 14.04.3 and RHEL 7.5 on PowerNV (Non-Virtualized) for both diskful and diskless nodes. Within the NVIDIA CUDA Toolkit, installing the ``cuda`` package will install both the ``cuda-runtime`` and the ``cuda-toolkit``. The ``cuda-toolkit`` is intended for developing CUDA programs and monitoring CUDA jobs. If your particular installation requires only running GPU jobs, it's recommended to install only the ``cuda-runtime`` package. diff --git a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst index a39030f7a..163581ba6 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst @@ -1,5 +1,5 @@ -RHEL 7.2 LE -=========== +RHEL 7.5 +======== xCAT provides a sample package list (pkglist) files for CUDA. You can find them: @@ -7,9 +7,9 @@ xCAT provides a sample package list (pkglist) files for CUDA. You can find them: * Diskless: ``/opt/xcat/share/xcat/netboot/rh/cuda*`` Diskful images ---------------- +-------------- -The following examples will create diskful images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.2-ppc64le-install-compute`` osimage. +The following examples will create diskful images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.5-ppc64le-install-compute`` osimage. **[Note]**: There is a requirement to reboot the machine after the CUDA drivers are installed. To satisfy this requirement, the CUDA software is installed in the ``pkglist`` attribute of the osimage definition where a reboot will happen after the Operating System is installed. @@ -18,18 +18,18 @@ cudafull #. Create a copy of the ``install-compute`` image and label it ``cudafull``: :: - lsdef -t osimage -z rhels7.2-ppc64le-install-compute \ + lsdef -t osimage -z rhels7.5-ppc64le-install-compute \ | sed 's/install-compute:/install-cudafull:/' \ | mkdef -z #. Add the CUDA repo created in the previous step to the ``pkgdir`` attribute: :: - chdef -t osimage -o rhels7.2-ppc64le-install-cudafull -p \ - pkgdir=/install/cuda-7.5/ppc64le/cuda-core,/install/cuda-7.5/ppc64le/cuda-deps + chdef -t osimage -o rhels7.5-ppc64le-install-cudafull -p \ + pkgdir=/install/cuda-9.2/ppc64le/cuda-core,/install/cuda-9.2/ppc64le/cuda-deps #. Use the provided ``cudafull`` pkglist to install the CUDA packages: :: - chdef -t osimage -o rhels7.2-ppc64le-install-cudafull \ + chdef -t osimage -o rhels7.5-ppc64le-install-cudafull \ pkglist=/opt/xcat/share/xcat/install/rh/cudafull.rhels7.ppc64le.pkglist cudaruntime @@ -37,24 +37,24 @@ cudaruntime #. Create a copy of the ``install-compute`` image and label it ``cudaruntime``: :: - lsdef -t osimage -z rhels7.2-ppc64le-install-compute \ + lsdef -t osimage -z rhels7.5-ppc64le-install-compute \ | sed 's/install-compute:/install-cudaruntime:/' \ | mkdef -z #. Add the CUDA repo created in the previous step to the ``pkgdir`` attribute: :: - chdef -t osimage -o rhels7.2-ppc64le-install-cudaruntime -p \ - pkgdir=/install/cuda-7.5/ppc64le/cuda-core,/install/cuda-7.5/ppc64le/cuda-deps + chdef -t osimage -o rhels7.5-ppc64le-install-cudaruntime -p \ + pkgdir=/install/cuda-9.2/ppc64le/cuda-core,/install/cuda-9.2/ppc64le/cuda-deps #. Use the provided ``cudaruntime`` pkglist to install the CUDA packages: :: - chdef -t osimage -o rhels7.2-ppc64le-install-cudaruntime \ + chdef -t osimage -o rhels7.5-ppc64le-install-cudaruntime \ pkglist=/opt/xcat/share/xcat/instal/rh/cudaruntime.rhels7.ppc64le.pkglist Diskless images --------------- -The following examples will create diskless images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.2-ppc64le-netboot-compute`` osimage. +The following examples will create diskless images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.5-ppc64le-netboot-compute`` osimage. **[Note]**: For diskless, the install of the CUDA packages MUST be done in the ``otherpkglist`` and **NOT** the ``pkglist`` as with diskful. The requirement for rebooting the machine is not applicable in diskless nodes because the image is loaded on each reboot. @@ -63,7 +63,7 @@ cudafull #. Create a copy of the ``netboot-compute`` image and label it ``cudafull``: :: - lsdef -t osimage -z rhels7.2-ppc64le-netboot-compute \ + lsdef -t osimage -z rhels7.5-ppc64le-netboot-compute \ | sed 's/netboot-compute:/netboot-cudafull:/' \ | mkdef -z @@ -71,18 +71,18 @@ cudafull The ``otherpkgdir`` directory can be obtained by running lsdef on the osimage: :: - # lsdef -t osimage rhels7.2-ppc64le-netboot-cudafull -i otherpkgdir - Object name: rhels7.2-ppc64le-netboot-cudafull - otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + # lsdef -t osimage rhels7.5-ppc64le-netboot-cudafull -i otherpkgdir + Object name: rhels7.5-ppc64le-netboot-cudafull + otherpkgdir=/install/post/otherpkgs/rhels7.5/ppc64le Create a symbolic link of the CUDA repository in the directory specified by ``otherpkgdir`` :: - ln -s /install/cuda-7.5 /install/post/otherpkgs/rhels7.2/ppc64le/cuda-7.5 + ln -s /install/cuda-9.2 /install/post/otherpkgs/rhels7.5/ppc64le/cuda-9.2 #. Change the ``rootimgdir`` for the cudafull osimage: :: - chdef -t osimage -o rhels7.2-ppc64le-netboot-cudafull \ - rootimgdir=/install/netboot/rhels7.2/ppc64le/cudafull + chdef -t osimage -o rhels7.5-ppc64le-netboot-cudafull \ + rootimgdir=/install/netboot/rhels7.5/ppc64le/cudafull #. Create a custom pkglist file to install additional operating system packages for your CUDA node. @@ -102,7 +102,7 @@ cudafull #. Set the new file as the ``pkglist`` attribute for the cudafull osimage: :: - chdef -t osimage -o rhels7.2-ppc64le-netboot-cudafull \ + chdef -t osimage -o rhels7.5-ppc64le-netboot-cudafull \ pkglist=/install/custom/netboot/rh/cudafull.rhels7.ppc64le.pkglist @@ -112,28 +112,28 @@ cudafull vi /install/custom/netboot/rh/cudafull.rhels7.ppc64le.otherpkgs.pkglist # add the following packages - cuda-7.5/ppc64le/cuda-deps/dkms - cuda-7.5/ppc64le/cuda-core/cuda + cuda-9.2/ppc64le/cuda-deps/dkms + cuda-9.2/ppc64le/cuda-core/cuda #. Set the ``otherpkg.pkglist`` attribute for the cudafull osimage: :: - chdef -t osimage -o rhels7.2-ppc64le-netboot-cudafull \ + chdef -t osimage -o rhels7.5-ppc64le-netboot-cudafull \ otherpkglist=/install/custom/netboot/rh/cudafull.rhels7.ppc64le.otherpkgs.pkglist #. Generate the image: :: - genimage rhels7.2-ppc64le-netboot-cudafull + genimage rhels7.5-ppc64le-netboot-cudafull #. Package the image: :: - packimage rhels7.2-ppc64le-netboot-cudafull + packimage rhels7.5-ppc64le-netboot-cudafull cudaruntime ^^^^^^^^^^^ #. Create a copy of the ``netboot-compute`` image and label it ``cudaruntime``: :: - lsdef -t osimage -z rhels7.2-ppc64le-netboot-compute \ + lsdef -t osimage -z rhels7.5-ppc64le-netboot-compute \ | sed 's/netboot-compute:/netboot-cudaruntime:/' \ | mkdef -z @@ -141,18 +141,18 @@ cudaruntime #. Obtain the ``otherpkgdir`` directory using the ``lsdef`` command: :: - # lsdef -t osimage rhels7.2-ppc64le-netboot-cudaruntime -i otherpkgdir - Object name: rhels7.2-ppc64le-netboot-cudaruntime - otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + # lsdef -t osimage rhels7.5-ppc64le-netboot-cudaruntime -i otherpkgdir + Object name: rhels7.5-ppc64le-netboot-cudaruntime + otherpkgdir=/install/post/otherpkgs/rhels7.5/ppc64le #. Create a symbolic link to the CUDA repository in the directory specified by ``otherpkgdir`` :: - ln -s /install/cuda-7.5 /install/post/otherpkgs/rhels7.2/ppc64le/cuda-7.5 + ln -s /install/cuda-9.2 /install/post/otherpkgs/rhels7.5/ppc64le/cuda-9.2 #. Change the ``rootimgdir`` for the cudaruntime osimage: :: - chdef -t osimage -o rhels7.2-ppc64le-netboot-cudaruntime \ - rootimgdir=/install/netboot/rhels7.2/ppc64le/cudaruntime + chdef -t osimage -o rhels7.5-ppc64le-netboot-cudaruntime \ + rootimgdir=/install/netboot/rhels7.5/ppc64le/cudaruntime #. Create the ``otherpkg.pkglist`` file to do the install of the CUDA runtime packages: @@ -161,19 +161,53 @@ cudaruntime vi /install/custom/netboot/rh/cudaruntime.rhels7.ppc64le.otherpkgs.pkglist # Add the following packages: - cuda-7.5/ppc64le/cuda-deps/dkms - cuda-7.5/ppc64le/cuda-core/cuda-runtime-7-5 + cuda-9.2/ppc64le/cuda-deps/dkms + cuda-9.2/ppc64le/cuda-core/cuda-runtime-9-2 #. Set the ``otherpkg.pkglist`` attribute for the cudaruntime osimage: :: - chdef -t osimage -o rhels7.2-ppc64le-netboot-cudaruntime \ + chdef -t osimage -o rhels7.5-ppc64le-netboot-cudaruntime \ otherpkglist=/install/custom/netboot/rh/cudaruntime.rhels7.ppc64le.otherpkgs.pkglist #. Generate the image: :: - genimage rhels7.2-ppc64le-netboot-cudaruntime + genimage rhels7.5-ppc64le-netboot-cudaruntime #. Package the image: :: - packimage rhels7.2-ppc64le-netboot-cudaruntime + packimage rhels7.5-ppc64le-netboot-cudaruntime + +POWER9 Setup +------------ + +NVIDIA POWER9 CUDA driver need some additional setup. Refer the URL below for details. + +http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#power9-setup + +xCAT includes a script, `cuda_power9_setup` as example, to help user handle this situation. + +Diskful osimage +^^^^^^^^^^^^^^^ + +For diskful deployment, there is no need to change the osimage definition. Instead, add this postscript to your compute node postbootscrtips list. + + chdef p9compute -p postbootscripts=cuda_power9_setup + +Disless osimage +^^^^^^^^^^^^^^^ + +For diskless deployment, the script need to add to the postinstall script of the osimage. And it should be run in the chroot environment. Please refer the following commands as an example. + + mkdir -p /install/custom/netboot + cp /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + + cat >>/install/custom/netboot/rh/cudafull.rhels7.ppc64le.postinstall <-EOF + + cp /install/postscripts/cuda_power9_setup /install/netboot/rhels7.5/ppc64le/compute/rootimg/tmp/cuda_power9_setup" + chroot /install/netboot/rhels7.5/ppc64le/compute/rootimg" /tmp/cuda_power9_setup + + rm -f /install/netboot/rhels7.5/ppc64le/compute/rootimg/tmp/cuda_power9_setup + EOF + + chdef -t osimage rhels7.5-ppc64le-netboot-cudafull postinstall=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall diff --git a/docs/source/advanced/gpu/nvidia/repo/rhels.rst b/docs/source/advanced/gpu/nvidia/repo/rhels.rst index 7cedc2701..056ac682a 100644 --- a/docs/source/advanced/gpu/nvidia/repo/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/repo/rhels.rst @@ -1,31 +1,28 @@ -RHEL 7.2 LE -=========== +RHEL 7.5 +======== #. Create a repository on the MN node installing the CUDA Toolkit: :: - # For cuda toolkit name: /root/cuda-repo-rhel7-7-5-local-7.5-18.ppc64le.rpm + # For cuda toolkit name: /path/to/cuda-repo-rhel7-9-2-local-9.2.64-1.ppc64le.rpm # extract the contents from the rpm mkdir -p /tmp/cuda cd /tmp/cuda - rpm2cpio /root/cuda-repo-rhel7-7-5-local-7.5-18.ppc64le.rpm | cpio -i -d + rpm2cpio /path/to/cuda-repo-rhel7-9-2-local-9.2.64-1.ppc64le.rpm | cpio -i -d - # Create the repo directory under xCAT /install dir for cuda 7.5 - mkdir -p /install/cuda-7.5/ppc64le/cuda-core - cp -r /tmp/cuda/var/cuda-repo-7-5-local/* /install/cuda-7.5/ppc64le/cuda-core + # Create the repo directory under xCAT /install dir for cuda 9.2 + mkdir -p /install/cuda-9.2/ppc64le/cuda-core + cp /tmp/cuda/var/cuda-repo-9-2-local/*.rpm /install/cuda-9.2/ppc64le/cuda-core # Create the yum repo files - createrepo /install/cuda-7.5/ppc64le/cuda-core + createrepo /install/cuda-9.2/ppc64le/cuda-core #. The NVIDIA CUDA Toolkit contains rpms that have dependencies on other external packages (such as ``DKMS``). These are provided by EPEL. It's up to the system administrator to obtain the dependency packages and add those to the ``cuda-deps`` directory: :: - mkdir -p /install/cuda-7.5/ppc64le/cuda-deps - cd /install/cuda-7.5/ppc64le/cuda-deps + mkdir -p /install/cuda-9.2/ppc64le/cuda-deps # Copy the DKMS rpm to this directory - ls - dkms-2.2.0.3-30.git.7c3e7c5.el7.noarch.rpm + cp /path/to/dkms-2.4.0-1.20170926git959bd74.el7.noarch.rpm /install/cuda-9.2/ppc64le/cuda-deps # Execute createrepo in this directory - createrepo /install/cuda-7.5/ppc64le/cuda-deps - + createrepo /install/cuda-9.2/ppc64le/cuda-deps diff --git a/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst b/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst index d7b726c05..5d2753e2d 100644 --- a/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst +++ b/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst @@ -3,15 +3,15 @@ Update NVIDIA Driver If the user wants to update the newer NVIDIA driver on the system, follow the :doc:`Create CUDA software repository ` document to create another repository for the new driver. -The following example assumes the new driver is in ``/install/cuda-7.5/ppc64le/nvidia_new``. +The following example assumes the new driver is in ``/install/cuda-9.2/ppc64le/nvidia_new``. Diskful ------- #. Change pkgdir for the cuda image: :: - chdef -t osimage -o rhels7.2-ppc64le-install-cudafull \ - pkgdir=/install/cuda-7.5/ppc64le/nvidia_new,/install/cuda-7.5/ppc64le/cuda-deps + chdef -t osimage -o rhels7.5-ppc64le-install-cudafull \ + pkgdir=/install/cuda-9.2/ppc64le/nvidia_new,/install/cuda-9.2/ppc64le/cuda-deps #. Use xdsh command to remove all the NVIDIA rpms: :: From 7e6290fb7d658e8b70da1491cbac18118963f684 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 22 Mar 2018 14:00:30 +0800 Subject: [PATCH 054/161] Remove tailing spaces --- .../advanced/gpu/nvidia/deploy_cuda_node.rst | 8 +++--- docs/source/advanced/gpu/nvidia/index.rst | 2 +- .../advanced/gpu/nvidia/osimage/rhels.rst | 25 +++++++++---------- .../source/advanced/gpu/nvidia/repo/rhels.rst | 13 +++++----- .../gpu/nvidia/update_nvidia_driver.rst | 15 +++-------- 5 files changed, 26 insertions(+), 37 deletions(-) diff --git a/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst b/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst index b705e85d5..2ea89f7ae 100644 --- a/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst +++ b/docs/source/advanced/gpu/nvidia/deploy_cuda_node.rst @@ -1,15 +1,14 @@ Deploy CUDA nodes ================= -Diskful +Diskful ------- * To provision diskful nodes using osimage ``rhels7.5-ppc64le-install-cudafull``: :: nodeset osimage=rhels7.5-ppc64le-install-cudafull rsetboot net - rpower boot - + rpower boot Diskless -------- @@ -18,5 +17,4 @@ Diskless nodeset osimage=rhels7.5-ppc64le-netboot-cudafull rsetboot net - rpower boot - + rpower boot diff --git a/docs/source/advanced/gpu/nvidia/index.rst b/docs/source/advanced/gpu/nvidia/index.rst index cf673106c..d4306710e 100644 --- a/docs/source/advanced/gpu/nvidia/index.rst +++ b/docs/source/advanced/gpu/nvidia/index.rst @@ -7,7 +7,7 @@ For more information, see NVIDIAs website: https://developer.nvidia.com/cuda-zon xCAT supports CUDA installation for Ubuntu 14.04.3 and RHEL 7.5 on PowerNV (Non-Virtualized) for both diskful and diskless nodes. -Within the NVIDIA CUDA Toolkit, installing the ``cuda`` package will install both the ``cuda-runtime`` and the ``cuda-toolkit``. The ``cuda-toolkit`` is intended for developing CUDA programs and monitoring CUDA jobs. If your particular installation requires only running GPU jobs, it's recommended to install only the ``cuda-runtime`` package. +Within the NVIDIA CUDA Toolkit, installing the ``cuda`` package will install both the ``cuda-runtime`` and the ``cuda-toolkit``. The ``cuda-toolkit`` is intended for developing CUDA programs and monitoring CUDA jobs. If your particular installation requires only running GPU jobs, it's recommended to install only the ``cuda-runtime`` package. .. toctree:: :maxdepth: 2 diff --git a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst index 163581ba6..5a3e59ffe 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst @@ -1,7 +1,7 @@ RHEL 7.5 ======== -xCAT provides a sample package list (pkglist) files for CUDA. You can find them: +xCAT provides a sample package list (pkglist) files for CUDA. You can find them: * Diskful: ``/opt/xcat/share/xcat/install/rh/cuda*`` * Diskless: ``/opt/xcat/share/xcat/netboot/rh/cuda*`` @@ -9,7 +9,7 @@ xCAT provides a sample package list (pkglist) files for CUDA. You can find them: Diskful images -------------- -The following examples will create diskful images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.5-ppc64le-install-compute`` osimage. +The following examples will create diskful images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.5-ppc64le-install-compute`` osimage. **[Note]**: There is a requirement to reboot the machine after the CUDA drivers are installed. To satisfy this requirement, the CUDA software is installed in the ``pkglist`` attribute of the osimage definition where a reboot will happen after the Operating System is installed. @@ -20,7 +20,7 @@ cudafull lsdef -t osimage -z rhels7.5-ppc64le-install-compute \ | sed 's/install-compute:/install-cudafull:/' \ - | mkdef -z + | mkdef -z #. Add the CUDA repo created in the previous step to the ``pkgdir`` attribute: :: @@ -39,7 +39,7 @@ cudaruntime lsdef -t osimage -z rhels7.5-ppc64le-install-compute \ | sed 's/install-compute:/install-cudaruntime:/' \ - | mkdef -z + | mkdef -z #. Add the CUDA repo created in the previous step to the ``pkgdir`` attribute: :: @@ -54,9 +54,9 @@ cudaruntime Diskless images --------------- -The following examples will create diskless images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.5-ppc64le-netboot-compute`` osimage. +The following examples will create diskless images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.5-ppc64le-netboot-compute`` osimage. -**[Note]**: For diskless, the install of the CUDA packages MUST be done in the ``otherpkglist`` and **NOT** the ``pkglist`` as with diskful. The requirement for rebooting the machine is not applicable in diskless nodes because the image is loaded on each reboot. +**[Note]**: For diskless, the install of the CUDA packages MUST be done in the ``otherpkglist`` and **NOT** the ``pkglist`` as with diskful. The requirement for rebooting the machine is not applicable in diskless nodes because the image is loaded on each reboot. cudafull ^^^^^^^^ @@ -65,16 +65,16 @@ cudafull lsdef -t osimage -z rhels7.5-ppc64le-netboot-compute \ | sed 's/netboot-compute:/netboot-cudafull:/' \ - | mkdef -z + | mkdef -z -#. Verify that the CUDA repo created in the previous step is available in the directory specified by the ``otherpkgdir`` attribute. +#. Verify that the CUDA repo created in the previous step is available in the directory specified by the ``otherpkgdir`` attribute. The ``otherpkgdir`` directory can be obtained by running lsdef on the osimage: :: # lsdef -t osimage rhels7.5-ppc64le-netboot-cudafull -i otherpkgdir Object name: rhels7.5-ppc64le-netboot-cudafull otherpkgdir=/install/post/otherpkgs/rhels7.5/ppc64le - + Create a symbolic link of the CUDA repository in the directory specified by ``otherpkgdir`` :: ln -s /install/cuda-9.2 /install/post/otherpkgs/rhels7.5/ppc64le/cuda-9.2 @@ -84,7 +84,7 @@ cudafull chdef -t osimage -o rhels7.5-ppc64le-netboot-cudafull \ rootimgdir=/install/netboot/rhels7.5/ppc64le/cudafull -#. Create a custom pkglist file to install additional operating system packages for your CUDA node. +#. Create a custom pkglist file to install additional operating system packages for your CUDA node. #. Copy the default compute pkglist file as a starting point: :: @@ -111,7 +111,7 @@ cudafull #. Create the otherpkg.pkglist file for cudafull: :: vi /install/custom/netboot/rh/cudafull.rhels7.ppc64le.otherpkgs.pkglist - # add the following packages + # add the following packages cuda-9.2/ppc64le/cuda-deps/dkms cuda-9.2/ppc64le/cuda-core/cuda @@ -137,7 +137,7 @@ cudaruntime | sed 's/netboot-compute:/netboot-cudaruntime:/' \ | mkdef -z -#. Verify that the CUDA repo created previously is available in the directory specified by the ``otherpkgdir`` attribute. +#. Verify that the CUDA repo created previously is available in the directory specified by the ``otherpkgdir`` attribute. #. Obtain the ``otherpkgdir`` directory using the ``lsdef`` command: :: @@ -177,7 +177,6 @@ cudaruntime packimage rhels7.5-ppc64le-netboot-cudaruntime - POWER9 Setup ------------ diff --git a/docs/source/advanced/gpu/nvidia/repo/rhels.rst b/docs/source/advanced/gpu/nvidia/repo/rhels.rst index 056ac682a..ec98e9490 100644 --- a/docs/source/advanced/gpu/nvidia/repo/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/repo/rhels.rst @@ -1,11 +1,10 @@ RHEL 7.5 ======== - #. Create a repository on the MN node installing the CUDA Toolkit: :: # For cuda toolkit name: /path/to/cuda-repo-rhel7-9-2-local-9.2.64-1.ppc64le.rpm - # extract the contents from the rpm + # extract the contents from the rpm mkdir -p /tmp/cuda cd /tmp/cuda rpm2cpio /path/to/cuda-repo-rhel7-9-2-local-9.2.64-1.ppc64le.rpm | cpio -i -d @@ -14,15 +13,15 @@ RHEL 7.5 mkdir -p /install/cuda-9.2/ppc64le/cuda-core cp /tmp/cuda/var/cuda-repo-9-2-local/*.rpm /install/cuda-9.2/ppc64le/cuda-core - # Create the yum repo files + # Create the yum repo files createrepo /install/cuda-9.2/ppc64le/cuda-core - + #. The NVIDIA CUDA Toolkit contains rpms that have dependencies on other external packages (such as ``DKMS``). These are provided by EPEL. It's up to the system administrator to obtain the dependency packages and add those to the ``cuda-deps`` directory: :: mkdir -p /install/cuda-9.2/ppc64le/cuda-deps - # Copy the DKMS rpm to this directory - cp /path/to/dkms-2.4.0-1.20170926git959bd74.el7.noarch.rpm /install/cuda-9.2/ppc64le/cuda-deps + # Copy the DKMS rpm to this directory + cp /path/to/dkms-2.4.0-1.20170926git959bd74.el7.noarch.rpm /install/cuda-9.2/ppc64le/cuda-deps - # Execute createrepo in this directory + # Execute createrepo in this directory createrepo /install/cuda-9.2/ppc64le/cuda-deps diff --git a/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst b/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst index 5d2753e2d..ad6a31a63 100644 --- a/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst +++ b/docs/source/advanced/gpu/nvidia/update_nvidia_driver.rst @@ -3,7 +3,7 @@ Update NVIDIA Driver If the user wants to update the newer NVIDIA driver on the system, follow the :doc:`Create CUDA software repository ` document to create another repository for the new driver. -The following example assumes the new driver is in ``/install/cuda-9.2/ppc64le/nvidia_new``. +The following example assumes the new driver is in ``/install/cuda-9.2/ppc64le/nvidia_new``. Diskful ------- @@ -13,33 +13,26 @@ Diskful chdef -t osimage -o rhels7.5-ppc64le-install-cudafull \ pkgdir=/install/cuda-9.2/ppc64le/nvidia_new,/install/cuda-9.2/ppc64le/cuda-deps - #. Use xdsh command to remove all the NVIDIA rpms: :: - - xdsh "yum remove *nvidia* -y" + xdsh "yum remove *nvidia* -y" #. Run updatenode command to update NVIDIA driver on the compute node: :: updatenode -S - #. Reboot compute node: :: rpower off rpower on - #. Verify the newer driver level: :: nvidia-smi | grep Driver - - - Diskless -------- -To update a new NVIDIA driver on diskless compute nodes, re-generate the osimage pointing to the new NVIDIA driver repository and reboot the node to load the diskless image. +To update a new NVIDIA driver on diskless compute nodes, re-generate the osimage pointing to the new NVIDIA driver repository and reboot the node to load the diskless image. -Refer to :doc:`Create osimage definitions ` for specific instructions. +Refer to :doc:`Create osimage definitions ` for specific instructions. From f7cf702cfbfe4d61fa356b79f88184d81df9a1d4 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 22 Mar 2018 14:01:26 +0800 Subject: [PATCH 055/161] Mionr tweak text format --- 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 5a3e59ffe..77dee5f3f 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst @@ -184,7 +184,7 @@ NVIDIA POWER9 CUDA driver need some additional setup. Refer the URL below for de http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#power9-setup -xCAT includes a script, `cuda_power9_setup` as example, to help user handle this situation. +xCAT includes a script, ``cuda_power9_setup`` as example, to help user handle this situation. Diskful osimage ^^^^^^^^^^^^^^^ From 56b926afaa9334b622a9bd1b6442eb17f9c0d0f4 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 22 Mar 2018 02:13:46 -0400 Subject: [PATCH 056/161] fix error 4989: The error message of bmcdiscover is disordered when it hit database problem --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 4674205df..7461133c0 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1053,7 +1053,7 @@ sub bmcdiscovery_ipmi { if ($output =~ $bmcstr) { store_fd({data=>1}, $fd); - if ($output =~ /RAKP 2 message indicates an error : (.+)\nError: (.+)/) { + if ($output =~ /RAKP \d+ message indicates an error : (.+)\nError: (.+)/) { xCAT::MsgUtils->message("W", { data => ["$2: $1 for $ip"] }, $::CALLBACK); return; } @@ -1127,6 +1127,9 @@ sub bmcdiscovery_ipmi { } elsif ($output =~ /RAKP \S* \S* is invalid/) { xCAT::MsgUtils->message("W", { data => ["BMC password is incorrect for $ip"] }, $::CALLBACK); return; + } else { + xCAT::MsgUtils->message("W", { data => ["Unknown error get from $ip"] }, $::CALLBACK); + return; } display_output($opz,$opw,$mtms_node,$mac_node,$node_data,"ipmi",$request_command); From 2c14238db9ebc7a37d8578b0e9966e20cf8aa34f Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 22 Mar 2018 03:02:13 -0400 Subject: [PATCH 057/161] fix rspconfig issues API related --- .../agent/hwctl/executor/openbmc_bmcconfig.py | 10 +++++++--- .../lib/python/agent/hwctl/openbmc_client.py | 20 ++++++++++++++++--- .../lib/python/agent/xcatagent/openbmc.py | 4 +++- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 +++++++- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 1c278e70d..33bb6077d 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -375,11 +375,12 @@ rmdir \"/tmp/$userid\" \n") node = kw['node'] obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, debugmode=self.debugmode, verbose=self.verbose) + try: obmc.login() obmc.set_apis_values(key, value) except (SelfServerException, SelfClientException) as e: - self.callback.error(e.message, node) + return self.callback.error(e.message, node) self.callback.info("%s: BMC Setting %s..." % (node, openbmc.RSPCONFIG_APIS[key]['display_name'])) @@ -392,9 +393,12 @@ rmdir \"/tmp/$userid\" \n") value = obmc.get_apis_values(key) except (SelfServerException, SelfClientException) as e: - self.callback.error(e.message, node) + return self.callback.error(e.message, node) - str_value = '0.'+str(value) + if isinstance(value, dict): + str_value = value.values()[0] + else: + str_value = value result = '%s: %s: %s' % (node, openbmc.RSPCONFIG_APIS[key]['display_name'], str_value.split('.')[-1]) self.callback.info(result) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index b1654a884..241396df8 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -185,13 +185,17 @@ RSPCONFIG_APIS = { 'set_url': "attr/AutoReboot", 'get_url': "attr/AutoReboot", 'display_name': "BMC AutoReboot", + 'attr_values': { + '0': False, + '1': True, + }, }, 'powersupplyredundancy':{ 'baseurl': "/sensors/chassis/PowerSupplyRedundancy/", - 'set_url': "/action/setValue", - 'get_url': "/action/getValue", + 'set_url': "action/setValue", + 'get_url': "action/getValue", 'get_method': 'POST', - 'get_data': '[]', + 'get_data': [], 'display_name': "BMC PowerSupplyRedundancy", 'attr_values': { 'disabled': "Disables", @@ -220,6 +224,16 @@ RSPCONFIG_APIS = { 'setup': "xyz.openbmc_project.Control.Boot.Mode.Modes.Setup", }, }, + 'timesyncmethod': { + 'baseurl': '/time/sync_method', + 'get_url': '', + 'set_url': '/attr/TimeSyncMethod', + 'display_name': 'BMC TimeSyncMethod', + 'attr_values': { + 'ntp': 'xyz.openbmc_project.Time.Synchronization.Method.NTP', + 'manual': 'xyz.openbmc_project.Time.Synchronization.Method.Manual', + }, + }, } EVENTLOG_URL = "/logging/enumerate" diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 34fd808e1..75898513f 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -82,7 +82,7 @@ RFLASH_URLS = { } } -RSPCONFIG_GET_OPTIONS = ['ip','ipsrc','netmask','gateway','vlan','ntpservers','hostname','bootmode','autoreboot','powersupplyredundancy','powerrestorepolicy'] +RSPCONFIG_GET_OPTIONS = ['ip','ipsrc','netmask','gateway','vlan','ntpservers','hostname','bootmode','autoreboot','powersupplyredundancy','powerrestorepolicy', 'timesyncmethod'] RSPCONFIG_SET_OPTIONS = { 'ip':'.*', 'netmask':'.*', @@ -95,6 +95,7 @@ RSPCONFIG_SET_OPTIONS = { 'powerrestorepolicy':"^always_on$|^always_off$|^restore$", 'bootmode':"^regular$|^safe$|^setup$", 'admin_passwd':'.*,.*', + 'timesyncmethod':'^ntp$|^manual$', } RSPCONFIG_USAGE = """ Handle rspconfig operations. @@ -124,6 +125,7 @@ The supported attributes and its values to set are: autoreboot={0|1} powersupplyredundancy={enabled|disabled} powerrestorepolicy={always_on|always_off|restore} + timesyncmethod={ntp|manual} """ % RSPCONFIG_GET_OPTIONS XCAT_LOG_DIR = "/var/log/xcat" diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f20c1c962..cd5efe395 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1643,7 +1643,13 @@ sub parse_command_status { # Everything else is invalid xCAT::SvrUtils::sendmsg([1, "Invalid value '$subcommand_value' for '$subcommand_key'"], $callback); my @valid_values = keys %{ $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_value} }; - xCAT::SvrUtils::sendmsg([1, "Valid values: " . join(",", @valid_values)], $callback); + if (!@valid_values) { + if ($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{type} eq "boolean") { + xCAT::SvrUtils::sendmsg([1, "Valid values: 0,1"], $callback); + } + } else { + xCAT::SvrUtils::sendmsg([1, "Valid values: " . join(",", @valid_values)], $callback); + } return 1; } } From 4208f61069e369a3eae8c172605d8126e7b6055e Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 22 Mar 2018 16:52:23 +0800 Subject: [PATCH 058/161] fix issue updatenode -P return nothing when xcatmaster not set (#4994) --- xCAT-server/lib/xcat/plugins/updatenode.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 899dd34f4..c0dfb4081 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -309,7 +309,7 @@ sub preprocess_updatenode # get server names as known by the nodes my %servernodes = - %{ xCAT::InstUtils->get_server_nodes($callback, $request->{node}) }; + %{ xCAT::InstUtils->get_server_nodes($callback, $request->{node},1) }; # it's possible that the nodes could have diff server names # do all the nodes for a particular server at once @@ -1555,7 +1555,7 @@ sub updatenoderunps # get server names as known by the nodes my %servernodes = - %{ xCAT::InstUtils->get_server_nodes($callback, \@$nodes,1) }; + %{ xCAT::InstUtils->get_server_nodes($callback, \@$nodes) }; # it's possible that the nodes could have diff server names # do all the nodes for a particular server at once From 05fcefb2435ed450bbe30359d38564944c3d3343 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 22 Mar 2018 10:39:17 -0400 Subject: [PATCH 059/161] Changes for review comments --- .../lib/python/agent/hwctl/executor/openbmc_power.py | 10 +++------- .../lib/python/agent/hwctl/openbmc_client.py | 5 ----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index 0772afe4a..c3524cf9a 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -82,17 +82,13 @@ class OpenBMCPowerTask(ParallelNodesCommand): if bmc_state != 'Ready': bmc_state = bmc_not_ready - bmc_state_error = state.get('error') - if bmc_state_error is not None: - # BMC is not ready and we have some error as to why - self.callback.info('%s: %s (%s)' % (node, openbmc.RPOWER_STATES.get(bmc_state, bmc_state), bmc_state_error)) - return bmc_state self.callback.info('%s: %s' % (node, openbmc.RPOWER_STATES.get(bmc_state, bmc_state))) - except SelfServerException, SelfClientException: - # There is no response when BMC is not ready + except SelfServerException as e: self.callback.error(openbmc.RPOWER_STATES[bmc_not_ready], node) + except SelfClientException as e: + self.callback.error("%s (%s)" % (openbmc.RPOWER_STATES[bmc_not_ready], e.message), node) return bmc_state diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 73aacef58..2d39c8943 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -320,8 +320,6 @@ class OpenBMCRest(object): 'Validate BMC configuration and retry the command.' self._print_error_log(e.message, cmd) raise - except SelfClientException as e: - raise SelfClientException(e.message, e.code) except ValueError: error = 'Received wrong format response: %s' % response self._print_error_log(error, cmd) @@ -415,9 +413,6 @@ class OpenBMCRest(object): try: state = self.request('GET', BMC_URLS['state']['path'], cmd='get_bmc_state') return {'bmc': state.split('.')[-1]} - except SelfClientException as e: - # Return error message received from the request - return {'bmc': "NotReady", 'error': e.message} except KeyError: error = 'Received wrong format response: %s' % state raise SelfServerException(error) From d8ca5d513790333a35007f902ce0afd256e003f8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 22 Mar 2018 14:10:12 -0400 Subject: [PATCH 060/161] OpenBMC rbeacon stat support in Perl --- xCAT-server/lib/xcat/plugins/openbmc.pm | 37 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index ce764ddb8..b53766479 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1160,8 +1160,8 @@ sub parse_args { } if ($command eq "rbeacon") { - unless ($subcommand =~ /^on$|^off$/) { - return ([ 1, "Only 'on' or 'off' is supported for OpenBMC managed nodes."]); + unless ($subcommand =~ /^on$|^off$|^stat$/) { + return ([ 1, "Only 'on', 'off' or 'stat' are supported for OpenBMC managed nodes."]); } } elsif ($command eq "rpower") { unless ($subcommand =~ /^on$|^off$|^softoff$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) { @@ -1442,6 +1442,10 @@ sub parse_command_status { } elsif ($subcommand eq "off") { $next_status{LOGIN_RESPONSE} = "RBEACON_OFF_REQUEST"; $next_status{RBEACON_OFF_REQUEST} = "RBEACON_OFF_RESPONSE"; + } elsif ($subcommand eq "stat") { + $next_status{LOGIN_RESPONSE} = "RVITALS_LEDS_REQUEST"; + $next_status{RVITALS_LEDS_REQUEST} = "RVITALS_LEDS_RESPONSE"; + $status_info{RVITALS_LEDS_RESPONSE}{argv} = "compact"; } } @@ -4133,17 +4137,24 @@ sub rvitals_response { } if ($node_info{$node}{cur_status} =~ "RVITALS_LEDS_RESPONSE") { - $content_info = "Front . . . . . : Power:$leds{front_power} Fault:$leds{front_fault} Identify:$leds{front_id}"; - push (@sorted_output, $content_info); - $content_info = "Rear . . . . . : Power:$leds{rear_power} Fault:$leds{rear_fault} Identify:$leds{rear_id}"; - push (@sorted_output, $content_info); - # Fans - if ($leds{fan0} =~ "Off" and $leds{fan1} =~ "Off" and $leds{fan2} eq "Off" and $leds{fan3} eq "Off") { - $content_info = "Front Fans . . : No LEDs On"; - } else { - $content_info = "Front Fans . . : fan0:$leds{fan0} fan1:$leds{fan1} fan2:$leds{fan2} fan3:$leds{fan3}"; - } - push (@sorted_output, $content_info); + if ($grep_string =~ "compact") { + # Compact output for "rbeacon stat" command + $content_info = "Front:$leds{front_id} Rear:$leds{rear_id}"; + push (@sorted_output, $content_info); + } else { + # Full output for "rvitals leds" command + $content_info = "Front . . . . . : Power:$leds{front_power} Fault:$leds{front_fault} Identify:$leds{front_id}"; + push (@sorted_output, $content_info); + $content_info = "Rear . . . . . : Power:$leds{rear_power} Fault:$leds{rear_fault} Identify:$leds{rear_id}"; + push (@sorted_output, $content_info); + # Fans + if ($leds{fan0} =~ "Off" and $leds{fan1} =~ "Off" and $leds{fan2} eq "Off" and $leds{fan3} eq "Off") { + $content_info = "Front Fans . . : No LEDs On"; + } else { + $content_info = "Front Fans . . : fan0:$leds{fan0} fan1:$leds{fan1} fan2:$leds{fan2} fan3:$leds{fan3}"; + } + push (@sorted_output, $content_info); + } } # If sorted array has any contents, sort it and print it From 20e7dcd7de1e5f02c0b4a78b6d77ca19892906d2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 22 Mar 2018 14:47:05 -0400 Subject: [PATCH 061/161] Better message for --recover option --- docs/source/guides/admin-guides/references/man1/rflash.1.rst | 2 +- xCAT-client/pods/man1/rflash.1.pod | 2 +- xCAT-server/lib/xcat/plugins/ipmi.pm | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 5e833a139..89cbb7c1a 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -236,7 +236,7 @@ This delete option will delete update image from BMC. It expects an ID as the in OpenPOWER BMC specific (using IPMI): - Used for IBM Power S822LC for Big Data systems only. Used to recover the BMC with a BMC image downloaded from FixCentral. + Used for IBM Power S822LC for Big Data systems only. Used to recover the BMC with a BMC image downloaded from FixCentral. This option will only work if BMC is in "Brick protection" state. diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index 94d0db3bc..ac8068d95 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -173,7 +173,7 @@ Used to recover the flash image in the permanent side of the chip to the tempora OpenPOWER BMC specific (using IPMI): -Used for IBM Power S822LC for Big Data systems only. Used to recover the BMC with a BMC image downloaded from FixCentral. +Used for IBM Power S822LC for Big Data systems only. Used to recover the BMC with a BMC image downloaded from FixCentral. This option will only work if BMC is in "Brick protection" state. =item B<--retry=>I diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index a47df379a..40b1850f9 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2518,6 +2518,10 @@ sub do_rflash_process { my $cmd = "/usr/bin/tftp $bmcip -m binary -c put $recover_image ".basename($recover_image); my $output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC != 0) { + if ($output =~ "timed out") { + # Time out running tftp command. One possible reason is BMC not in "brick protection" mode + $output .= " BMC might not be in 'Brick protection' state"; + } $callback->({ error => "Running tftp command \'$cmd\' failed. Error Code: $::RUNCMD_RC. Output: $output.", errorcode => 1 }); exit(1); From 7d70ccdf40724828bca2ab7432152539e9174f6a Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 22 Mar 2018 22:09:29 -0400 Subject: [PATCH 062/161] show error msg for rpower bmcstate when username is wrong --- .../lib/python/agent/hwctl/executor/openbmc_power.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index c3524cf9a..e493816e3 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -75,6 +75,9 @@ class OpenBMCPowerTask(ParallelNodesCommand): login_message = "Login to BMC failed: Can't connect to {0} {1}.".format(e.host_and_port, e.detail_msg) self.callback.error(login_message, node) return bmc_state + except SelfClientException as e: + self.callback.error(e.message, node) + return bmc_state try: state = obmc.get_bmc_state() From 61b332e61c865a304570bb7579b78c941bdbb299 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 22 Mar 2018 23:07:54 -0400 Subject: [PATCH 063/161] fix typo --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index f3f872594..9e77cacfc 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -66,11 +66,11 @@ cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d -cmd:xdsh $$CN echo 1 > /proc/sys/kernel/sysrq -cmd:xdsh $$CN echo c > /proc/sysrq-trigger +cmd:xdsh $$CN "echo 1 > /proc/sys/kernel/sysrq" +cmd:xdsh $$CN "echo c > /proc/sysrq-trigger" cmd:sleep 600 -cmd:if [[ -s /hello ]]; then echo "this file is not empty";else echo "this file is empty"; fi +cmd:vmcorefile=`find /kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi check:output=~not empty cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;mv -f $pkglistfile.bak $pkglistfile @@ -78,4 +78,5 @@ cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile cmd:if [ -f /etc/exports.bak ] ;then mv -f /etc/exports.bak /etc/exports; fi +#cmd:rm -rf /kdumpdir end From fdfd8b4700124d163dc9c4ce612dc9c5adc04ede Mon Sep 17 00:00:00 2001 From: XuWei Date: Fri, 23 Mar 2018 04:10:31 -0400 Subject: [PATCH 064/161] modified depending on comments --- .../agent/hwctl/executor/openbmc_flash.py | 17 ++++++++----- .../agent/hwctl/executor/openbmc_inventory.py | 24 ++++++++----------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py index ecfc19f13..ffaa051a1 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py @@ -80,12 +80,17 @@ class OpenBMCFlashTask(ParallelNodesCommand): def _get_firmware_version(self, target_file): - grep_cmd = '/usr/bin/grep -a' - version_cmd = grep_cmd + ' ^version= ' + target_file - purpose_cmd = grep_cmd + ' purpose= ' + target_file - firmware = os.popen(version_cmd).readlines()[0].split('=')[-1].strip() - purpose = os.popen(purpose_cmd).readlines()[0].split('=')[-1].strip().split('.')[-1] - return { firmware: {'purpose': purpose} } + version = purpose = None + with open(target_file, 'r') as fh: + for line in fh: + if 'version=' in line: + version = line.split('=')[-1].strip() + if 'purpose=' in line: + purpose = line.split('=')[-1].strip().split('.')[-1] + if version and purpose: + break + + return { version: {'purpose': purpose} } def pre_activate_firm(self, task, activate_arg, **kw): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py index 6cd2ea871..8fdf93368 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py @@ -28,22 +28,18 @@ class OpenBMCInventoryTask(ParallelNodesCommand): target_file = utils.get_full_path(self.cwd, target_file) - grep_cmd = '/usr/bin/grep -a' - version_cmd = grep_cmd + ' ^version= ' + target_file - purpose_cmd = grep_cmd + ' purpose= ' + target_file - purpose_ver = os.popen(purpose_cmd).readlines() - firmware_ver = os.popen(version_cmd).readlines() - if purpose_ver: - purpose_ver = purpose_ver[0].split('=')[-1].strip() - else: - purpose_ver = '' - if firmware_ver: - firmware_ver = firmware_ver[0].split('=')[-1].strip() - else: - firmware_ver = '' + version = purpose = None + with open(target_file, 'r') as fh: + for line in fh: + if 'version=' in line: + version = line.split('=')[-1].strip() + if 'purpose=' in line: + purpose = line.split('=')[-1].strip().split('.')[-1] + if version and purpose: + break self.callback.info('TAR %s Firmware Product Version: %s' \ - % (purpose_ver,firmware_ver)) + % (purpose, version)) def _get_firm_info(self, firm_info_list): (has_functional, firm_obj_dict) = firm_info_list From 59da0b4ed3be6d8d110925c48ea58b1408e81937 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 23 Mar 2018 16:35:36 +0800 Subject: [PATCH 065/161] Add a test case for rvitals outputs format checking --- xCAT-test/autotest/testcase/rvitals/cases1 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 xCAT-test/autotest/testcase/rvitals/cases1 diff --git a/xCAT-test/autotest/testcase/rvitals/cases1 b/xCAT-test/autotest/testcase/rvitals/cases1 new file mode 100644 index 000000000..f18dca405 --- /dev/null +++ b/xCAT-test/autotest/testcase/rvitals/cases1 @@ -0,0 +1,5 @@ +start:rvitals_outputs_format_checking +description: Check the output formats of rvitals +cmd:rvitals $$CN | grep -v -E '^[^:]+:[^:]+:[^:]+$' +check:rc==1 +end From cc588f4af1645d55ac46b9ffd087b958c34955c4 Mon Sep 17 00:00:00 2001 From: chenglch Date: Fri, 23 Mar 2018 13:47:32 +0800 Subject: [PATCH 066/161] Modify startup configuration for goconserver and conserver After running makegocons, startup configuration would be changed to make sure goconserver could start after rebooting. Changes are made in makeconservercf too. --- perl-xCAT/xCAT/MsgUtils.pm | 45 +++++++-- xCAT-server/lib/perl/xCAT/Goconserver.pm | 103 +++++++++++++++----- xCAT-server/lib/xcat/plugins/conserver.pm | 1 + xCAT-server/lib/xcat/plugins/goconserver.pm | 31 +++--- 4 files changed, 128 insertions(+), 52 deletions(-) diff --git a/perl-xCAT/xCAT/MsgUtils.pm b/perl-xCAT/xCAT/MsgUtils.pm index 47cec0ff4..18a5f7f3b 100644 --- a/perl-xCAT/xCAT/MsgUtils.pm +++ b/perl-xCAT/xCAT/MsgUtils.pm @@ -559,16 +559,17 @@ sub message Example: - $rsp->{data}->[0] = "message"; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message($msg, $callback); =cut #----------------------------------------------------------------------------- sub error_message { shift; - my $rsp = shift; + my $msg = shift; my $callback = shift; + my $rsp; + $rsp->{data}->[0] = $msg; if (!defined($callback)) { message(undef, "S", $rsp, undef); return; @@ -591,16 +592,17 @@ sub error_message Example: - $rsp->{data}->[0] = "message"; - xCAT::MsgUtils->info_message($rsp, $callback); + xCAT::MsgUtils->info_message($msg, $callback); =cut #----------------------------------------------------------------------------- sub info_message { shift; - my $rsp = shift; + my $msg = shift; my $callback = shift; + my $rsp; + $rsp->{data}->[0] = $msg; if (!defined($callback)) { message(undef, "S", $rsp, undef); return; @@ -613,7 +615,38 @@ sub info_message message(undef, "I", $rsp, $callback); } +#----------------------------------------------------------------------------- +=head3 warn_message + + A wrap function for message. If $callback is not defined, send the log to + syslog, otherwise, send warning message to client. Print service host if runs + on service node. + + Example: + + xCAT::MsgUtils->warn_message($msg, $callback); +=cut + +#----------------------------------------------------------------------------- +sub warn_message +{ + shift; + my $msg = shift; + my $callback = shift; + my $rsp; + $rsp->{data}->[0] = $msg; + if (!defined($callback)) { + message(undef, "S", $rsp, undef); + return; + } + if ($isSN && !$host) { + my @hostinfo = xCAT::NetworkUtils->determinehostname(); + $host = $hostinfo[-1]; + } + $rsp->{host} = $host if $host; + message(undef, "W", $rsp, $callback); +} #-------------------------------------------------------------------------------- diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index 255137cb4..516433d5f 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -104,8 +104,7 @@ sub gen_request_data { foreach my $node (@openbmc_nodes) { if (defined($openbmc_hash->{$node}->[0])) { if (!$openbmc_hash->{$node}->[0]->{'bmc'}) { - $rsp->{data}->[0] = "$node: Failed to send delete request."; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("$node: Unable to get attribute bmc.", $callback); delete $data->{$node}; next; } @@ -115,8 +114,7 @@ sub gen_request_data { } elsif ($passwd_hash and $passwd_hash->{username}) { $data->{$node}->{params}->{user} = $passwd_hash->{username}; } else { - $rsp->{data}->[0] = "$node: Unable to get attribute username."; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("$node: Unable to get attribute username.", $callback); delete $data->{$node}; next; } @@ -125,8 +123,7 @@ sub gen_request_data { } elsif ($passwd_hash and $passwd_hash->{password}) { $data->{$node}->{params}->{password} = $passwd_hash->{password}; } else { - $rsp->{data}->[0] = "$node: Unable to get attribute password."; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("$node: Unable to get attribute password.", $callback); delete $data->{$node}; next; } @@ -259,14 +256,12 @@ sub delete_nodes { $ret = 0; my $response = http_request("DELETE", $url, $data); if (!defined($response)) { - $rsp->{data}->[0] = "Failed to send delete request."; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("Failed to send delete request.", $callback); return 1; } elsif ($delmode) { while (my ($k, $v) = each %{$response}) { if ($v ne "Deleted") { - $rsp->{data}->[0] = "$k: Failed to delete entry in goconserver: $v"; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("$k: Failed to delete entry in goconserver: $v", $callback); $ret = 1; } else { if ($callback) { @@ -279,8 +274,7 @@ sub delete_nodes { } if (@update_nodes) { if (disable_nodes_in_db(\@update_nodes)) { - $rsp->{data}->[0] = "Failed to update consoleenabled status in db."; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("Failed to update consoleenabled status in db.", $callback); } } return $ret; @@ -297,14 +291,12 @@ sub create_nodes { $ret = 0; my $response = http_request("POST", $url, $data); if (!defined($response)) { - $rsp->{data}->[0] = "Failed to send create request."; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("Failed to send create request.", $callback); return 1; } elsif ($response) { while (my ($k, $v) = each %{$response}) { if ($v ne "Created") { - $rsp->{data}->[0] = "$k: Failed to create console entry in goconserver: $v"; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("$k: Failed to create console entry in goconserver: $v", $callback); $ret = 1; } else { $rsp->{data}->[0] = "$k: $v"; @@ -315,8 +307,7 @@ sub create_nodes { } if (@update_nodes) { if (enable_nodes_in_db(\@update_nodes)) { - $rsp->{data}->[0] = "Failed to update consoleenabled status in db."; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("Failed to update consoleenabled status in db.", $callback); } } return $ret; @@ -328,13 +319,11 @@ sub list_nodes { my $rsp; my $response = http_request("GET", $url); if (!defined($response)) { - $rsp->{data}->[0] = "Failed to send list request. Is goconserver service started?"; - xCAT::MsgUtils->error_message($rsp, $callback); + xCAT::MsgUtils->error_message("Failed to send list request. Is goconserver service started?", $callback); return 1; } if (!$response->{nodes}) { - $rsp->{data}->[0] = "Could not find any node."; - xCAT::MsgUtils->info_message($rsp, $callback); + xCAT::MsgUtils->info_message("Could not find any node.", $callback); return 0; } $rsp->{data}->[0] = sprintf("\n".PRINT_FORMAT, "NODE", "SERVER", "STATE"); @@ -345,8 +334,7 @@ sub list_nodes { } $node_map->{$node->{name}}->{vis} = 1; if (!$node->{host} || !$node->{state}) { - $rsp->{data}->[0] = sprintf(PRINT_FORMAT, $node->{name}, "", "Unable to parse the response message"); - xCAT::MsgUtils->error_message("E", $rsp, $callback); + xCAT::MsgUtils->error_message(sprintf(PRINT_FORMAT, $node->{name}, "", "Unable to parse the response message"), $callback); next; } $rsp->{data}->[0] = sprintf(PRINT_FORMAT, $node->{name}, $node->{host}, substr($node->{state}, 0, 16)); @@ -370,8 +358,7 @@ sub cleanup_nodes { my $rsp; my $response = http_request("GET", "$api_url/nodes"); if (!defined($response)) { - $rsp->{data}->[0] = "Failed to send list request. Is goconserver service started?"; - xCAT::MsgUtils->error_message("E", $rsp, $callback); + xCAT::MsgUtils->error_message("Failed to send list request. Is goconserver service started?", $callback); return 1; } if (!$response->{nodes}) { @@ -491,6 +478,70 @@ sub is_goconserver_running { #------------------------------------------------------------------------------- +=head3 switch_goconserver + Disable conserver and enable goconserver during startup. + + Globals: + none + Example: + xCAT::Goconserver::switch_goconserver() + Comments: + none + +=cut + +#------------------------------------------------------------------------------- +sub switch_goconserver { + my $callback = shift; + # ignore SN as it is handled by AAsn + if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + my $cmd = "systemctl disable conserver"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } + $cmd = "systemctl enable goconserver"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } + } +} + +#------------------------------------------------------------------------------- + +=head3 switch_conserver + Disable goconserver and enable conserver during startup. + + Globals: + none + Example: + xCAT::Goconserver::switch_conserver() + Comments: + none + +=cut + +#------------------------------------------------------------------------------- +sub switch_conserver { + my $callback = shift; + # ignore SN as it is handled by AAsn + if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + my $cmd = "systemctl disable goconserver"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } + $cmd = "systemctl enable conserver"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } + } +} + +#------------------------------------------------------------------------------- + =head3 is_conserver_running Check if the conserver service is running diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 357f774ae..08f6e714c 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -209,6 +209,7 @@ sub process_request { xCAT::MsgUtils->message("E", $rsp, $cb); return; } + xCAT::Goconserver::switch_conserver($cb); } makeconservercf($req, $cb); } diff --git a/xCAT-server/lib/xcat/plugins/goconserver.pm b/xCAT-server/lib/xcat/plugins/goconserver.pm index 1b397df6c..52325db86 100644 --- a/xCAT-server/lib/xcat/plugins/goconserver.pm +++ b/xCAT-server/lib/xcat/plugins/goconserver.pm @@ -142,16 +142,15 @@ sub process_request { sub start_goconserver { my ($rsp, $running, $ready, $ret); unless (-x "/usr/bin/goconserver") { - $rsp->{data}->[0] = "goconserver is not installed."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("goconserver is not installed.", $::callback); return 1; } # if goconserver is installed, check the status of conserver service. if (xCAT::Goconserver::is_conserver_running()) { - $rsp->{data}->[0] = "conserver is started, please stop it at first."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("conserver is started, please stop it at first.", $::callback); return 1; } + xCAT::Goconserver::switch_goconserver($::callback); $running = xCAT::Goconserver::is_goconserver_running(); $ready = xCAT::Goconserver::is_xcat_conf_ready(); if ( $running && $ready ) { @@ -163,19 +162,16 @@ sub start_goconserver { if (!$ready) { $ret = xCAT::Goconserver::build_conf(); if ($ret) { - $rsp->{data}->[0] = "Failed to create configuration file for goconserver."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("Failed to create configuration file for goconserver.", $::callback); return 1; } } $ret = xCAT::Goconserver::restart_service(); if ($ret) { - $rsp->{data}->[0] = "Failed to start goconserver service."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("Failed to start goconserver service.", $::callback); return 1; } - $rsp->{data}->[0] = "Starting goconserver service ..."; - xCAT::MsgUtils->info_message($rsp, $::callback); + xCAT::MsgUtils->info_message("Starting goconserver service ...", $::callback); sleep(3); return 0; } @@ -203,16 +199,14 @@ sub makegocons { } if ($cleanupmode) { if (exists($req->{_allnodes}) && $req->{_allnodes}->[0] != 1) { - $rsp->{data}->[0] = "Failed to start goconserver service."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("Can not specify noderange together with -C|--cleanup.", $::callback); return 1; } return xCAT::Goconserver::cleanup_nodes($::callback); } my %cons_map = xCAT::Goconserver::get_cons_map($req); if (! %cons_map) { - $rsp->{data}->[0] = "Could not get any console request entry."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("Could not get any console request entry.", $::callback); return 1; } my $api_url = "https://$host:". xCAT::Goconserver::get_api_port(); @@ -233,15 +227,13 @@ sub makegocons { } elsif (lc($site_entry) ne "no") { # consoleondemand attribute is set, but it is not "yes" or "no" - $rsp->{data}->[0] = "Unexpected value $site_entry for consoleondemand attribute in site table."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("Unexpected value $site_entry for consoleondemand attribute in site table.", $::callback); } } my (@nodes); my $data = xCAT::Goconserver::gen_request_data(\%cons_map, $siteondemand, $::callback); if (! $data) { - $rsp->{data}->[0] = "Could not generate the request data."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("Could not generate the request data.", $::callback); return 1; } $ret = xCAT::Goconserver::delete_nodes($api_url, $data, $delmode, $::callback); @@ -250,8 +242,7 @@ sub makegocons { } $ret = xCAT::Goconserver::create_nodes($api_url, $data, $::callback); if ($ret != 0) { - $rsp->{data}->[0] = "Failed to create console entry in goconserver."; - xCAT::MsgUtils->error_message($rsp, $::callback); + xCAT::MsgUtils->error_message("Failed to create console entry in goconserver.", $::callback); return $ret; } return 0; From db6c5b77205f90d4fad0c500256b01035566e518 Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 23 Mar 2018 05:07:38 -0400 Subject: [PATCH 067/161] add xcat-inventory passwd network route validation testcase --- .../testcase/xcat-inventory/cases.network | 37 +++++++++++++++++++ .../testcase/xcat-inventory/cases.passwd | 23 ++++++++++++ .../testcase/xcat-inventory/cases.route | 21 +++++++++++ .../xcat-inventory/templates/network.json | 16 ++++++++ .../xcat-inventory/templates/network.yaml | 11 ++++++ .../xcat-inventory/templates/passwd.json | 10 +++++ .../xcat-inventory/templates/passwd.yaml | 7 ++++ .../xcat-inventory/templates/route.json | 12 ++++++ .../xcat-inventory/templates/route.yaml | 9 +++++ 9 files changed, 146 insertions(+) create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.network create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.passwd create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.route create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/network.json create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/network.yaml create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.json create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.yaml create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/route.json create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/route.yaml diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.network b/xCAT-test/autotest/testcase/xcat-inventory/cases.network new file mode 100644 index 000000000..c923f33ca --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.network @@ -0,0 +1,37 @@ +start:xcat_inventory_import_validation_network +description:This case is used to test network validation function of xcat-inventory import yaml and json file. To test "net" "mask" "dynamicrange" and "staticrange" attributes +cmd:lsdef -t network -o autotestnet > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t network -o autotestnet -z >/tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza ;rmdef -t network -o autotestnet;fi +check:rc==0 +cmd:mkdir -p /tmp/xcat_inventory_import_validation_network_bak +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "200.0.0.0" "/tmp/xcat_inventory_import_validation_network" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "234abc" "/tmp/xcat_inventory_import_validation_network" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "" "/tmp/xcat_inventory_import_validation_network" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "" "/tmp/xcat_inventory_import_validation_network" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "234.0.0.0" "/tmp/xcat_inventory_import_validation_network" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network" +check:rc!=0 +cmd:if [[ -e /tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza ]]; then cat /tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza | mkdef -z; fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_import_validation_network_bak +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.passwd b/xCAT-test/autotest/testcase/xcat-inventory/cases.passwd new file mode 100644 index 000000000..ec1be08de --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.passwd @@ -0,0 +1,23 @@ +start:xcat_inventory_import_validation_passwd +description:This case is used to test passwd validation function of xcat-inventory import yaml and json file. To test "cryptmethod" attribute +cmd:tabdump -w 'key==autotest' passwd |grep autotest > /dev/null 2>&1;if [[ $? -eq 0 ]]; then xcat-inventory export -t passwd -o autotest >/tmp/xcat_inventory_import_validation_passwd_bak/autotest ;tabch -d 'key==autotest' passwd;fi +check:rc==0 +cmd:mkdir -p /tmp/xcat_inventory_import_validation_passwd_bak +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "" "/tmp/xcat_inventory_import_validation_passwd" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "md5" "/tmp/xcat_inventory_import_validation_passwd" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "sha256" "/tmp/xcat_inventory_import_validation_passwd" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "sha512" "/tmp/xcat_inventory_import_validation_passwd" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "a.a" "/tmp/xcat_inventory_import_validation_passwd" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "MD5" "/tmp/xcat_inventory_import_validation_passwd" +check:rc!=0 +cmd:if [[ -e /tmp/xcat_inventory_import_validation_passwd_bak/autotest ]]; then xcat-inventory import -f /tmp/xcat_inventory_import_validation_passwd_bak/autotest; fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_import_validation_passwd_bak +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.route b/xCAT-test/autotest/testcase/xcat-inventory/cases.route new file mode 100644 index 000000000..d31451aa4 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.route @@ -0,0 +1,21 @@ +start:xcat_inventory_import_validation_route +description:This case is used to test route validation function of xcat-inventory import yaml and json file. To test "net" and "mask" attributes +cmd:mkdir -p /tmp/xcat_inventory_import_validation_route_bak +check:rc==0 +cmd:lsdef -t route -o autotestnet > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t route -o autotestnet -z >/tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza ;rmdef -t route -o autotestnet;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "200.0.0.0" "/tmp/xcat_inventory_import_validation_route" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "200.0" "/tmp/xcat_inventory_import_validation_route" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "" "/tmp/xcat_inventory_import_validation_route" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "default" "/tmp/xcat_inventory_import_validation_route" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "abc.345.123.202" "/tmp/xcat_inventory_import_validation_route" +check:rc!=0 +cmd:if [[ -e /tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza ]]; then cat /tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza | mkdef -z;fi +check:rc==0 +cmd:rm -rf /tmp/xcat_inventory_import_validation_route_bak +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/network.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/network.json new file mode 100644 index 000000000..263b936b6 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/network.json @@ -0,0 +1,16 @@ +{ + "network": { + "autotestnet": { + "basic_attr": { + "gateway": "123.0.0.100", + "mask": "255.0.0.0", + "net": "123.0.0.0" + }, + "pool": { + "dynamicrange": "123.0.0.100-123.0.0.200", + "staticrange": "123.0.0.201-123.0.0.222" + } + } + }, + "schema_version": "1.0" +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/network.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/network.yaml new file mode 100644 index 000000000..88e4114d4 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/network.yaml @@ -0,0 +1,11 @@ +network: + autotestnet: + basic_attr: + gateway: 123.0.0.100 + mask: 255.0.0.0 + net: 123.0.0.0 + pool: + dynamicrange: 123.0.0.100-123.0.0.200 + staticrange: 123.0.0.201-123.0.0.222 +schema_version: '1.0' + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.json new file mode 100644 index 000000000..ca7f4bb78 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.json @@ -0,0 +1,10 @@ +{ + "passwd": { + "autotest": { + "cryptmethod": "md5", + "password": "cluster", + "username": "root" + } + }, + "schema_version": "1.0" +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.yaml new file mode 100644 index 000000000..1225761cb --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/passwd.yaml @@ -0,0 +1,7 @@ +passwd: + autotest: + cryptmethod: md5 + password: cluster + username: root +schema_version: '1.0' + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/route.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/route.json new file mode 100644 index 000000000..aa2b9febe --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/route.json @@ -0,0 +1,12 @@ +{ + "route": { + "autotestnet": { + "gateway": "0.0.0.0", + "ifname": "eth1", + "mask": "255.0.0.0", + "net": "100.0.0.0", + "usercomment": "hello world" + } + }, + "schema_version": "1.0" +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/route.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/route.yaml new file mode 100644 index 000000000..5afda5a8d --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/route.yaml @@ -0,0 +1,9 @@ +route: + autotestnet: + gateway: 0.0.0.0 + ifname: eth1 + mask: 255.0.0.0 + net: 100.0.0.0 + usercomment: hello world +schema_version: '1.0' + From a60d8f7da1bde6b6a60fb212e303a68f15d1cd0f Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Sat, 24 Mar 2018 11:48:29 -0400 Subject: [PATCH 068/161] update to save node and osimage definition and restore the definitions after the test --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 9e77cacfc..5437d5f32 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -1,5 +1,7 @@ start:linux_diskless_kdump os:Linux +cmd:lsdef -z $$CN > /tmp/node.stanza +cmd:lsdef -t osimage -z __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute > /tmp/osimage.stanza cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 @@ -78,5 +80,7 @@ cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile cmd:if [ -f /etc/exports.bak ] ;then mv -f /etc/exports.bak /etc/exports; fi -#cmd:rm -rf /kdumpdir +cmd:rm -rf /kdumpdir +cmd:cat /tmp/node.stanza | chdef -z;rm -rf /tmp/node.stanza +cmd:cat /tmp/osimage.stanza | chdef -z;rm -rf /tmp/osimage.stanza end From 0e0584e4239599a077ef5d670cf95a9ef225249e Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Sat, 24 Mar 2018 12:00:21 -0400 Subject: [PATCH 069/161] Fix bugs of go-xcat test cases,Modify go-xcat test cases #21 --- xCAT-test/autotest/testcase/go-xcat/case1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/go-xcat/case1 b/xCAT-test/autotest/testcase/go-xcat/case1 index 00d9381a1..bb936f73a 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case1 +++ b/xCAT-test/autotest/testcase/go-xcat/case1 @@ -50,11 +50,10 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 cmd:rm -rf /tmp/go-xcat.log -cmd:xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION2_VERSION -y install" +cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat -x $migration_version -y install" check:rc==0 cmd:cat /tmp/go-xcat.log cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" -check:output=~Version $$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -118,12 +117,11 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 cmd:rm -rf /tmp/go-xcat.log -cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=$$MIGRATION2_VERSION -y install" +cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat --xcat-version=$migration_version -y install" check:rc==0 cmd:cat /tmp/go-xcat.log cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 -check:output=~Version $$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -134,4 +132,3 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:xdsh $$CN "cd /; rm -rf /go-xcat" end - From 14398e6688af51afb64a3ccd51a1a209a559d1f6 Mon Sep 17 00:00:00 2001 From: bybai Date: Sun, 25 Mar 2018 22:03:09 -0400 Subject: [PATCH 070/161] enhance error message for rflash --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index b53766479..66adaaadd 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1966,7 +1966,7 @@ sub parse_command_status { } } elsif (defined $tarfile_path) { if (!opendir(DIR, $tarfile_path)) { - xCAT::SvrUtils::sendmsg("Can't open directory : $tarfile_path", $callback); + xCAT::SvrUtils::sendmsg([1,"No BMC tar file found in $tarfile_path"], $callback); closedir(DIR); return 1; } From d307c394c25962ec87abeea14f1072554453d8e0 Mon Sep 17 00:00:00 2001 From: bybai Date: Sun, 25 Mar 2018 22:09:23 -0400 Subject: [PATCH 071/161] enhance error message for rflash --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 66adaaadd..e4df1466d 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1966,7 +1966,7 @@ sub parse_command_status { } } elsif (defined $tarfile_path) { if (!opendir(DIR, $tarfile_path)) { - xCAT::SvrUtils::sendmsg([1,"No BMC tar file found in $tarfile_path"], $callback); + xCAT::SvrUtils::sendmsg([1,"Can't open directory : $tarfile_path"], $callback); closedir(DIR); return 1; } From 492b8fe5a988f37e3c160905a4a7d0030fac849d Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Mon, 26 Mar 2018 11:31:55 +0800 Subject: [PATCH 072/161] unify chdef and mkdef some actions for node type (#4968) * unify chdef and mkdef some actions for node type * polished * adjust format --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 27 +++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index f51543a5f..e590a779a 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -2374,7 +2374,8 @@ sub defch $objTypeListsHash{$objk}{$obj} = 1; } } - + my $nodewithdomain; + my $invalidobjname = (); foreach my $obj (keys %::FINALATTRS) { @@ -2397,7 +2398,17 @@ sub defch $error = 1; next; } - + if ($obj =~ /\./ && $type eq "node") + { + $nodewithdomain .= ",$obj"; + delete($::FINALATTRS{$obj}); + next; + } + unless(isobjnamevalid($obj,$type)){ + $invalidobjname .= ",$obj"; + delete($::FINALATTRS{$obj}); + next; + } if (defined($objTypeListsHash{$type}{$obj}) && ($objTypeListsHash{$type}{$obj} == 1)) { $isDefined = 1; @@ -2860,7 +2871,17 @@ sub defch } } # end - for each object to update - + my $rsp; + if ($nodewithdomain) { + $nodewithdomain =~ s/,//; + $rsp->{data}->[0] = "The object name \'$nodewithdomain\' is invalid, Cannot use '.' in node name."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + } + if ($invalidobjname) { + $invalidobjname =~ s/,//; + $rsp->{data}->[0] = "The object name \'$invalidobjname\' is invalid, please refer to \"man xcatdb\" for the valid \"xCAT Object Name Format\""; + xCAT::MsgUtils->message("E", $rsp, $::callback); + } # # write each object into the tables in the xCAT database # From 3217230d197babb3688fef28f26135fb5e5ad1a1 Mon Sep 17 00:00:00 2001 From: yangsong Date: Mon, 26 Mar 2018 17:35:19 +0800 Subject: [PATCH 073/161] fix issue chroot, rpm -qa error: Failed to initialize NSS library #4959 (#5011) * move use_devurandom before package instllation:fix issue #4959 --- xCAT-server/share/xcat/netboot/rh/genimage | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index d78832f27..2fd822aa0 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -85,7 +85,7 @@ sub majversion { my $version = shift; my $majorrel; - if ($osver =~ /^\D*(\d*)[.\d]*$/) { + if ($osver =~ /^\D*(\d*)[.\d]*.*$/) { $majorrel = $1; } @@ -141,6 +141,9 @@ sub umount_chroot { #only remove the /dev in rootimg directory if it is not a mount point system("findmnt $rootimage_dir/dev/ >/dev/null 2>&1 || rm -rf $rootimage_dir/dev/*"); } + + #rpm complains "Failed to initialize NSS library" when /dev/urandom does not exist, leave /dev/urandom + use_devurandom(); } #check whether a dir is NFS mounted @@ -375,7 +378,6 @@ unless ($onlyinitrd) { mount_chroot($rootimg_dir); - my %pkg_hash = imgutils::get_package_names($pkglist); my $index = 1; @@ -520,7 +522,7 @@ unless ($onlyinitrd) { # Hack uname when deal otherpkgs use_hackuname($arch, $kernelver); use_devnull(); - use_devurandom(); + foreach $pass (sort { $a <=> $b } (keys(%extra_hash))) { $yumcmd = $yumcmd_base; From 961108c53b6d44ffea25e059fbc11115444a42bd Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Mon, 26 Mar 2018 17:15:40 +0800 Subject: [PATCH 074/161] updatenode MERGE mode does not support update an existing entry --- xCAT-server/share/xcat/scripts/xdcpmerge.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/xdcpmerge.sh b/xCAT-server/share/xcat/scripts/xdcpmerge.sh index 39922add6..e8445a646 100755 --- a/xCAT-server/share/xcat/scripts/xdcpmerge.sh +++ b/xCAT-server/share/xcat/scripts/xdcpmerge.sh @@ -61,8 +61,8 @@ for i in $*; do # in the merge file and create a new backup # first get a list of duplicate lines to remove # based on only username: the first field in the file - cut -d: -f1 $filebackup > $filebackup.userlist - cut -d: -f1 $mergefile > $mergefile.userlist + cut -d: -f1 $filebackup > $filebackup.userlist + cut -d: -f1 $mergefile > $mergefile.userlist comm -12 <(sort $filebackup.userlist | uniq) <(sort $mergefile.userlist | uniq) > $filebackup.remove # now if there is a remove file, use it to remove the dup lines in backup @@ -86,16 +86,15 @@ for i in $*; do userlist=$userlisttmp$listend grepcmd=$grepcmd$userlist #set -x - grepcmd="$grepcmd $mergefile > $mergefile.nodups" - #echo "grepcmd=$grepcmd" + grepcmd="$grepcmd $filebackup > $filebackup.nodups" # now run it eval $grepcmd - fi - - # add new entries from mergefile, if any - if [ -a "$mergefile.nodups" ]; then - cat $mergefile.nodups >> $curfile - rm $mergefile.nodups + #echo "grepcmd=$grepcmd" + cat $filebackup.nodups $mergefile > $curfile + #echo "$filebackup.nodups $mergefile > $curfile" + else + cat $filebackup $mergefile > $curfile + #echo "cat $filebackup $mergefile > $curfile" fi # now cleanup From 6629798889f2b7773d1dfdd4cc5d0c3cf5b8e9b4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 23 Mar 2018 15:42:05 -0400 Subject: [PATCH 075/161] Display a warning when setting NTP Server --- .../lib/python/agent/hwctl/executor/openbmc_bmcconfig.py | 4 ++++ xCAT-server/lib/xcat/plugins/openbmc.pm | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 33bb6077d..031397e4d 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -345,6 +345,10 @@ rmdir \"/tmp/$userid\" \n") if nic in netinfo: ntpservers = netinfo[nic]['ntpservers'] self.callback.info('%s: BMC NTP Servers: %s' % (node, ntpservers)) + if ntpservers != None: + # Display a warning if the host in not powered off + # Time on the BMC is not synced while the host is powered on + self.callback.info('%s: Warning: time will not be synchronized until the host is powered off.' % node) def _get_facing_nic(self, bmcip, netinfo): for k,v in netinfo.items(): diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index ce764ddb8..58d1d0695 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -3379,6 +3379,7 @@ sub rspconfig_response { my @gateway = (); my @vlan = (); my @ntpservers = (); + my $real_ntp_server = 0; my @nics = keys %nicinfo; foreach my $nic (@nics) { my $addon_info = ''; @@ -3388,6 +3389,7 @@ sub rspconfig_response { if ($nicinfo{$nic}{ntpservers}) { push @ntpservers, "BMC NTP Servers$addon_info: $nicinfo{$nic}{ntpservers}"; + $real_ntp_server = 1; } else { push @ntpservers, "BMC NTP Servers$addon_info: None"; } @@ -3410,6 +3412,11 @@ sub rspconfig_response { push @output, "BMC Hostname: $hostname"; } elsif ($opt eq "ntpservers") { push @output, @ntpservers; + if (($real_ntp_server) && ($status_info{RSPCONFIG_SET_RESPONSE}{argv} =~ "NTPServers")) { + # Display a warning if the host in not powered off + # Time on the BMC is not synced while the host is powered on. + push @output, "Warning: time will not be synchronized until the host is powered off."; + } } if ($multiple_error and ($opt =~ /^ip$|^ipsrc$|^netmask$|^gateway$|^vlan$/)) { From c82e2f854bdc04cf7128b06abcbdf0095b60f24e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 26 Mar 2018 10:27:01 -0400 Subject: [PATCH 076/161] Update index.rst update stating Python 2.x framework in documentation --- .../references/coral/cluster_mgmt/scalability/python/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/references/coral/cluster_mgmt/scalability/python/index.rst b/docs/source/references/coral/cluster_mgmt/scalability/python/index.rst index 40197bc6e..97c275cc5 100644 --- a/docs/source/references/coral/cluster_mgmt/scalability/python/index.rst +++ b/docs/source/references/coral/cluster_mgmt/scalability/python/index.rst @@ -3,7 +3,7 @@ Python framework When testing the scale up of xCAT commands against OpenBMC REST API, it was evident that the Perl framework of xCAT did not scale well and was not sending commands to the BMCs in a true parallel fashion. -The team investigated the possibility of using Python framework +The team investigated the possibility of using Python framework. This support is implemented using Python 2.x framework. .. toctree:: :maxdepth: 2 From 8f2ba278972805b291bfec2524b478fa0cbff3ec Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 22 Mar 2018 21:42:31 -0400 Subject: [PATCH 077/161] modified depending on comments --- xCAT-server/lib/xcat/plugins/ipmi.pm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index b0edfa5df..120c2830e 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2409,7 +2409,8 @@ sub rflash { } elsif ($opt !~ /.*\.hpm$/i && $opt !~ /^-V{1,4}$|^--buffersize=|^--retry=/) { # An unexpected flag was passed, but it could be a directory name. Display error only if not -d option unless ($directory_flag) { - $callback->({ error => "The option $opt is not supported or invalid update file specified", + my $node = $sessdata->{node}; + $callback->({ data => "$node: Error: The option $opt is not supported or invalid update file specified", errorcode => 1 }); return; } @@ -8275,7 +8276,7 @@ sub preprocess_request { my $error_data = ""; foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Please enter an action (eg: boot,off,on, etc) for ipmi management method"; + $error_data .= "$_: Please enter an action (eg: boot,off,on, etc) when using mgt=ipmi."; } $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; @@ -8294,7 +8295,7 @@ sub preprocess_request { my $error_data = ""; foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Error: Unsupported command: $command $subcmd for ipmi management method"; + $error_data .= "$_: Error: Unsupported command: $command $subcmd when using mgt=ipmi."; } $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; @@ -8305,7 +8306,7 @@ sub preprocess_request { my $error_data = ""; foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: IPMI plugin requires syspowermaxnodes be defined if syspowerinterval is defined"; + $error_data .= "$_: 'syspowermaxnodes` is required if 'syspowerinterval' is configured in the site table."; } $callback->({ errorcode => [1], error => [$error_data] }); $request = {}; @@ -8335,7 +8336,7 @@ sub preprocess_request { if ($optset eq 0) { foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command for ipmi management method."; + $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command when using mgt=ipmi.."; } $callback->({ errorcode => [1], data => [ $error_data] }); $request = {}; @@ -8347,7 +8348,7 @@ sub preprocess_request { if ($optset eq 1) { foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command for ipmi management method."; + $error_data .= "$_: Usage Error: Cannot display and change attributes on the same command when using mgt=ipmi."; } $callback->({ errorcode => [1], data => [ $error_data] }); $request = {}; @@ -8359,7 +8360,7 @@ sub preprocess_request { unless ($option =~ /^USERID$|^ip$|^netmask$|^gateway$|^vlan$|^userid$|^username$|^password$|^snmpdest|^thermprofile$|^alert$|^garp$|^community$|^backupgateway$/) { foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: Error: Unsupported command: $command $option for ipmi management method"; + $error_data .= "$_: Error: Unsupported command: $command $option when using mgt=ipmi."; } $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; @@ -8374,7 +8375,7 @@ sub preprocess_request { my $error_data = ""; foreach (@$all_noderange) { $error_data .= "\n" if ($error_data); - $error_data .= "$_: option '-t' can only work with 'all' or 'vpd' for ipmi management method"; + $error_data .= "$_: option '-t' can only work with 'all' or 'vpd' when using mgt=ipmi."; } $callback->({ errorcode => [1], data => [ $error_data ] }); $request = {}; From 5aa24911f46570b16e4ecfa40e533afdcf89c9d6 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Mon, 26 Mar 2018 22:09:18 -0400 Subject: [PATCH 078/161] add information to check the version --- xCAT-test/autotest/testcase/go-xcat/case1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xCAT-test/autotest/testcase/go-xcat/case1 b/xCAT-test/autotest/testcase/go-xcat/case1 index bb936f73a..24db15efc 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case1 +++ b/xCAT-test/autotest/testcase/go-xcat/case1 @@ -54,6 +54,13 @@ cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN " check:rc==0 cmd:cat /tmp/go-xcat.log cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:rc==0 +cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;cd /;if grep Ubuntu /etc/*release;then cd / ; wget http://xcat.org/files/xcat/repos/apt/$migration_version/xcat-core/buildinfo;else cd / ; wget http://xcat.org/files/xcat/repos/yum/$migration_version/xcat-core/buildinfo; fi +cmd:xdsh $$CN "lsxcatd -v" |tee /tmp/version +cmd:if [ -e /buildinfo ]; then xcatversion=`grep VERSION /buildinfo |awk -F'=' '{print $2}'`;grep $xcatversion /tmp/version; fi +check:rc==0 +cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;grep $migration_version /tmp/version +check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -63,6 +70,8 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi check:rc!=0 cmd:xdsh $$CN "cd /; rm -rf /go-xcat" +cmd:rm -rf /tmp/version +cmd:rm -rf /buildinfo end start:go_xcat_with_xcat-version-1 @@ -122,6 +131,12 @@ check:rc==0 cmd:cat /tmp/go-xcat.log cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 +cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;cd /;if grep Ubuntu /etc/*release;then cd / ; wget http://xcat.org/files/xcat/repos/apt/$migration_version/xcat-core/buildinfo;else cd / ; wget http://xcat.org/files/xcat/repos/yum/$migration_version/xcat-core/buildinfo; fi +cmd:xdsh $$CN "lsxcatd -v" |tee /tmp/version +cmd:if [ -e /buildinfo ]; then xcatversion=`grep VERSION /buildinfo |awk -F'=' '{print $2}'`;grep $xcatversion /tmp/version; fi +check:rc==0 +cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;grep $migration_version /tmp/version +check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -131,4 +146,6 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi check:rc!=0 cmd:xdsh $$CN "cd /; rm -rf /go-xcat" +cmd:rm -rf /tmp/version +cmd:rm -rf /buildinfo end From b744927045007510942db3c8cb2dc18aaf34bf32 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 27 Mar 2018 00:03:06 -0400 Subject: [PATCH 079/161] fix issue 4983, get autoreboot info --- .../agent/hwctl/executor/openbmc_bmcconfig.py | 4 +++- .../lib/python/agent/hwctl/openbmc_client.py | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 031397e4d..104a3bd2f 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -401,8 +401,10 @@ rmdir \"/tmp/$userid\" \n") if isinstance(value, dict): str_value = value.values()[0] + elif value: + str_value = str(value) else: - str_value = value + str_value = '0' result = '%s: %s: %s' % (node, openbmc.RSPCONFIG_APIS[key]['display_name'], str_value.split('.')[-1]) self.callback.info(result) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 5bdf8c678..e75caa20c 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -183,7 +183,7 @@ RSPCONFIG_APIS = { 'autoreboot' : { 'baseurl': "/control/host0/auto_reboot/", 'set_url': "attr/AutoReboot", - 'get_url': "attr/AutoReboot", + 'get_url': "", 'display_name': "BMC AutoReboot", 'attr_values': { '0': False, @@ -203,9 +203,9 @@ RSPCONFIG_APIS = { }, }, 'powerrestorepolicy': { - 'baseurl': "/control/host0/power_restore_policy/", - 'set_url': "attr/PowerRestorePolicy", - 'get_url': "attr/PowerRestorePolicy", + 'baseurl': "/control/host0/power_restore_policy", + 'set_url': "/attr/PowerRestorePolicy", + 'get_url': "", 'display_name': "BMC PowerRestorePolicy", 'attr_values': { 'restore': "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.Restore", @@ -214,9 +214,9 @@ RSPCONFIG_APIS = { }, }, 'bootmode': { - 'baseurl': "/control/host0/boot/", - 'set_url': "attr/BootMode", - 'get_url': "attr/BootMode", + 'baseurl': "/control/host0/boot", + 'set_url': "/attr/BootMode", + 'get_url': "", 'display_name':"BMC BootMode", 'attr_values': { 'regular': "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular", From 6d8081142bb1026fe0580ca07643a9efe939cb00 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Tue, 27 Mar 2018 14:04:51 +0800 Subject: [PATCH 080/161] workaround ($4929) the MsgUtil.pm first to make sure xcatd will not crash when /dev/log is not ready. (#4974) --- perl-xCAT/xCAT/MsgUtils.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/MsgUtils.pm b/perl-xCAT/xCAT/MsgUtils.pm index 18a5f7f3b..4e3bf292c 100644 --- a/perl-xCAT/xCAT/MsgUtils.pm +++ b/perl-xCAT/xCAT/MsgUtils.pm @@ -486,7 +486,8 @@ sub message if ($errstr) { print $stdouterrf - "Unable to log $rsp to syslog because of $errstr\n"; + "Error: Unable to log to syslog: $errstr\n"; + print "$rsp\n"; } } @@ -896,9 +897,6 @@ sub trace() { if (($level eq "I") || ($level eq "i")) { $prefix = "INFO"; } if (($level eq "D") || ($level eq "d")) { $prefix = "DEBUG"; } - my @tmp = xCAT::TableUtils->get_site_attribute("xcatdebugmode"); - my $xcatdebugmode = $tmp[0]; - if (($level eq "E") || ($level eq "e") || ($level eq "I") @@ -911,8 +909,15 @@ sub trace() { syslog("$prefix", $msg); closelog(); }; + if ($@) { + print "Error: Unable to log to syslog: $@\n"; + print "$msg\n"; + } + return; } + my @tmp = xCAT::TableUtils->get_site_attribute("xcatdebugmode"); + my $xcatdebugmode = $tmp[0]; if (($level eq "D") || ($level eq "d")) { if (($verbose == 1) || ($xcatdebugmode eq "1") || ($xcatdebugmode eq "2")) { @@ -921,6 +926,10 @@ sub trace() { openlog("xcat", "nofatal,pid", "local4"); syslog("$prefix", $msg); closelog(); + }; + if ($@) { + print "Error: Unable to log to syslog: $@\n"; + print "$msg\n"; } } } From d6a45d9398c61a7ffd3c50cbe0d258857c097070 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Tue, 27 Mar 2018 16:32:01 +0800 Subject: [PATCH 081/161] (#4973) add journal logs in xcatsnap for xcatd --- xCAT-server/sbin/xcatsnap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatsnap b/xCAT-server/sbin/xcatsnap index ea5c7871e..93a316bdd 100755 --- a/xCAT-server/sbin/xcatsnap +++ b/xCAT-server/sbin/xcatsnap @@ -239,7 +239,7 @@ sub snap_it { "ls $installdir", "/usr/bin/crontab -l", "find /tftpboot -size -32k", "ls -lR $xcatroot", "arp -a", "ps -edlf", "ps -aux", "ulimit -a", "df -k", -"cat /etc/issue", "lsxcatd -a", "cat /proc/meminfo", "cat /proc/cpuinfo"); +"cat /etc/issue", "lsxcatd -a", "cat /proc/meminfo", "cat /proc/cpuinfo", "journalctl -b --no-pager -u xcatd"); } foreach my $item (@Commands_array) { $Command = $item; From cb4edc2bc10780989f3b2368cfc4da4a685d7597 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Tue, 27 Mar 2018 17:02:38 +0800 Subject: [PATCH 082/161] Fix the issue 'install monitor' exit unexpected and SSL CPU 100% (#4582, #4496) (#5005) * Fix the issue 'install monitor' exit unexpected (#4582). - add eval block to cover all possible codes which might die in do_installm_service - add more logs in install monitor to record useful inforamtion - add sleep 0.01 to avoid CPU too high - fix the wrong timeout usage (alarm - die) - recover the default INT/TERM singal handler to avoid UDP listener will quick when kill 'install monitor' * Avoid SSL CPU 100% when hit max open file number --- xCAT-server/sbin/xcatd | 167 ++++++++++++++++++++++++----------------- 1 file changed, 98 insertions(+), 69 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index b6b793eb6..88e9032ff 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -332,6 +332,7 @@ sub do_installm_service { my $socket; my $installpidfile; my $retry = 1; + $SIG{TERM} = $SIG{INT} = 'DEFAULT'; $SIG{USR2} = sub { if ($socket) { # do not mess with pid file except when we still have the socket. unlink("/var/run/xcat/installservice.pid"); close($socket); $quit = 1; @@ -385,80 +386,91 @@ sub do_installm_service { open($installpidfile, ">", "/var/run/xcat/installservice.pid"); # if here, everyone else has unlinked installservicepid or doesn't care print $installpidfile $$; close($installpidfile); + xCAT::MsgUtils->trace(0, "I", "xcatd: install monitor process $$ start"); until ($quit) { - $SIG{ALRM} = sub { xCAT::MsgUtils->message("S", "XCATTIMEOUT"); die; }; + $SIG{ALRM} = sub { die "XCATTIMEOUT"; }; my $conn; - next unless $conn = $socket->accept; + my $conn_peer_addr; + my $node; + my $validclient = 0; - # check if a rescanplugins request has come in - my @rescans; - if (@rescans = $rescanrselect->can_read(0)) { - foreach my $rrequest (@rescans) { - my $rescan_request = fd_retrieve($rrequest); - if ($$rescan_request =~ /rescanplugins/) { - scan_plugins('', '1'); - } else { - print "ignoring unrecognized pipe request received by install monitor from ssl listener: $rescan_request \n"; + next unless $conn = $socket->accept; + eval { + # check if a rescanplugins request has come in + my @rescans; + if (@rescans = $rescanrselect->can_read(0)) { + foreach my $rrequest (@rescans) { + my $rescan_request = fd_retrieve($rrequest); + if ($$rescan_request =~ /rescanplugins/) { + scan_plugins('', '1'); + } else { + xCAT::MsgUtils->trace(0, "W", "xcatd: ignoring unrecognized pipe request received by install monitor from ssl listener: $rescan_request."); + } } } - } - my $conn_peer_addr = $conn->peerhost(); - xCAT::MsgUtils->trace(0, "I", "xcatd received a connection request from $conn_peer_addr"); + $conn_peer_addr = $conn->peerhost(); + xCAT::MsgUtils->trace(0, "I", "xcatd: received a connection request from $conn_peer_addr"); - my $client_name; - my $client_aliases; - my @clients; - if ($inet6support) { - ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET6); - unless ($client_name) { ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET); } - } else { - ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET); - } - - unless ($client_name) { - my $addrfamily=sockaddr_family(getpeername($conn)); - my $myaddr=Socket::inet_ntop($addrfamily,$conn->peeraddr); - xCAT::MsgUtils->message("SE", "xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored"); - #print "xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored\n"; - close($conn); - next; - } - - $clients[0] = $client_name; - if ($client_aliases) { - push @clients, split(/\s+/, $client_aliases); - } - - my $validclient = 0; - my $node; - my $domain; - - foreach my $client (@clients) { - my @ndn = ($client); - my $nd = xCAT::NetworkUtils->getNodeDomains(\@ndn); - my %nodedomains = %{$nd}; - $domain = $nodedomains{$client}; - $client =~ s/\..*//; - if ($domain) { - $client =~ s/\.$domain//; + my $client_name; + my $client_aliases; + my @clients; + if ($inet6support) { + ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET6); + unless ($client_name) { + ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET); + } } else { + ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET); + } + + unless ($client_name) { + die "XCATUNKOWNCLIENT"; # use die instead of next to avoid 'Exiting eval via next' message + } + + $clients[0] = $client_name; + if ($client_aliases) { + push @clients, split(/\s+/, $client_aliases); + } + + my $domain; + my %handled_client=(); + foreach my $client (@clients) { + next if (exists $handled_client{$client}); + $handled_client{$client}=1; + my @ndn = ($client); + my $nd = xCAT::NetworkUtils->getNodeDomains(\@ndn); + my %nodedomains = %{$nd}; + $domain = $nodedomains{$client}; $client =~ s/\..*//; - } + if ($domain) { + $client =~ s/\.$domain//; + } else { + $client =~ s/\..*//; + } - # ensure this is coming from a node IP at least - ($node) = noderange($client); - if ($node) { # Means the source isn't valid - $validclient = 1; - last; + # ensure this is coming from a node IP at least + ($node) = noderange($client); + if ($node) { # Means the source isn't valid + #$validclient = 1; + xCAT::MsgUtils->trace(0, "I", "xcatd: $conn_peer_addr is matched with node $node"); + last; + } + } + unless ($node) { + xCAT::MsgUtils->trace(0, "E", "xcatd: received a connection request from $conn_peer_addr($client_name), which can not be found in xCAT nodelist table. The connection request will be ignored"); + } + }; + if ($@) { + $node = undef; + if ($@ =~ /XCATUNKOWNCLIENT/) { + xCAT::MsgUtils->trace(0, "E", "xcatd: received a connection request from unknown host with ip address $conn_peer_addr, please check whether the reverse name resolution works correctly. The connection request will be ignored"); } else { - xCAT::MsgUtils->message("SE", "xcatd received a connection request from $client, which can not be found in xCAT nodelist table. The connection request will be ignored"); - #print "xcatd received a connection request from $client, which can not be found in xCAT nodelist table. The connection request will be ignored\n"; + xCAT::MsgUtils->trace(0, "E", "xcatd: possible BUG encountered by xCAT install monitor service: " . $@); } - } - - unless ($validclient) { + unless ($node) { close($conn); + sleep 0.01; next; } my $tftpdir = xCAT::TableUtils->getTftpDir(); @@ -481,7 +493,6 @@ sub do_installm_service { #unless ($pid) { # fork off the nodeset and potential slowness xCAT::MsgUtils->trace(0, "I", "xcatd: triggering \'nodeset $node next\'..."); plugin_command(\%request, undef, \&build_response); - #exit(0); #} close($conn); @@ -494,7 +505,7 @@ sub do_installm_service { node => [$node], arg => ["$newstat"], ); - + xCAT::MsgUtils->trace(0, "I", "xcatd: triggering \'updatenodestat $node $newstat\'..."); # node should be blocked, race condition may occur otherwise #my $pid=xCAT::Utils->xfork(); #unless ($pid) { # fork off the nodeset and potential slowness @@ -505,14 +516,17 @@ sub do_installm_service { } close($conn); } elsif ($text =~ /^unlocktftpdir/) { # TODO: only nodes in install state should be allowed + xCAT::MsgUtils->trace(0, "I", "xcatd: unlock tftpdir for $node..."); mkpath("$tftpdir/xcat/$node"); chmod 01777, "$tftpdir/xcat/$node"; chmod 0666, glob("$tftpdir/xcat/$node/*"); close($conn); } elsif ($text =~ /locktftpdir/) { + xCAT::MsgUtils->trace(0, "I", "xcatd: lock tftpdir for $node..."); chmod 0755, "$tftpdir/xcat/$node"; chmod 0644, glob("$tftpdir/xcat/$node/*"); } elsif ($text =~ /^getpostscript/) { + xCAT::MsgUtils->trace(0, "I", "xcatd: handle getpostscript requesting from $node..."); my $reply = plugin_command({ command => ['getpostscript'], _xcat_clienthost => [$node] }, undef, \&build_response); foreach (@{ $reply->{data} }) { print $conn $_; @@ -520,10 +534,12 @@ sub do_installm_service { print $conn "#END OF SCRIPT\n"; close($conn); } elsif ($text =~ /^syncfiles/) { + xCAT::MsgUtils->trace(0, "I", "xcatd: handle syncfiles requesting from $node..."); plugin_command({ command => ['syncfiles'], _xcat_clienthost => [$node] }, undef, \&build_response); print $conn "syncfiles done\n"; close($conn); } elsif ($text =~ /^setiscsiparms/) { + xCAT::MsgUtils->trace(0, "I", "xcatd: handle setiscsiparms requesting from $node..."); $text =~ s/^setiscsiparms\s+//; my $kname; my $iname; @@ -559,31 +575,40 @@ sub do_installm_service { arg => ["$text"], ); + xCAT::MsgUtils->trace(0, "I", "xcatd: triggering \'updatenodeappstat $node $text\'..."); plugin_command(\%request, undef, \&build_response); close($conn); } elsif ($text =~ /basecustremv/) { - $text =~ s/basecustremv //; chomp $text; + xCAT::MsgUtils->trace(0, "I", "xcatd: handle basecustremv requesting for $text..."); # remove the BASECUST_REMOVAL line from /tftpboot/hostname.info file my $myfile = "/tftpboot/$text" . ".info"; `/usr/bin/cat $myfile | /usr/bin/sed "/BASECUST_REMOVAL/d">/tmp/$text.nimtmp`; `/usr/bin/mv /tmp/$text.nimtmp $myfile`; close($conn); + } else { + sleep 0.01; + chomp $text; + xCAT::MsgUtils->trace(0, "E", "xcatd: install monitor does not support \'$text\', the connection request from $conn_peer_addr will be ignored."); + close($conn); #close it to avoid the DDOS attack + next; } + xCAT::MsgUtils->trace(0, "I", "xcatd: finish a connection request for $node from $conn_peer_addr"); alarm(2); } alarm(0); }; if ($@) { if ($@ =~ /XCATTIMEOUT/) { - xCAT::MsgUtils->message("S", "xcatd: install monitor timed out talking to $node"); + xCAT::MsgUtils->trace(0, "W", "xcatd: install monitor timed out talking to $node($conn_peer_addr)"); } else { - xCAT::MsgUtils->message("S", "xcatd: possible BUG encountered by xCAT install monitor service: " . $@); + xCAT::MsgUtils->trace(0, "E", "xcatd: possible BUG encountered by xCAT install monitor service: " . $@); close($conn); } } + } if (open($installpidfile, "<", "/var/run/xcat/installservice.pid")) { my $pid = <$installpidfile>; @@ -634,6 +659,7 @@ sub do_discovery_process { populate_vpd_hash(); populate_mp_hash(); + xCAT::MsgUtils->trace(0, "I", "xcatd: Discovery worker process $$ start"); while (not $quit) { my $msg = fd_retrieve($broker); if ((time() - $vintage) > 15) { @@ -745,6 +771,8 @@ sub do_udp_service { # This function opens up a UDP port open($udppidfile, ">", "/var/run/xcat/udpservice.pid"); # if here, everyone else has unlinked udpservicepid or doesn't care print $udppidfile $$; close($udppidfile); + xCAT::MsgUtils->trace(0, "I", "xcatd: UDP listener process $$ start"); + $select->add($socket); $udpcontext->{socket} = $socket; $select->add($sslctl); @@ -945,7 +973,8 @@ unless (xCAT::Utils->isLinux()) { # messes up the output of the service cmd on l }; } if ($@) { - print "ERROR: $@"; + #print "ERROR: $@"; + xCAT::MsgUtils->trace(0, "E", "xcatd: possible BUG encountered: " . $@); xexit; } unless ($foreground) { @@ -1229,7 +1258,7 @@ unless ($cmdlog_svrpid) { open($cmdlogpidfile, ">$cmdlogservicefile"); print $cmdlogpidfile $$; close($cmdlogpidfile); - xCAT::MsgUtils->trace(0, "I", "xcatd: command log process $$ start"); + xCAT::MsgUtils->trace(0, "I", "xcatd: Command log writer process $$ start"); my $cmdlog_logfile_path = dirname($cmdlog_logfile); mkpath("$cmdlog_logfile_path") unless (-d "$cmdlog_logfile_path"); @@ -1411,7 +1440,7 @@ until ($quit) { if (@pendingconnections) { while ($listenwatcher->can_read(0)) { # grab everything we can, but don't spend any time waiting for more $tconn = $listener->accept; - unless ($tconn) { next; } + unless ($tconn) { sleep 0.01; next; } # increase max open file number might cause dead-loop here, sleep for a while push @pendingconnections, $tconn; } } else { From 2ac315cbe23e2127d8c453c74fe19ffbbb18017c Mon Sep 17 00:00:00 2001 From: chenglch Date: Tue, 27 Mar 2018 12:02:20 +0800 Subject: [PATCH 083/161] Add default logrotate configuration for gocons Add logrotate conf for the console log files and log of goconserver. --- xCAT-server/debian/dirs | 1 + xCAT-server/debian/install | 1 + xCAT-server/debian/rules | 1 + xCAT-server/lib/xcat/plugins/goconserver.pm | 4 ++++ xCAT-server/share/xcat/conf/goconslogrotate | 9 +++++++++ xCAT-server/xCAT-server.spec | 2 ++ 6 files changed, 18 insertions(+) create mode 100644 xCAT-server/share/xcat/conf/goconslogrotate diff --git a/xCAT-server/debian/dirs b/xCAT-server/debian/dirs index 04341946a..16b86efce 100644 --- a/xCAT-server/debian/dirs +++ b/xCAT-server/debian/dirs @@ -8,6 +8,7 @@ opt/xcat/share/xcat/netboot opt/xcat/share/xcat/templates opt/xcat/share/xcat/ca opt/xcat/share/xcat/scripts +opt/xcat/share/xcat/conf opt/xcat/share/xcat/tools opt/xcat/share/xcat/rollupdate opt/xcat/share/xcat/installp_bundles diff --git a/xCAT-server/debian/install b/xCAT-server/debian/install index ec21c731e..12d7fffa8 100644 --- a/xCAT-server/debian/install +++ b/xCAT-server/debian/install @@ -6,6 +6,7 @@ share/xcat/mypostscript/* opt/xcat/share/xcat/mypostscript/ share/xcat/ca/* opt/xcat/share/xcat/ca share/xcat/scripts/* opt/xcat/share/xcat/scripts +share/xcat/conf/* opt/xcat/share/xcat/conf share/xcat/tools/* opt/xcat/share/xcat/tools share/xcat/rollupdate/* opt/xcat/share/xcat/rollupdate share/xcat/installp_bundles/* opt/xcat/share/xcat/installp_bundles diff --git a/xCAT-server/debian/rules b/xCAT-server/debian/rules index 72d780fc1..e9d3948ba 100755 --- a/xCAT-server/debian/rules +++ b/xCAT-server/debian/rules @@ -47,6 +47,7 @@ binary-arch: chmod 755 $(rootdir)/bin/* chmod 755 $(rootdir)/sbin/* chmod 644 $(rootdir)/share/xcat/ca/* + chmod 644 $(rootdir)/share/xcat/conf/* chmod 755 $(rootdir)/share/xcat/cons/* chmod 755 $(rootdir)/share/xcat/ib/* chmod 755 $(rootdir)/share/xcat/ib/netboot/sles/* diff --git a/xCAT-server/lib/xcat/plugins/goconserver.pm b/xCAT-server/lib/xcat/plugins/goconserver.pm index 52325db86..226d819f9 100644 --- a/xCAT-server/lib/xcat/plugins/goconserver.pm +++ b/xCAT-server/lib/xcat/plugins/goconserver.pm @@ -6,6 +6,7 @@ BEGIN { } use lib "$::XCATROOT/lib/perl"; use strict; +use File::Copy; use xCAT::Table; use xCAT::Utils; use xCAT::TableUtils; @@ -165,6 +166,9 @@ sub start_goconserver { xCAT::MsgUtils->error_message("Failed to create configuration file for goconserver.", $::callback); return 1; } + if (!copy($::XCATROOT."/share/xcat/conf/goconslogrotate", "/etc/logrotate.d/goconserver")) { + xCAT::MsgUtils->warn_message("Failed to create logrotate configuration for goconserver.", $::callback); + } } $ret = xCAT::Goconserver::restart_service(); if ($ret) { diff --git a/xCAT-server/share/xcat/conf/goconslogrotate b/xCAT-server/share/xcat/conf/goconslogrotate new file mode 100644 index 000000000..afcbd7fe7 --- /dev/null +++ b/xCAT-server/share/xcat/conf/goconslogrotate @@ -0,0 +1,9 @@ +/var/log/consoles/*.log +/var/log/goconserver/server.log +{ + missingok + sharedscripts + postrotate + kill -HUP `systemctl show -p MainPID goconserver.service 2> /dev/null |awk -F= '{print $2}'` 2> /dev/null || true + endscript +} \ No newline at end of file diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 4f9c35be3..fd2ebd942 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -100,6 +100,7 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/cons +mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/conf mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/rollupdate mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/installp_bundles mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/image_data @@ -145,6 +146,7 @@ chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/ca/* cp share/xcat/mypostscript/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/mypostscript cp share/xcat/scripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts +cp share/xcat/conf/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/conf cp share/xcat/samples/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples cp -r share/xcat/tools/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools cp -r share/xcat/hamn/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/hamn From 372756a6adc5838668e5dff916dd4b490b4c0cc0 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Tue, 27 Mar 2018 15:12:21 +0800 Subject: [PATCH 084/161] (#4913) clear cache before run 'nodeset <> next' to avoid using the old IP address after IP address is modified. --- xCAT-server/sbin/xcatd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index b6b793eb6..9d5c6cbbc 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -469,6 +469,8 @@ sub do_installm_service { alarm(0); print $conn "done\n"; $text =~ s/\r//g; + # Clear IP-Name cache, Workaround (#4913) for IP changed cases. + xCAT::NetworkUtils->clearcache(); if ($text =~ /next/) { my %request = ( command => ['nodeset'], From eb72bdf84f5a6da3e9836bb0f143e644b2c52bf0 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 27 Mar 2018 22:05:44 -0400 Subject: [PATCH 085/161] modify login error msg for openbmc python --- .../lib/python/agent/hwctl/executor/openbmc_power.py | 7 +------ xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 7 +++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index ecdf683b5..819fbc887 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -51,12 +51,7 @@ class OpenBMCPowerTask(ParallelNodesCommand): bmc_not_ready = bmc_state = 'NotReady' try: obmc.login() - except SelfServerException as e: - # Special exception handling for login failure - login_message = "Login to BMC failed: Can't connect to {0} {1}.".format(e.host_and_port, e.detail_msg) - self.callback.error(login_message, node) - return bmc_state - except SelfClientException as e: + except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) return bmc_state diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index e75caa20c..0e6375d68 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -335,8 +335,11 @@ class OpenBMCRest(object): response = self.session.request(method, url, httpheaders, data=data, timeout=timeout) return self.handle_response(response, cmd=cmd) except SelfServerException as e: - e.message = 'BMC did not respond. ' \ - 'Validate BMC configuration and retry the command.' + if cmd == 'login': + e.message = "Login to BMC failed: Can't connect to {0} {1}.".format(e.host_and_port, e.detail_msg) + else: + e.message = 'BMC did not respond. ' \ + 'Validate BMC configuration and retry the command.' self._print_error_log(e.message, cmd) raise except ValueError: From 58f0999d6d5c2bbe7675f39415b75bd0b3d845f0 Mon Sep 17 00:00:00 2001 From: chenglch Date: Wed, 28 Mar 2018 13:44:08 +0800 Subject: [PATCH 086/161] Modify doc to enable goconserver by defanlt on service node Add description for `setupconserver` attribute. --- docs/source/advanced/hierarchy/define_service_nodes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/advanced/hierarchy/define_service_nodes.rst b/docs/source/advanced/hierarchy/define_service_nodes.rst index d35427e73..63137f989 100644 --- a/docs/source/advanced/hierarchy/define_service_nodes.rst +++ b/docs/source/advanced/hierarchy/define_service_nodes.rst @@ -55,12 +55,13 @@ The following table illustrates the cluster being used in this example: setupdhcp=1 \ setuptftp=1 \ setupnameserver=1 \ - setupconserver=1 + setupconserver=2 **Tips/Hint** * Even if you do not want xCAT to configure any services, you must define the service nodes in the ``servicenode`` table with at least one attribute, set to 0, otherwise xCAT will not recognize the node as a service node * See the ``setup*`` attributes in the node definition man page for the list of available services: ``man node`` * For clusters with subnetted management networks, you might want to set ``setupupforward=1`` + * For the ``setupconserver`` attribute, if ``conserver`` is used, set to ``1``, if ``goconserver`` is used, set to ``2`` #. Add additional postscripts for Service Nodes (optional) From 46c611f11a3f7bc38b7704a3361ad2284bfcc093 Mon Sep 17 00:00:00 2001 From: chenglch Date: Wed, 28 Mar 2018 15:09:06 +0800 Subject: [PATCH 087/161] Check if cons script is excutable before register into console server This patch check the script file, if it is not excutable, just print ignore message. --- xCAT-server/lib/perl/xCAT/Goconserver.pm | 9 +++++++++ xCAT-server/lib/xcat/plugins/conserver.pm | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index 516433d5f..9417cad58 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -192,6 +192,10 @@ sub init_local_console { unless ($_->{cons}) { $_->{cons} = $_->{mgt}; } + if ( $_->{cons} ne 'openbmc' && ! -x $::XCATROOT . "/share/xcat/cons/".$_->{cons}) { + xCAT::MsgUtils->message("S", $_->{node} .": ignore, ". $::XCATROOT . "/share/xcat/cons/".$_->{cons}." is not excutable. Please check mgt or cons attribute."); + next; + } if ($_->{conserver} && exists($iphash{ $_->{conserver} })) { $cons_map{ $_->{node} } = $_; } @@ -406,6 +410,11 @@ sub get_cons_map { if ($_->{cons} or defined($_->{'serialport'})) { unless ($_->{cons}) { $_->{cons} = $_->{mgt}; } #populate with fallback if ($isSN && $_->{conserver} && exists($iphash{ $_->{conserver} }) || !$isSN) { + if ( $_->{cons} ne 'openbmc' && ! -x $::XCATROOT . "/share/xcat/cons/".$_->{cons}) { + $rsp->{data}->[0] = $_->{node} .": ignore, ". $::XCATROOT . "/share/xcat/cons/".$_->{cons}." is not excutable. Please check mgt or cons attribute."; + xCAT::MsgUtils->message("I", $rsp, $::callback); + next; + } $cons_map{ $_->{node} } = $_; # also put the ref to the entry in a hash for quick look up } else { $rsp->{data}->[0] = $_->{node} .": ignore, the host for conserver could not be determined."; diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 08f6e714c..aa4fc1d59 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -201,6 +201,7 @@ sub preprocess_request { sub process_request { my $req = shift; my $cb = shift; + $::callback = $cb; if ($req->{command}->[0] eq "makeconservercf") { if (-x "/usr/bin/goconserver") { require xCAT::Goconserver; @@ -603,6 +604,10 @@ sub donodeent { # either there is no console method (shouldnt happen) or not one of the supported terminal servers return $node; } + if (!grep(/^$cmeth$/, @cservers) && ! -x $::XCATROOT . "/share/xcat/cons/" . $cmeth) { + xCAT::SvrUtils::sendmsg([ 0, "ignore, ". $::XCATROOT . "/share/xcat/cons/$cmeth is not excutable. Please check mgt or cons attribute." ], $::callback, $node); + next; + } push @$content, "#xCAT BEGIN $node CONS\n"; push @$content, "console $node {\n"; if (grep(/^$cmeth$/, @cservers)) { From 33de7af1b00568fc8023c46fd1e64f2d6ffa402c Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 28 Mar 2018 04:04:04 -0400 Subject: [PATCH 088/161] enhanced based on new interface --- .../testcase/xcat-inventory/cases.network | 40 +++++++++++++------ .../testcase/xcat-inventory/cases.passwd | 7 ++++ .../testcase/xcat-inventory/cases.route | 6 +++ 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.network b/xCAT-test/autotest/testcase/xcat-inventory/cases.network index c923f33ca..6453ceb68 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.network +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.network @@ -4,32 +4,46 @@ cmd:lsdef -t network -o autotestnet > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsd check:rc==0 cmd:mkdir -p /tmp/xcat_inventory_import_validation_network_bak check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "200.0.0.0" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "basic_attr.net" "200.0.0.0" "/tmp/xcat_inventory_import_validation_network" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "234abc" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "basic_attr.net" "234abc" "/tmp/xcat_inventory_import_validation_network" check:rc!=0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "basic_attr.net" "" "/tmp/xcat_inventory_import_validation_network" check:rc!=0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "basic_attr.net" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network" check:rc!=0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "basic_attr.mask" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network" check:rc!=0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "basic_attr.mask" "" "/tmp/xcat_inventory_import_validation_network" check:rc!=0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "234.0.0.0" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "basic_attr.mask" "234.0.0.0" "/tmp/xcat_inventory_import_validation_network" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "pool.dynamicrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "pool.dynamicrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "pool.dynamicrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network" check:rc!=0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "pool.staticrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "pool.staticrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network" + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "pool.staticrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network" check:rc!=0 + cmd:if [[ -e /tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza ]]; then cat /tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza | mkdef -z; fi check:rc==0 cmd:rm -rf /tmp/xcat_inventory_import_validation_network_bak diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.passwd b/xCAT-test/autotest/testcase/xcat-inventory/cases.passwd index ec1be08de..5ea837961 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.passwd +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.passwd @@ -4,18 +4,25 @@ cmd:tabdump -w 'key==autotest' passwd |grep autotest > /dev/null 2>&1;if [[ $? - check:rc==0 cmd:mkdir -p /tmp/xcat_inventory_import_validation_passwd_bak check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "" "/tmp/xcat_inventory_import_validation_passwd" check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "md5" "/tmp/xcat_inventory_import_validation_passwd" check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "sha256" "/tmp/xcat_inventory_import_validation_passwd" check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "sha512" "/tmp/xcat_inventory_import_validation_passwd" check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "a.a" "/tmp/xcat_inventory_import_validation_passwd" check:rc!=0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "MD5" "/tmp/xcat_inventory_import_validation_passwd" check:rc!=0 + cmd:if [[ -e /tmp/xcat_inventory_import_validation_passwd_bak/autotest ]]; then xcat-inventory import -f /tmp/xcat_inventory_import_validation_passwd_bak/autotest; fi check:rc==0 cmd:rm -rf /tmp/xcat_inventory_import_validation_passwd_bak diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.route b/xCAT-test/autotest/testcase/xcat-inventory/cases.route index d31451aa4..4c90f703e 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.route +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.route @@ -4,16 +4,22 @@ cmd:mkdir -p /tmp/xcat_inventory_import_validation_route_bak check:rc==0 cmd:lsdef -t route -o autotestnet > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t route -o autotestnet -z >/tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza ;rmdef -t route -o autotestnet;fi check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "200.0.0.0" "/tmp/xcat_inventory_import_validation_route" check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "200.0" "/tmp/xcat_inventory_import_validation_route" check:rc!=0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "" "/tmp/xcat_inventory_import_validation_route" check:rc!=0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "default" "/tmp/xcat_inventory_import_validation_route" check:rc==0 + cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "abc.345.123.202" "/tmp/xcat_inventory_import_validation_route" check:rc!=0 + cmd:if [[ -e /tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza ]]; then cat /tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza | mkdef -z;fi check:rc==0 cmd:rm -rf /tmp/xcat_inventory_import_validation_route_bak From 5e5dbf886ff9ddfc35c2c01e8504047a2ac78cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Wed, 28 Mar 2018 16:19:08 +0800 Subject: [PATCH 089/161] Avoid log compute node logs to other log files (#4995) --- xCAT/etc/rsyslog.d/xcat-compute.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT/etc/rsyslog.d/xcat-compute.conf b/xCAT/etc/rsyslog.d/xcat-compute.conf index 527360171..fa5eaa0f6 100644 --- a/xCAT/etc/rsyslog.d/xcat-compute.conf +++ b/xCAT/etc/rsyslog.d/xcat-compute.conf @@ -1,2 +1,3 @@ $template xCATTraditionalFormat9,"%timegenerated% %HOSTNAME% %syslogtag% %msg:::drop-last-lf%\n" :fromhost-ip, !isequal, "127.0.0.1" /var/log/xcat/computes.log;xCATTraditionalFormat9 +& ~ From 4507a038ba2bb1fa494ff2927f0a58cd4cd5d2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Wed, 28 Mar 2018 17:47:44 +0800 Subject: [PATCH 090/161] Accumulated go-xcat updates (#4991) * Fix vim modelines * [go-xcat] Fix --long-help * [go-xcat] Add curl support * [go-xcat] Better tarball support * [go-xcat] Explaination of --xcat-version argument in help message * [go-xcat] Disable xCAT-core.repo and xCAT-dep.repo if they exist * [go-xcat] Add change logs --- xCAT-server/share/xcat/tools/go-xcat | 190 +++++++++++++++++++++++---- 1 file changed, 162 insertions(+), 28 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 41472163c..4ae3f65cc 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,18 +2,22 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.21 +# Version 1.0.27 # -# Copyright (C) 2016 International Business Machines +# Copyright (C) 2016, 2017, 2018 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) # # # 2016-06-16 GONG Jie -# - created +# - Draft # 2016-06-20 GONG Jie -# - released to the field +# - Released to the field # 2016-09-20 GONG Jie -# - bug fix +# - Bug fix +# 2018-03-28 GONG Jie +# - Use curl when it is available. Otherwise fall back to use wget +# - Improved tarball file extension handling +# - Disable xCAT-core.repo and xCAT-dep.repo if they exist # function usage() @@ -34,8 +38,11 @@ function usage() repository --xcat-dep=[URL] use a different URL or path for the xcat-dep repository - -x, --xcat-version=[VERSION] specify the version of xCAT; cannot use with - --xcat-core + -x, --xcat-version=[VERSION] specify the version of xCAT; imply the subdirectory + of corresponding xCAT version under + http://xcat.org/files/xcat/repos/yum/ or + http://xcat.org/files/xcat/repos/apt/ + cannot use with --xcat-core -y, --yes answer yes for all questions Actions: @@ -89,7 +96,7 @@ function verbose_usage() -h, --help display a simply version of help and exit --long-help display this help and exit EOF - println 9 + println 12 while read -r ; do echo "${REPLY}" ; done <<-EOF check check the version of the installed packages of xCAT and packages in the repository @@ -98,7 +105,7 @@ function verbose_usage() while read -r ; do echo "${REPLY}" ; done <<-EOF smoke-test preform basic tests of the xCAT installation EOF - println 11 + println 10 while read -r ; do echo "${REPLY}" ; done <<-EOF ${script} --xcat-core=/path/to/xcat-core.repo install ${script} --xcat-core=/path/to/xcat-core install @@ -632,7 +639,112 @@ function get_package_list() function_dispatch "${FUNCNAME}" "$@" } -function download_file() +function download_file_curl() +{ + local script="${0##*/}" + local version="$(version)" + local user_agent="${script}/${version} (${GO_XCAT_OS}; ${GO_XCAT_ARCH}; ${GO_XCAT_LINUX_DISTRO} ${GO_XCAT_LINUX_VERSION})" + type curl >/dev/null 2>&1 || return 255 + local url="$1" + local local_file="$2" + local log_file="${TMP_DIR}/curl.log.${RANDOM}" + local -i rc=0 + curl -A "${user_agent}" "${url}" -f -o "${local_file}" -S -s >"${log_file}" 2>&1 + rc="$?" + if [[ "${rc}" -ne "0" ]] + then + while read -r ; do echo "${REPLY}" ; done <"${log_file}" + echo -n "${script}: \`curl' exited with an error: (exit code ${rc}, " + case "${rc}" in + 1) echo -n "unsupported protocol" ;; + 2) echo -n "failed to initialize" ;; + 3) echo -n "URL malformed" ;; + 4) echo -n "you probably need another build of libcurl!" ;; + 5) echo -n "couldn't resolve proxy" ;; + 6) echo -n "couldn't resolve host" ;; + 7) echo -n "failed to connect to host" ;; + 8) echo -n "weird server reply" ;; + 9) echo -n "FTP access denied" ;; + 10) echo -n "FTP accept failed" ;; + 11) echo -n "FTP weird PASS reply" ;; + 12) echo -n "During an active FTP session while waiting for the server to connect back to curl, the timeout expired." ;; + 13) echo -n "FTP weird PASV reply" ;; + 14) echo -n "FTP weird 227 format" ;; + 15) echo -n "FTP can't get host" ;; + 16) echo -n "HTTP/2 error" ;; + 17) echo -n "FTP couldn't set binary" ;; + 18) echo -n "Partial file" ;; + 19) echo -n "FTP couldn't download/access the given file" ;; + 21) echo -n "FTP quote error" ;; + 22) echo -n "HTTP page not retrieved" ;; + 23) echo -n "write error" ;; + 25) echo -n "FTP couldn't STOR file" ;; + 26) echo -n "read error" ;; + 27) echo -n "out of memory" ;; + 28) echo -n "operation timeout" ;; + 30) echo -n "FTP PORT failed" ;; + 31) echo -n "FTP couldn't use REST" ;; + 33) echo -n "HTTP range error" ;; + 34) echo -n "HTTP post error" ;; + 35) echo -n "SSL connect error" ;; + 36) echo -n "bad download resume" ;; + 37) echo -n "FILE couldn't read file" ;; + 38) echo -n "LDAP cannot bind" ;; + 39) echo -n "LDAP search failed." ;; + 41) echo -n "function not found" ;; + 42) echo -n "aborted by callback" ;; + 43) echo -n "internal error" ;; + 45) echo -n "interface error" ;; + 47) echo -n "too many redirects" ;; + 48) echo -n "unknown option specified to libcurl" ;; + 49) echo -n "malformed telnet option" ;; + 51) echo -n "the peer's SSL certificate or SSH MD5 fingerprint was not OK" ;; + 52) echo -n "the server didn't reply anything, which here is considered an error" ;; + 53) echo -n "SSL crypto engine not found" ;; + 54) echo -n "cannot set SSL crypto engine as default" ;; + 55) echo -n "failed sending network data" ;; + 56) echo -n "failure in receiving network data" ;; + 58) echo -n "problem with the local certificate" ;; + 59) echo -n "couldn't use specified SSL cipher" ;; + 60) echo -n "peer certificate cannot be authenticated with known CA certificates" ;; + 61) echo -n "unrecognized transfer encoding." ;; + 62) echo -n "invalid LDAP URL" ;; + 63) echo -n "maximum file size exceeded" ;; + 64) echo -n "requested FTP SSL level failed" ;; + 65) echo -n "sending the data requires a rewind that failed" ;; + 66) echo -n "failed to initialise SSL Engine" ;; + 67) echo -n "the user name, password, or similar was not accepted and curl failed to log in" ;; + 68) echo -n "file not found on TFTP server" ;; + 69) echo -n "permission problem on TFTP server" ;; + 70) echo -n "out of disk space on TFTP server" ;; + 71) echo -n "illegal TFTP operation" ;; + 72) echo -n "unknown TFTP transfer ID" ;; + 73) echo -n "file already exists (TFTP)" ;; + 74) echo -n "no such user (TFTP)" ;; + 75) echo -n "character conversion failed" ;; + 76) echo -n "character conversion functions required" ;; + 77) echo -n "problem with reading the SSL CA cert" ;; + 78) echo -n "the resource referenced in the URL does not exist" ;; + 79) echo -n "an unspecified error occurred during the SSH session" ;; + 80) echo -n "failed to shut down the SSL connection" ;; + 82) echo -n "could not load CRL file, missing or wrong format" ;; + 83) echo -n "issuer check failed" ;; + 84) echo -n "the FTP PRET command failed" ;; + 85) echo -n "RTSP: mismatch of CSeq numbers" ;; + 86) echo -n "RTSP: mismatch of Session Identifiers" ;; + 87) echo -n "unable to parse FTP file list" ;; + 88) echo -n "FTP chunk callback reported error" ;; + 89) echo -n "no connection available, the session will be queued" ;; + 90) echo -n "SSL public key does not matched pinned public key" ;; + *) echo -n "unknown error" ;; + esac + echo ")" + echo " ... while downloading \`${url}'" + fi >&2 + [[ "${rc}" -eq "0" ]] +} + +function download_file_wget() { local script="${0##*/}" local version="$(version)" @@ -665,6 +777,11 @@ function download_file() [[ "${rc}" -eq "0" ]] } +function download_file() +{ + function_dispatch "${FUNCNAME}" "$@" +} + # $1 repo file # $2 repo id function add_repo_by_file_yum() @@ -757,8 +874,8 @@ function extract_archive() warn_if_bad "${ret}" "Failed to create directory \`${install_path}'" || return 1 - case "${archive##*.}" in - "Z") + case "${archive##*/}" in + *".tar.Z") check_executes uncompress tar grep || return 1 uncompress -c "${archive}" | tar -t -f - | grep -v "^${repo_id}/" [[ "${PIPESTATUS[0]}" -eq 0 && "${PIPESTATUS[1]}" -eq 0 && @@ -767,7 +884,7 @@ function extract_archive() rm -rf "${install_path}/${repo_id}" uncompress -c "${archive}" | ( cd "${install_path}" && tar -x -f - ) ;; - "tz"|"tgz"|"gz") + *".tz"|*".tgz"|*".tar.gz") check_executes gzip tar grep || return 1 gzip -d -c "${archive}" | tar -t -f - | grep -v "^${repo_id}/" [[ "${PIPESTATUS[0]}" -eq 0 && "${PIPESTATUS[1]}" -eq 0 && @@ -776,7 +893,7 @@ function extract_archive() rm -rf "${install_path}/${repo_id}" gzip -d -c "${archive}" | ( cd "${install_path}" && tar -x -f - ) ;; - "tbz"|"tbz2"|"bz"|"bz2") + *".tbz"|*".tbz2"|*".tar.bz"|*".tar.bz2") check_executes bzip2 tar grep || return 1 bzip2 -d -c "${archive}" | tar -t -f - | grep -v "^${repo_id}/" [[ "${PIPESTATUS[0]}" -eq 0 && "${PIPESTATUS[1]}" -eq 0 && @@ -785,7 +902,7 @@ function extract_archive() rm -rf "${install_path}/${repo_id}" bzip2 -d -c "${archive}" | ( cd "${install_path}" && tar -x -f - ) ;; - "txz"|"xz") + *".txz"|*".tar.xz") check_executes xz tar grep || return 1 xz -d -c "${archive}" | tar -t -f - | grep -v "^${repo_id}/" [[ "${PIPESTATUS[0]}" -eq 0 && "${PIPESTATUS[1]}" -eq 0 && @@ -794,7 +911,7 @@ function extract_archive() rm -rf "${install_path}/${repo_id}" xz -d -c "${archive}" | ( cd "${install_path}" && tar -x -f - ) ;; - "tar") + *".tar") check_executes tar grep || return 1 tar -t -f "${archive}" | grep -v "^${repo_id}/" [[ "${PIPESTATUS[0]}" -eq 0 && "${PIPESTATUS[1]}" -eq 1 ]] @@ -823,8 +940,8 @@ function add_repo_by_url_yum_or_zypper() local install_path="${GO_XCAT_DEFAULT_INSTALL_PATH}" case "${url%%://*}" in "ftp"|"http"|"https") - case "${url##*.}" in - "repo"|"Z"|"bz"|"bz2"|"gz"|"tar"|"tbz"|"tbz2"|"tgz"|"tz"|"txz"|"xz") + case "${url##*/}" in + *".repo"|*".tar"|*".tar.Z"|*".tar.bz"|*".tar.bz2"|*".tar.gz"|*".tar.xz"|*".tbz"|*".tbz2"|*".tgz"|*".tz"|*".txz") # an online repo or tarball tmp="${TMP_DIR}/tmp_${url##*/}" download_file "${url}" "${tmp}" @@ -900,8 +1017,8 @@ function add_repo_by_url_apt() warn_if_bad "$?" "unknown debian/ubuntu codename" || return 1 case "${url%%://*}" in "ftp"|"http"|"https"|"ssh") - case "${url##*.}" in - "Z"|"bz"|"bz2"|"gz"|"tar"|"tbz"|"tbz2"|"tgz"|"tz"|"txz"|"xz") + case "${url##*/}" in + *".tar"|*".tar.Z"|*".tar.bz"|*".tar.bz2"|*".tar.gz"|*".tar.xz"|*".tbz"|*".tbz2"|*".tgz"|*".tz"|*".txz") # an online tarball tmp="${TMP_DIR}/tmp_${url##*/}" download_file "${url}" "${tmp}" @@ -953,9 +1070,17 @@ function remove_repo_yum() type yum >/dev/null 2>&1 || return 255 local repo_id="$1" # This deleting method is not good enough. Since there could be more - # than one repostory definitions in a single repo file. + # than one repository definitions in a single repo file. # This is a quick and dirty method. rm -f $(grep -l "^\[${repo_id}\]$" "/etc/yum.repos.d/"*".repo" 2>/dev/null) + case "${repo_id}" in + "xcat-core") + mv /etc/yum.repos.d/xCAT-core.repo{,.nouse} 2>/dev/null + ;; + "xcat-dep") + mv /etc/yum.repos.d/xCAT-dep.repo{,.nouse} 2>/dev/null + ;; + esac yum clean metadata : } @@ -966,6 +1091,15 @@ function remove_repo_zypper() type zypper >/dev/null 2>&1 || return 255 local repo_id="$1" zypper removerepo "${repo_id}" + case "${repo_id}" in + "xcat-core") + mv /etc/zypp/repos.d/xCAT-core.repo{,.nouse} 2>/dev/null + ;; + "xcat-dep") + mv /etc/zypp/repos.d/xCAT-dep.repo{,.nouse} 2>/dev/null + ;; + esac + : } # $1 repo id @@ -997,10 +1131,10 @@ function add_xcat_core_repo_yum_or_zypper() then case "${ver}" in "devel") - url="${GO_XCAT_DEFAULT_BASE_URL}/yum/devel/core-snap/xCAT-core.repo" + url="${GO_XCAT_DEFAULT_BASE_URL}/yum/devel/core-snap" ;; *) - url="${GO_XCAT_DEFAULT_BASE_URL}/yum/${ver}/xcat-core/xCAT-core.repo" + url="${GO_XCAT_DEFAULT_BASE_URL}/yum/${ver}/xcat-core" ;; esac fi @@ -1075,8 +1209,8 @@ function add_xcat_dep_repo_yum_or_zypper() esac case "${url%%://*}" in "ftp"|"http"|"https") - case "${url##*.}" in - "Z"|"bz"|"bz2"|"gz"|"tar"|"tbz"|"tbz2"|"tgz"|"tz"|"txz"|"xz") + case "${url##*/}" in + *".tar"|*".tar.Z"|*".tar.bz"|*".tar.bz2"|*".tar.gz"|*".tar.xz"|*".tbz"|*".tbz2"|*".tgz"|*".tz"|*".txz") # an online archive file tmp="${TMP_DIR}/tmp_${url##*/}" download_file "${url}" "${tmp}" @@ -1679,8 +1813,8 @@ esac # case "${GO_XCAT_ACTION}" in exit 0 -# vim: set filetype=bash -# vim: set noautoindent -# vim: set tabstop=4 shiftwidth=4 softtabstop=4 +# vim: filetype=sh +# vim: noautoindent +# vim: tabstop=4 shiftwidth=4 softtabstop=4 # End of file From 8cfe5b546e0da97b14e5ed9fe5b927aefeea8582 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 27 Mar 2018 13:32:29 -0400 Subject: [PATCH 091/161] Replace usage of PNOR with Host --- .../advanced/rflash/openbmc/openbmc_common.rst | 16 ++++++++-------- .../admin-guides/references/man1/rflash.1.rst | 6 +++--- .../admin-guides/references/man1/rmdef.1.rst | 2 +- .../admin-guides/references/man7/group.7.rst | 8 +++++++- .../admin-guides/references/man7/node.7.rst | 8 +++++++- .../admin-guides/references/man7/pdu.7.rst | 14 +------------- .../references/man8/makegocons.8.rst | 2 +- docs/source/overview/xcat2_release.rst | 2 +- .../coral/cluster_mgmt/firmware/ipmi.rst | 8 ++++---- xCAT-client/pods/man1/rflash.1.pod | 6 +++--- xCAT-server/lib/xcat/plugins/ipmi.pm | 8 ++++---- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- .../autotest/testcase/rflash/rflash_openbmc.0 | 6 +++--- 13 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst index 50404a5a8..24cebbdc0 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst @@ -2,12 +2,12 @@ Unattended flash of OpenBMC firmware will do the following events: -#. Upload both BMC firmware file and PNOR firmware file -#. Activate both BMC firmware and PNOR firmware +#. Upload both BMC firmware file and Host firmware file +#. Activate both BMC firmware and Host firmware #. If BMC firmware becomes activate, reboot BMC to apply new BMC firmware, or else, ``rflash`` will exit #. If BMC itself state is ``NotReady``, ``rflash`` will exit #. If BMC itself state is ``Ready``, and use ``--no-host-reboot`` option, ``rflash`` will not reboot the compute node -#. If BMC itself state is ``Ready``, and do not use ``--no-host-reboot`` option, ``rflash`` will reboot the compute node to apply PNOR firmware +#. If BMC itself state is ``Ready``, and do not use ``--no-host-reboot`` option, ``rflash`` will reboot the compute node to apply Host firmware Use the following command to flash the firmware unattended: :: @@ -28,8 +28,8 @@ The sequence of events that must happen to flash OpenBMC firmware is the followi #. Power off the Host #. Upload and Activate BMC #. Reboot the BMC (applies BMC) -#. Upload and Activate PNOR -#. Power on the Host (applies PNOR) +#. Upload and Activate Host +#. Power on the Host (applies Host) Power off Host @@ -42,7 +42,7 @@ Use the rpower command to power off the host: :: Upload and Activate BMC Firmware -------------------------------- -Use the rflash command to upload and activate the PNOR firmware: :: +Use the rflash command to upload and activate the Host firmware: :: rflash -a /path/to/obmc-phosphor-image-witherspoon.ubi.mtd.tar @@ -61,10 +61,10 @@ The BMC will take 2-5 minutes to reboot, check the status using: ``rpower -a /path/to/witherspoon.pnor.squashfs.tar diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 5e833a139..2808761d5 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -170,7 +170,7 @@ To apply the firmware level, a reboot is required to BMC and HOST. \ **-d**\ : -This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and PNOR .tar files. When BMC and PNOR tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. +This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and Host .tar files. When BMC and Host tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. \ **Note:**\ When using \ **-**\ **-no-host-reboot**\ , it will not reboot the host after BMC is reboot. @@ -212,7 +212,7 @@ This delete option will delete update image from BMC. It expects an ID as the in OpenPOWER BMC specific (using IPMI): - Used for IBM Power S822LC for Big Data systems only. Specifies the directory where the \ **pUpdate**\ utility and at least one of BMC or PNOR update files are located. The utility and update files can be downloaded from FixCentral. + Used for IBM Power S822LC for Big Data systems only. Specifies the directory where the \ **pUpdate**\ utility and at least one of BMC or Host update files are located. The utility and update files can be downloaded from FixCentral. @@ -357,7 +357,7 @@ This delete option will delete update image from BMC. It expects an ID as the in -6. To update the firmware on IBM Power S822LC for Big Data machine specify the node name and the file path of the data directory containing pUpdate utility, both BMC and PNOR update files: +6. To update the firmware on IBM Power S822LC for Big Data machine specify the node name and the file path of the data directory containing pUpdate utility, both BMC and Host update files: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/rmdef.1.rst b/docs/source/guides/admin-guides/references/man1/rmdef.1.rst index e2190cf6b..c7913da80 100644 --- a/docs/source/guides/admin-guides/references/man1/rmdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmdef.1.rst @@ -90,7 +90,7 @@ OPTIONS \ **-C|-**\ **-cleanup**\ - Perform additional cleanup by running \ **nodeset offline**\, \ **makeconservercf -d**\ and \ **makegocons --cleanup**\ on the objects specified in the \ *noderange*\ . + Perform additional cleanup by running \ **nodeset offline**\ , \ **makeconservercf -d**\ and \ **makegocons -**\ **-cleanup**\ on the objects specified in the \ *noderange*\ . diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 5fa203420..f4507f8e8 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *authkey*\ , \ *authtype*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *community*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *pdutype*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *privkey*\ , \ *privtype*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *seclevel*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpuser*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\ +\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *authkey*\ , \ *authtype*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *community*\ , \ *cons*\ , \ *conserver*\ , \ *consoleenabled*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *pdutype*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *privkey*\ , \ *privtype*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *seclevel*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpuser*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\ *********** @@ -209,6 +209,12 @@ group Attributes: +\ **consoleenabled**\ (nodehm.consoleenabled) + + A flag field to indicate whether the node is registered in the console server. If '1', console is enabled, if not set, console is not enabled. + + + \ **consoleondemand**\ (nodehm.consoleondemand) This overrides the value from site.consoleondemand. Set to 'yes', 'no', '1' (equivalent to 'yes'), or '0' (equivalent to 'no'). If not set, the default is the value from site.consoleondemand. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index 167c561d4..985dadec3 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *authkey*\ , \ *authtype*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *community*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *pdutype*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *privkey*\ , \ *privtype*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *seclevel*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpuser*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\ +\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *authkey*\ , \ *authtype*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *community*\ , \ *cons*\ , \ *conserver*\ , \ *consoleenabled*\ , \ *consoleondemand*\ , \ *consport*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *pdutype*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *privkey*\ , \ *privtype*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *seclevel*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpuser*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\ *********** @@ -221,6 +221,12 @@ node Attributes: +\ **consoleenabled**\ (nodehm.consoleenabled) + + A flag field to indicate whether the node is registered in the console server. If '1', console is enabled, if not set, console is not enabled. + + + \ **consoleondemand**\ (nodehm.consoleondemand) This overrides the value from site.consoleondemand. Set to 'yes', 'no', '1' (equivalent to 'yes'), or '0' (equivalent to 'no'). If not set, the default is the value from site.consoleondemand. diff --git a/docs/source/guides/admin-guides/references/man7/pdu.7.rst b/docs/source/guides/admin-guides/references/man7/pdu.7.rst index a9aaae2b6..de02c50e9 100644 --- a/docs/source/guides/admin-guides/references/man7/pdu.7.rst +++ b/docs/source/guides/admin-guides/references/man7/pdu.7.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **pdu Attributes:**\ \ *machinetype*\ , \ *modelnum*\ , \ *node*\ , \ *nodetype*\ , \ *outlet*\ , \ *serialnum*\ +\ **pdu Attributes:**\ \ *node*\ , \ *nodetype*\ , \ *outlet*\ *********** @@ -39,14 +39,6 @@ pdu Attributes: -\ **machinetype**\ (pdu.machinetype) - - - -\ **modelnum**\ (pdu.modelnum) - - - \ **node**\ (pdu.node) The hostname/address of the pdu to which the settings apply @@ -65,10 +57,6 @@ pdu Attributes: -\ **serialnum**\ (pdu.serialnum) - - - ******** SEE ALSO diff --git a/docs/source/guides/admin-guides/references/man8/makegocons.8.rst b/docs/source/guides/admin-guides/references/man8/makegocons.8.rst index b9ba5e686..31daffabd 100644 --- a/docs/source/guides/admin-guides/references/man8/makegocons.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makegocons.8.rst @@ -51,7 +51,7 @@ the \ **console**\ column of \ **servicenode**\ table to \ **2**\ . To support diskless service node, a new column \ **consoleenabled**\ has been added in \ **nodehm**\ table, it is used by \ **makegocons**\ command to save the current console state for the node. After reinstalling the service node, the console storage file which maintain -the console nodes for goconserver is lost, xCAT would register the console nodes into goconserver based on \ **consoleenabled**\ attribute +the console nodes by goconserver is lost, xCAT would register the console nodes into goconserver based on \ **consoleenabled**\ attribute when restarting xcatd service. For openbmc which uses ssh as the terminal session connection method, goconserver can help save the system diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 36baecfad..0b64db14c 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -59,7 +59,7 @@ xCAT 2.13.x +---------------------------------+---------------+-------------+----------------------------------+ || xCAT 2.13.7 | | |- OpenBMC support: | || 2017/9/22 | | | | -|| | | | rflash for OpenBMC and PNOR | +|| | | | rflash for OpenBMC and Host | | `2.13.7 Release Notes `_ | | | | diff --git a/docs/source/references/coral/cluster_mgmt/firmware/ipmi.rst b/docs/source/references/coral/cluster_mgmt/firmware/ipmi.rst index 877294a5a..354326e82 100644 --- a/docs/source/references/coral/cluster_mgmt/firmware/ipmi.rst +++ b/docs/source/references/coral/cluster_mgmt/firmware/ipmi.rst @@ -9,9 +9,9 @@ Collect the required files Collect the following files and put them into a directory on the Management Node. - * pUpdate - * pnor - * bmc + * pUpdate utility + * .pnor for host + * .bin for bmc If running ``rflash`` in Hierarchy, the firmware files/directory must be accessible on the Service Nodes. @@ -26,7 +26,7 @@ The ``pUpdate`` utility is leveraged in doing the firmware update against the ta * power off the host * flash bmc and reboot - * flash pnor + * flash host * power on the host Monitor the progress for the nodes by looking at the files under ``/var/log/xcat/rflash/``. diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index 94d0db3bc..64eb79424 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -123,7 +123,7 @@ B When using B in hierarchical environment, the .tar file must be B<-d>: -This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and PNOR .tar files. When BMC and PNOR tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. +This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and Host .tar files. When BMC and Host tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. B When using B<--no-host-reboot>, it will not reboot the host after BMC is reboot. @@ -155,7 +155,7 @@ Specifies the directory where the raw data from rpm packages for each CEC/Frame OpenPOWER BMC specific (using IPMI): -Used for IBM Power S822LC for Big Data systems only. Specifies the directory where the B utility and at least one of BMC or PNOR update files are located. The utility and update files can be downloaded from FixCentral. +Used for IBM Power S822LC for Big Data systems only. Specifies the directory where the B utility and at least one of BMC or Host update files are located. The utility and update files can be downloaded from FixCentral. =item B<--activate> {B | B} @@ -245,7 +245,7 @@ Print verbose message to rflash log file (/var/log/xcat/rflash/fs3.log) when upd rflash fs3 /firmware/8335_810.1543.20151021b_update.hpm -V =item 6. -To update the firmware on IBM Power S822LC for Big Data machine specify the node name and the file path of the data directory containing pUpdate utility, both BMC and PNOR update files: +To update the firmware on IBM Power S822LC for Big Data machine specify the node name and the file path of the data directory containing pUpdate utility, both BMC and Host update files: rflash briggs01 -d /root/supermicro/OP825 diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index a47df379a..a9929df08 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2016,7 +2016,7 @@ sub do_firmware_update { if (scalar(@pnor_files) > 1) { # Error if more than one .pnor file in data directory $exit_with_error_func->($sessdata->{node}, $callback, - "Multiple PNOR update files detected in data directory $pUpdate_directory."); + "Multiple Host update files detected in data directory $pUpdate_directory."); } if (scalar(@bmc_files) > 1) { @@ -2059,7 +2059,7 @@ sub do_firmware_update { "Timeout to check the bmc status"); } - # step 2 update BMC file or PNOR file, or both + # step 2 update BMC file or Host file, or both if ($bmc_file) { # BMC file was found in data directory, run update with it my $pUpdate_bmc_cmd = "$pUpdate_directory/pUpdate -f $bmc_file -i lan -h $bmc_addr -u $bmc_userid -p $bmc_password >".$rflash_log_file." 2>&1"; @@ -2083,11 +2083,11 @@ sub do_firmware_update { if ($pnor_file) { - # PNOR file was found in data directory, run update with it + # Host file was found in data directory, run update with it my $pUpdate_pnor_cmd = "$pUpdate_directory/pUpdate -pnor $pnor_file -i lan -h $bmc_addr -u $bmc_userid -p $bmc_password >>".$rflash_log_file." 2>&1"; if ($verbose) { xCAT::SvrUtils::sendmsg([ 0, - "rflashing PNOR, see the detail progress :\"tail -f $rflash_log_file\"" ], + "rflashing Host, see the detail progress :\"tail -f $rflash_log_file\"" ], $callback, $sessdata->{node}); } my $output = xCAT::Utils->runcmd($pUpdate_pnor_cmd, -1); diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index cd5ac02d4..da29a7120 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -2000,7 +2000,7 @@ sub parse_command_status { $return_code = 1; } if (!$::UPLOAD_PNOR) { - xCAT::SvrUtils::sendmsg([1,"No PNOR tar file found in $update_file"], $callback); + xCAT::SvrUtils::sendmsg([1,"No Host tar file found in $update_file"], $callback); $return_code = 1; } if ($return_code) { diff --git a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 index 911186417..4db2ba69b 100644 --- a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 +++ b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 @@ -449,21 +449,21 @@ cmd:mkdir -p /tmp/bogus123 check:rc == 0 cmd:rflash $$CN /tmp/bogus123 -d check:output =~Error: No BMC tar file found -check:output =~Error: No PNOR tar file found +check:output =~Error: No Host tar file found check:output!~Attempting to check:rc != 0 cmd:touch /tmp/bogus123/obmc-phosphor-image-witherspoon.ubi.mtd.tar check:rc == 0 cmd:rflash $$CN -d /tmp/bogus123 check:output =~Error: No BMC tar file found -check:output =~Error: No PNOR tar file found +check:output =~Error: No Host tar file found check:output!~Attempting to check:rc != 0 cmd:touch /tmp/bogus123/witherspoon.pnor.squashfs.tar check:rc == 0 cmd:rflash $$CN -d /tmp/bogus123 check:output =~Error: No BMC tar file found -check:output =~Error: No PNOR tar file found +check:output =~Error: No Host tar file found check:output!~Attempting to check:rc != 0 cmd:rm -rf /tmp/bogus123 From 8c5701d9ab223ec2805abc4c5ee2a6c0df47a65f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 28 Mar 2018 14:36:58 -0400 Subject: [PATCH 092/161] OpenBMC reventlog flag verification --- xCAT-server/lib/perl/xCAT/OPENBMC.pm | 2 +- xCAT-server/lib/xcat/plugins/openbmc2.pm | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index a3c1a78be..1429626e9 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -255,7 +255,7 @@ sub run_cmd_in_perl { } # List of commands currently not supported in Python - my @unsupported_in_python_commands = ('rflash', 'rspconfig', 'reventlog', 'getopenbmccons'); + my @unsupported_in_python_commands = ('rflash', 'rspconfig', 'getopenbmccons'); if ($command ~~ @unsupported_in_python_commands) { # Command currently not supported in Python diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index 3fccbcf26..ce5c73f93 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -364,7 +364,12 @@ sub parse_args { } } elsif ($command eq "reventlog") { $subcommand = "all" if (!defined($ARGV[0])); - if ($subcommand =~ /^resolved=(.*)/) { + if (scalar(@ARGV) >= 2) { + if ($ARGV[1] =~ /^-s$/) { + return ([ 1, "The -s option is not supported for OpenBMC." ]); + } + return ([ 1, "Only one option is supported at the same time for $command" ]); + } elsif ($subcommand =~ /^resolved=(.*)/) { my $value = $1; if (not $value) { return ([ 1, "$usage_errormsg $reventlog_no_id_resolved_errormsg" ]); From 4e2d236d6ae08674765a5db9f70daf371d0d24b6 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 29 Mar 2018 16:05:28 +0800 Subject: [PATCH 093/161] Create directory /install/custom/netboot/rh as needed --- xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh | 2 ++ xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh index 9d174d8dd..410da181e 100755 --- a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh +++ b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskfull-install.sh @@ -100,6 +100,8 @@ do done ######## +umask 0022 + OSIMAGE_NAME="${LINUX_DISTRO}-${LINUX_ARCH}-install-cudafull" OSIMAGE_OTHERPKGDIR="/install/post/otherpkgs/${LINUX_DISTRO}/${LINUX_ARCH}" diff --git a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh index bc97d8757..e8c9030b2 100755 --- a/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh +++ b/xCAT-test/autotest/testcase/cuda/rhel-cuda-diskless-install.sh @@ -100,6 +100,8 @@ do done ######## +umask 0022 + OSIMAGE_NAME="${LINUX_DISTRO}-${LINUX_ARCH}-netboot-cudafull" OSIMAGE_OTHERPKGDIR="/install/post/otherpkgs/${LINUX_DISTRO}/${LINUX_ARCH}" OSIMAGE_ROOTIMGDIR="/install/netboot/${LINUX_DISTRO}/${LINUX_ARCH}/${OSIMAGE_NAME}" @@ -133,6 +135,7 @@ ${OSIMAGE_NAME}: EOF [ "$?" -ne "0" ] && echo "Make osimage definition failed." >&2 && exit 1 +mkdir -p "/install/custom/netboot/rh" ( cat "/opt/xcat/share/xcat/netboot/rh/compute.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" cat <<-EOF From 38893aebe92b03bd0a12aa1b0d3b92c5946d3aeb Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 21 Mar 2018 06:06:46 -0400 Subject: [PATCH 094/161] add testcase for osimage validation --- .../xcat-inventory/cases.osimage.validation | 52 +++++ .../xcat-inventory/templates/osimage.json | 27 +++ .../xcat-inventory/templates/osimage.yaml | 21 ++ .../testcase/xcat-inventory/validatehelper | 188 ++++++++++++++++++ 4 files changed, 288 insertions(+) create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.json create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.yaml create mode 100755 xCAT-test/autotest/testcase/xcat-inventory/validatehelper diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation new file mode 100644 index 000000000..917ee8a1d --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation @@ -0,0 +1,52 @@ +start: xcat_inventory_import_validation_osimage +description: verify the validation mechanisom while importing osimage object + +cmd: rm -rf /tmp/xcat_inventory_import_validation_osimage +cmd: mkdir -p /tmp/xcat_inventory_import_validation_osimage +cmd: mkdir -p /tmp/xcat_inventory_import_validation_osimage/trash/ +cmd: mkdir -p /tmp/xcat_inventory_import_validation_osimage/backup/ +cmd: lsdef -t osimage -o testosimage1 -z 2>/dev/null >/tmp/xcat_inventory_import_validation_osimage/backup/testosimage1.stanza + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "compute" "/tmp/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "service" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "invalid" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc!=0 + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "imagetype" "windows" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "imagetype" "linux" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "imagetype" "invalid" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "imagetype" "" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "provision_mode" "statelite" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "provision_mode" "install" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "provision_mode" "netboot" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "provision_mode" "invalid" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "provision_mode" "" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "nfs" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "ramdisk" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "invalid" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "" "/tmp/xcat_inventory_import_validation_osimage/trash/" +check: rc==0 + +cmd: cat /tmp/xcat_inventory_import_validation_osimage/backup/testosimage1.stanza 2>/dev/null |mkdef -z +cmd: rm -rf /tmp/xcat_inventory_import_validation_osimage +end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.json new file mode 100644 index 000000000..d35a00144 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.json @@ -0,0 +1,27 @@ +{ + "osimage": { + "testosimage1": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "sles12.2", + "osdistro": "sles12.2-ppc64le" + }, + "filestosync": "/install/custom/netboot/sles/compute.synclist", + "genimgoptions": { + "exlist": "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist", + "postinstall": "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.postinstall", + "rootimgdir": "/install/netboot/sles12.2/ppc64le/compute", + "rootfstype": "nfs" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": "/install/post/otherpkgs/sles12.2/ppc64le", + "pkgdir": "/install/sles12.2/ppc64le", + "pkglist": "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist" + }, + "provision_mode": "statelite", + "role": "compute" + } + }, + "schema_version": "1.0" +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.yaml new file mode 100644 index 000000000..f837d42fb --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/osimage.yaml @@ -0,0 +1,21 @@ +osimage: + testosimage1: + basic_attributes: + arch: ppc64le + distribution: sles12.2 + osdistro: sles12.2-ppc64le + filestosync: /install/custom/netboot/sles/compute.synclist + genimgoptions: + exlist: /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist + postinstall: /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.postinstall + rootimgdir: /install/netboot/sles12.2/ppc64le/compute + rootfstype: nfs + imagetype: linux + package_selection: + otherpkgdir: /install/post/otherpkgs/sles12.2/ppc64le + pkgdir: /install/sles12.2/ppc64le + pkglist: /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist + provision_mode: statelite + role: compute +schema_version: '1.0' + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper new file mode 100755 index 000000000..0345fea6a --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper @@ -0,0 +1,188 @@ +#!/usr/bin/bash + +objtype=$1 +objname=$2 +attribute=$3 +attrvalue=$4 +tmpdir=$5 + + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + + +function usage { + echo "Usage:" + echo "${BASH_SOURCE[0]} [ OBJTYPE OBJNAME ATTRIBUTE ATTRVALUE TMPDIR]" +} + +echo objtype=\"${objtype}\" +echo objname=\"${objname}\" +echo attribute=\"${attribute}\" +echo attrvalue=\"${attrvalue}\" +echo tmpdir=\"${tmpdir}\" + + +if [ -z "$objtype" ] || [ -z "$objname" ] || [ -z "$attribute" ] || [ -z "$tmpdir" ]; then + usage + exit 1 +fi + +RETCODE_YAML=0 +RETCODE_JSON=0 + +[ -e "$tmpdir" ] || rm -rf $tmpdir +mkdir -p $tmpdir +echo "Temporary directory to hold intermediate files: $tmpdir" + +cp ${DIR}/templates/${objtype}.json ${tmpdir}/ +cp ${DIR}/templates/${objtype}.yaml ${tmpdir}/ + +#the intermediate inventory files to import +yamldef="${tmpdir}/${objtype}.yaml" +jsondef="${tmpdir}/${objtype}.json" + +#the intermediate inventory files exported +yamldefout="${tmpdir}/${objtype}.out.yaml" +jsondefout="${tmpdir}/${objtype}.out.json" + +#substitute the attribute value in inventory files +if [ ${#attrvalue} -ne 0 ];then + sed -i -E -e "s/^(\s*["'"'"']?$attribute["'"'"']?:\s*["'"'"']?)[^'"'"'"]*(["'"'"']?[,]?\s*)$/\1$attrvalue\2/g" $yamldef +else + sed -i -e "/^\s*["'"'"']*$attribute["'"'"']*:/d" $yamldef +fi + +echo "=================the inventory file to import: ${yamldef}=====================" +cat $yamldef +echo "==============================================================================" + +echo "removing existing \"$objtype\" type object \"$objname\" from xCAT" +echo "osimage node network site route zone policy "|grep -q -w "$objtype" +if [ $? -eq 0 ];then + rmdef -t $objtype -o $objname +fi +if [ "$objtype" = "passwd" ];then + tabch -d key=$objname passwd +fi + + +echo "import the inventory file $yamldef " +xcat-inventory import -t $objtype -o $objname -f $yamldef +if [ $? -ne 0 ];then + echo "failed to import the inventory file $yamldef" + RETCODE_YAML=1 +else + echo "the inventory file $yamldef imported successfully" + echo "export the \"$objtype\" type object \"$objname\" just imported" + xcat-inventory export -t $objtype -o $objname --format=yaml 1>$yamldefout + if [ $? -ne 0 ];then + echo "failed to export the \"$objtype\" type object \"$objname\"" + RETCODE_YAML=1 + else + echo "the inventory data of the \"$objtype\" type object \"$objname\" exported to $yamldefout" + echo "==============the exported inventory file $yamldefout======================" + cat $yamldefout + echo "===========================================================================" + echo "make sure the attribute $attribute is imported and exported successfully" + if [ -n "$attrvalue" ]; then + cat $yamldefout|grep -w "$attribute"|grep -q -w "$attrvalue" + if [ $? -ne 0 ];then + RETCODE_YAML=1 + fi + else + cat $yamldefout|grep -q -w "$attribute" + if [ $? -eq 0 ];then + RETCODE_YAML=1 + fi + fi + + + fi +fi + +if [ $RETCODE_YAML -eq 0 ]; then + echo "yaml validation passed" +else + echo "yaml validation failed" +fi + +echo "removing existing \"$objtype\" type object \"$objname\" from xCAT" +echo "osimage node network site route zone policy "|grep -q -w "$objtype" +if [ $? -eq 0 ];then + rmdef -t $objtype -o $objname +fi + +if [ "$objtype" = "passwd" ];then + tabch -d key=$objname passwd +fi + + +if [ ${#attrvalue} -ne 0 ];then + sed -i -E -e "s/^(\s*["'"'"']?$attribute["'"'"']?:\s*["'"'"']?)[^'"'"'"]*(["'"'"']?[,]?\s*)$/\1$attrvalue\2/g" $jsondef +else + sed -i -e "/^\s*["'"'"']*$attribute["'"'"']*:/d" $jsondef +fi + +echo "=================the inventory file to import: ${jsondef}=====================" +cat $jsondef +echo "==============================================================================" + +echo "import the inventory file $jsondef " +xcat-inventory import -t $objtype -o $objname -f $jsondef +if [ $? -ne 0 ];then + echo "failed to import the inventory file $jsondef" + RETCODE_JSON=1 +else + xcat-inventory export -t $objtype -o $objname 1>$jsondefout + if [ $? -ne 0 ];then + echo "the inventory file $jsondef imported successfully" + echo "export the \"$objtype\" type object \"$objname\" just imported" + RETCODE_JSON=1 + else + echo "the inventory data of the \"$objtype\" type object \"$objname\" exported to $jsondefout" + echo "==============the exported inventory file $jsondefout======================" + cat $jsondefout + echo "===========================================================================" + echo "make sure the attribute $attribute is imported and exported successfully" + if [ -n "$attrvalue" ]; then + cat $jsondefout|grep -w "$attribute"|grep -q -w "$attrvalue" + if [ $? -ne 0 ];then + RETCODE_JSON=1 + fi + else + cat $jsondefout|grep -q -w "$attribute" + if [ $? -eq 0 ];then + RETCODE_JSON=1 + fi + fi + + fi +fi + +if [ $RETCODE_JSON -eq 0 ]; then + echo "json validation passed" +else + echo "json validation failed" +fi + + +echo "osimage node network site route zone policy "|grep -q -w "$objtype" +if [ $? -eq 0 ];then + rmdef -t $objtype -o $objname +fi + +if [ "$objtype" = "passwd" ];then + tabch -d key=$objname passwd +fi + +if [ $RETCODE_YAML -ne 0 ] || [ $RETCODE_JSON -ne 0 ]; then + exit 1 +fi + +exit 0 From bcbaf0317536aad7830b7161aa0376b3d1e1d7e9 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 23 Mar 2018 03:10:08 -0400 Subject: [PATCH 095/161] add validation cases for site object --- .../xcat-inventory/cases.site.validation | 126 ++++++++++++++++++ .../xcat-inventory/templates/site.json | 18 +++ .../xcat-inventory/templates/site.yaml | 15 +++ .../testcase/xcat-inventory/validatehelper | 21 +-- 4 files changed, 171 insertions(+), 9 deletions(-) create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/site.json create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/site.yaml diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation b/xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation new file mode 100644 index 000000000..23a9237d3 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation @@ -0,0 +1,126 @@ +start: xcat_inventory_import_validation_site +description: verify the validation mechanisom while importing site object + +cmd: rm -rf /tmp/xcat_inventory_import_validation_site +cmd: mkdir -p /tmp/xcat_inventory_import_validation_site +cmd: mkdir -p /tmp/xcat_inventory_import_validation_site/trash/ +cmd: mkdir -p /tmp/xcat_inventory_import_validation_site/backup/ +cmd: lsdef -t site -o clustersite -z 2>/dev/null >/tmp/xcat_inventory_import_validation_site/backup/clustersite.stanza + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "0" "/tmp/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "1" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "2" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "3" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "4" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dhcplease" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dhcplease" "10240" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dhcplease" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "disjointdhcps" "0" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "disjointdhcps" "1" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "disjointdhcps" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "disjointdhcps" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "httpport" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "httpport" "80" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "httpport" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "managedaddressmode" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "managedaddressmode" "static" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "managedaddressmode" "dhcp" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "managedaddressmode" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sharedinstall" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sharedinstall" "no" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sharedinstall" "sns" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sharedinstall" "all" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sharedinstall" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sshbetweennodes" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sshbetweennodes" "ALLGROUPS" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sshbetweennodes" "NOGROUPS" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "sshbetweennodes" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdebugmode" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdebugmode" "0" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdebugmode" "1" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdebugmode" "2" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdebugmode" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdport" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdport" "3001" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdport" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatdport" "3002" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatiport" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatiport" "3001" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatiport" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatiport" "3002" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 + + +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatlport" "" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatlport" "3001" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatlport" "invalid" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc!=0 +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "xcatlport" "3003" "/tmp/xcat_inventory_import_validation_site/trash/" +check: rc==0 + +cmd: cat /tmp/xcat_inventory_import_validation_site/backup/clustersite.stanza 2>/dev/null |mkdef -z -f +cmd: rm -rf /tmp/xcat_inventory_import_validation_site +end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/site.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/site.json new file mode 100644 index 000000000..6f86279a4 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/site.json @@ -0,0 +1,18 @@ +{ + "schema_version": "1.0", + "site": { + "clustersite": { + "dbtracelevel": "1", + "dhcplease": "10240", + "disjointdhcps": "0", + "httpport": "80", + "sharedinstall": "no", + "managedaddressmode": "dhcp", + "sshbetweennodes": "ALLGROUPS", + "xcatdebugmode": "0", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatlport": "3003" + } + } +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/site.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/site.yaml new file mode 100644 index 000000000..6a1e219a5 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/site.yaml @@ -0,0 +1,15 @@ +schema_version: '1.0' +site: + clustersite: + dbtracelevel: '1' + dhcplease: '10240' + disjointdhcps: '0' + httpport: '80' + sharedinstall: 'no' + managedaddressmode: 'dhcp' + sshbetweennodes: 'ALLGROUPS' + xcatdebugmode: '0' + xcatdport: '3001' + xcatiport: '3002' + xcatlport: '3003' + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper index 0345fea6a..3910d5ec1 100755 --- a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper +++ b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper @@ -51,6 +51,15 @@ jsondef="${tmpdir}/${objtype}.json" yamldefout="${tmpdir}/${objtype}.out.yaml" jsondefout="${tmpdir}/${objtype}.out.json" +echo "removing existing \"$objtype\" type object \"$objname\" from xCAT" +echo "osimage node network site route zone policy "|grep -q -w "$objtype" +if [ $? -eq 0 ];then + rmdef -t $objtype -o $objname +fi +if [ "$objtype" = "passwd" ];then + tabch -d key=$objname passwd +fi + #substitute the attribute value in inventory files if [ ${#attrvalue} -ne 0 ];then sed -i -E -e "s/^(\s*["'"'"']?$attribute["'"'"']?:\s*["'"'"']?)[^'"'"'"]*(["'"'"']?[,]?\s*)$/\1$attrvalue\2/g" $yamldef @@ -62,15 +71,6 @@ echo "=================the inventory file to import: ${yamldef}================= cat $yamldef echo "==============================================================================" -echo "removing existing \"$objtype\" type object \"$objname\" from xCAT" -echo "osimage node network site route zone policy "|grep -q -w "$objtype" -if [ $? -eq 0 ];then - rmdef -t $objtype -o $objname -fi -if [ "$objtype" = "passwd" ];then - tabch -d key=$objname passwd -fi - echo "import the inventory file $yamldef " xcat-inventory import -t $objtype -o $objname -f $yamldef @@ -181,6 +181,9 @@ if [ "$objtype" = "passwd" ];then tabch -d key=$objname passwd fi +echo "remove intermediate directory $tmpdir" +[ -e "$tmpdir" ] || rm -rf $tmpdir + if [ $RETCODE_YAML -ne 0 ] || [ $RETCODE_JSON -ne 0 ]; then exit 1 fi From b634fc87951349cb80d9f6eb5df172d2097fe8b8 Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 27 Mar 2018 05:41:10 -0400 Subject: [PATCH 096/161] rewrite validatehelper with python to process complex scenario --- .../testcase/xcat-inventory/validatehelper | 412 ++++++++++-------- 1 file changed, 236 insertions(+), 176 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper index 3910d5ec1..ab21b0cfa 100755 --- a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper +++ b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper @@ -1,191 +1,251 @@ -#!/usr/bin/bash +#!/usr/bin/python +from __future__ import print_function -objtype=$1 -objname=$2 -attribute=$3 -attrvalue=$4 -tmpdir=$5 +import yaml +import json +import os +import re +import sys +import shutil +import subprocess -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +#remove the dict entries whose value is null or '' +def Util_rmnullindict(mydict): + for key in mydict.keys(): + if isinstance(mydict[key],dict): + Util_rmnullindict(mydict[key]) + if not mydict[key].keys(): + del mydict[key] + else: + if not mydict[key]: + del mydict[key] -function usage { - echo "Usage:" - echo "${BASH_SOURCE[0]} [ OBJTYPE OBJNAME ATTRIBUTE ATTRVALUE TMPDIR]" -} +# get the dict value mydict[a][b][c] with key path a.b.c +def Util_getdictval(mydict,keystr): + if not isinstance(mydict,dict): + return None + dictkeyregex=re.compile("([^\.]+)\.?(\S+)*") + result=re.findall(dictkeyregex,keystr) + if result: + (key,remdkey)=result[0] + if key not in mydict.keys(): + return None + if remdkey: + return Util_getdictval(mydict[key],remdkey) + else: + return mydict[key] -echo objtype=\"${objtype}\" -echo objname=\"${objname}\" -echo attribute=\"${attribute}\" -echo attrvalue=\"${attrvalue}\" -echo tmpdir=\"${tmpdir}\" +# get the dict value mydict[a][b][c] with key path a.b.c +def Util_setdictval(mydict,keystr,value): + dictkeyregex=re.compile("([^\.]+)\.?(\S+)*") + result=re.findall(dictkeyregex,keystr) + if result: + (key,remdkey)=result[0] + if remdkey: + if key not in mydict.keys(): + mydict[key]={} + Util_setdictval(mydict[key],remdkey,value) + else: + mydict[key]=value + +def GetAttrInFile(fpath,objtype,objname,attrpath): + f=open(fpath,'r') + try: + objdict=json.loads(f) + except TypeError,ValueError: + try: + objdict=yaml.load(f) + except Exception,e: + raise Exception("Error: cannot open file "+fpath+"! "+str(e)) + + f.close() + myattrpath=objtype+"."+objname+"."+attrpath + myvalue=Util_getdictval(objdict,myattrpath) + if isinstance(myvalue,list): + myvalue=myvalue[0] + return myvalue + +def runCommand(cmd, env=None): + """ Run one command only, when you don't want to bother setting up + the Popen stuff. + """ + print('Running command: %s' %cmd) + try: + p = subprocess.Popen(cmd, + env=env, + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) + out, err = p.communicate() + except OSError,e: + print('RunCommand failed due to OSError %s' % e) + if p.returncode: + print('Command %s failed with return code %d : %s' % (cmd , p.returncode, err)) + print(out) + print(err) + return p.returncode + + +def UpdateAttrInFile(fpath,fformat,objtype,objname,attrpath,value): + f=open(fpath,'r') + try: + objdict=json.loads(f) + except TypeError,ValueError: + try: + objdict=yaml.load(f) + except Exception,e: + raise Exception("Error: cannot open file "+fpath+"! "+str(e)) + + f.close() + myattrpath=objtype+"."+objname+"."+attrpath + if value == "": + Util_setdictval(objdict,myattrpath,"") + Util_rmnullindict(objdict) + else: + origobjdict=Util_getdictval(objdict,myattrpath) + if isinstance(origobjdict,list) and not isinstance(value,list): + newvalue=[value] + else: + newvalue=value + Util_setdictval(objdict,myattrpath,newvalue) + f=open(fpath,'w') + if fformat == "yaml": + print(yaml.dump(objdict,default_flow_style=False),file=f) + elif fformat == "json": + print(json.dumps(objdict, sort_keys=True, indent=4, separators=(',', ': ')),file=f) + f.close() + +def removeobj(objtype,objname): + print("removing existing \""+objtype+"\" type object \""+objname+"\" from xCAT\n") + if str(objtype) in ('node','osimage','network','site','route','zone','policy'): + runCommand("rmdef -t "+objtype+" -o "+objname) + elif str(objtype) in ('passwd'): + runCommand("tabch -d key="+objname+" passwd") + +def Usage(): + print("Usage:\n") + print(sys.argv[0]+" [OBJTYPE OBJNAME ATTRIBUTE ATTRVALUE TMPDIR]") + +if len(sys.argv) < 6: + Usage() + exit(1) + + +objtype=str(sys.argv[1]) +objname=str(sys.argv[2]) +attribute=str(sys.argv[3]) +attrvalue=str(sys.argv[4]) +tmpdir=str(sys.argv[5]) +print("objtype=%s\nobjname=%s\nattribute=%s\nattrvalue=%s\ntmpdir=%s\n"%(objtype,objname,attribute,attrvalue,tmpdir)) + +if os.path.exists(tmpdir): + runCommand("rm -rf "+tmpdir) + +os.mkdir(tmpdir) + +print("Temporary directory to hold intermediate files: "+tmpdir+"\n") + +curdir=os.path.split(os.path.realpath(sys.argv[0]))[0] +yamldeftmpl=curdir+"/templates/"+objtype+'.yaml' +jsondeftmpl=curdir+"/templates/"+objtype+'.json' +yamldef=tmpdir+"/"+objtype+'.yaml' +jsondef=tmpdir+"/"+objtype+'.json' +yamldefout=tmpdir+"/"+objtype+'.out.yaml' +jsondefout=tmpdir+"/"+objtype+'.out.json' + +shutil.copyfile(yamldeftmpl,yamldef) +shutil.copyfile(jsondeftmpl,jsondef) + +rcfinal=0 +rcyaml=0 +rcjson=0 +rc=0 + +UpdateAttrInFile(yamldef,'yaml',objtype,objname,attribute,attrvalue) +print("=================the inventory file to import: "+yamldef+"=====================\n") +runCommand("cat "+yamldef) +print("===============================================================================\n") -if [ -z "$objtype" ] || [ -z "$objname" ] || [ -z "$attribute" ] || [ -z "$tmpdir" ]; then - usage - exit 1 -fi +print("import the inventory file "+yamldef+"\n") +rc=runCommand("xcat-inventory import -t "+objtype+" -o "+objname+" -f "+yamldef) +if rc !=0: + print("failed to import the inventory file "+yamldef) + rcyaml=1 +else: + print("the inventory file "+yamldef+" imported successfully\n") + print("export the \""+objtype+"\" type object \""+objname+"\" just imported\n") + rc=runCommand("xcat-inventory export -t "+objtype+" -o "+objname+" --format=yaml 1>"+yamldefout) + if rc!=0: + print("failed to export the \""+objtype+"\" type object \""+objname+"\"\n") + rcyaml=1 + else: + print("==============the exported inventory file "+yamldefout+"======================\n") + runCommand("cat "+yamldefout) + print("===========================================================================\n") + myattrvalue=GetAttrInFile(yamldefout,objtype,objname,attribute) + if attrvalue == '': + if myattrvalue is not None: + rcyaml=1 + else: + if myattrvalue != attrvalue: + rcyaml=1 -RETCODE_YAML=0 -RETCODE_JSON=0 +if rcyaml == 0: + print("yaml validation passed\n") +else: + print("yaml validation failed\n") -[ -e "$tmpdir" ] || rm -rf $tmpdir -mkdir -p $tmpdir -echo "Temporary directory to hold intermediate files: $tmpdir" +removeobj(objtype,objname) -cp ${DIR}/templates/${objtype}.json ${tmpdir}/ -cp ${DIR}/templates/${objtype}.yaml ${tmpdir}/ - -#the intermediate inventory files to import -yamldef="${tmpdir}/${objtype}.yaml" -jsondef="${tmpdir}/${objtype}.json" - -#the intermediate inventory files exported -yamldefout="${tmpdir}/${objtype}.out.yaml" -jsondefout="${tmpdir}/${objtype}.out.json" - -echo "removing existing \"$objtype\" type object \"$objname\" from xCAT" -echo "osimage node network site route zone policy "|grep -q -w "$objtype" -if [ $? -eq 0 ];then - rmdef -t $objtype -o $objname -fi -if [ "$objtype" = "passwd" ];then - tabch -d key=$objname passwd -fi - -#substitute the attribute value in inventory files -if [ ${#attrvalue} -ne 0 ];then - sed -i -E -e "s/^(\s*["'"'"']?$attribute["'"'"']?:\s*["'"'"']?)[^'"'"'"]*(["'"'"']?[,]?\s*)$/\1$attrvalue\2/g" $yamldef -else - sed -i -e "/^\s*["'"'"']*$attribute["'"'"']*:/d" $yamldef -fi - -echo "=================the inventory file to import: ${yamldef}=====================" -cat $yamldef -echo "==============================================================================" +UpdateAttrInFile(jsondef,'json',objtype,objname,attribute,attrvalue) +print("=================the inventory file to import: "+jsondef+"=====================\n") +runCommand("cat "+jsondef) +print("===============================================================================\n") -echo "import the inventory file $yamldef " -xcat-inventory import -t $objtype -o $objname -f $yamldef -if [ $? -ne 0 ];then - echo "failed to import the inventory file $yamldef" - RETCODE_YAML=1 -else - echo "the inventory file $yamldef imported successfully" - echo "export the \"$objtype\" type object \"$objname\" just imported" - xcat-inventory export -t $objtype -o $objname --format=yaml 1>$yamldefout - if [ $? -ne 0 ];then - echo "failed to export the \"$objtype\" type object \"$objname\"" - RETCODE_YAML=1 - else - echo "the inventory data of the \"$objtype\" type object \"$objname\" exported to $yamldefout" - echo "==============the exported inventory file $yamldefout======================" - cat $yamldefout - echo "===========================================================================" - echo "make sure the attribute $attribute is imported and exported successfully" - if [ -n "$attrvalue" ]; then - cat $yamldefout|grep -w "$attribute"|grep -q -w "$attrvalue" - if [ $? -ne 0 ];then - RETCODE_YAML=1 - fi - else - cat $yamldefout|grep -q -w "$attribute" - if [ $? -eq 0 ];then - RETCODE_YAML=1 - fi - fi +print("import the inventory file "+jsondef+"\n") +rc=runCommand("xcat-inventory import -t "+objtype+" -o "+objname+" -f "+jsondef) +print("rc="+str(rc)) +if rc !=0: + print("failed to import the inventory file "+jsondef) + rcjson=1 +else: + print("the inventory file "+jsondef+" imported successfully\n") + print("export the \""+objtype+"\" type object \""+objname+"\" just imported\n") + rc=runCommand("xcat-inventory export -t "+objtype+" -o "+objname+" --format=json 1>"+jsondefout) + if rc!=0: + print("failed to export the \""+objtype+"\" type object \""+objname+"\"\n") + rcjson=1 + else: + print("==============the exported inventory file "+jsondefout+"======================\n") + runCommand("cat "+jsondefout) + print("===========================================================================\n") + myattrvalue=GetAttrInFile(jsondefout,objtype,objname,attribute) + if attrvalue == '': + if myattrvalue is not None: + rcjson=1 + else: + if myattrvalue != attrvalue: + rcjson=1 + +if rcjson ==0: + print("json validation passed\n") +else: + print("json validation failed\n") + +removeobj(objtype,objname) + +if rcjson !=0 or rcyaml!=0: + rcfinal=1 + +print("remove intermediate directory "+tmpdir) +if os.path.exists(tmpdir): + runCommand("rm -rf "+tmpdir) + +exit(rcfinal) - fi -fi - -if [ $RETCODE_YAML -eq 0 ]; then - echo "yaml validation passed" -else - echo "yaml validation failed" -fi - -echo "removing existing \"$objtype\" type object \"$objname\" from xCAT" -echo "osimage node network site route zone policy "|grep -q -w "$objtype" -if [ $? -eq 0 ];then - rmdef -t $objtype -o $objname -fi - -if [ "$objtype" = "passwd" ];then - tabch -d key=$objname passwd -fi - - -if [ ${#attrvalue} -ne 0 ];then - sed -i -E -e "s/^(\s*["'"'"']?$attribute["'"'"']?:\s*["'"'"']?)[^'"'"'"]*(["'"'"']?[,]?\s*)$/\1$attrvalue\2/g" $jsondef -else - sed -i -e "/^\s*["'"'"']*$attribute["'"'"']*:/d" $jsondef -fi - -echo "=================the inventory file to import: ${jsondef}=====================" -cat $jsondef -echo "==============================================================================" - -echo "import the inventory file $jsondef " -xcat-inventory import -t $objtype -o $objname -f $jsondef -if [ $? -ne 0 ];then - echo "failed to import the inventory file $jsondef" - RETCODE_JSON=1 -else - xcat-inventory export -t $objtype -o $objname 1>$jsondefout - if [ $? -ne 0 ];then - echo "the inventory file $jsondef imported successfully" - echo "export the \"$objtype\" type object \"$objname\" just imported" - RETCODE_JSON=1 - else - echo "the inventory data of the \"$objtype\" type object \"$objname\" exported to $jsondefout" - echo "==============the exported inventory file $jsondefout======================" - cat $jsondefout - echo "===========================================================================" - echo "make sure the attribute $attribute is imported and exported successfully" - if [ -n "$attrvalue" ]; then - cat $jsondefout|grep -w "$attribute"|grep -q -w "$attrvalue" - if [ $? -ne 0 ];then - RETCODE_JSON=1 - fi - else - cat $jsondefout|grep -q -w "$attribute" - if [ $? -eq 0 ];then - RETCODE_JSON=1 - fi - fi - - fi -fi - -if [ $RETCODE_JSON -eq 0 ]; then - echo "json validation passed" -else - echo "json validation failed" -fi - - -echo "osimage node network site route zone policy "|grep -q -w "$objtype" -if [ $? -eq 0 ];then - rmdef -t $objtype -o $objname -fi - -if [ "$objtype" = "passwd" ];then - tabch -d key=$objname passwd -fi - -echo "remove intermediate directory $tmpdir" -[ -e "$tmpdir" ] || rm -rf $tmpdir - -if [ $RETCODE_YAML -ne 0 ] || [ $RETCODE_JSON -ne 0 ]; then - exit 1 -fi - -exit 0 From 9fe1bac09a6145281eb450de48b54a198f28c2c2 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 28 Mar 2018 03:39:46 -0400 Subject: [PATCH 097/161] rewrite validatehelper with python to process complex scenario --- .../testcase/xcat-inventory/validatehelper | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper index ab21b0cfa..501db3406 100755 --- a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper +++ b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper @@ -50,6 +50,7 @@ def Util_setdictval(mydict,keystr,value): else: mydict[key]=value + def GetAttrInFile(fpath,objtype,objname,attrpath): f=open(fpath,'r') try: @@ -63,10 +64,23 @@ def GetAttrInFile(fpath,objtype,objname,attrpath): f.close() myattrpath=objtype+"."+objname+"."+attrpath myvalue=Util_getdictval(objdict,myattrpath) - if isinstance(myvalue,list): - myvalue=myvalue[0] return myvalue +def compattr(exptattr,rawattr): + if isinstance(exptattr,list) and isinstance(rawattr,str): + rawattr=eval(rawattr) + if isinstance(rawattr,str): + if rawattr in exptattr: + return 0 + else: + return 1 + else: + return cmp(exptattr,rawattr) + else: + return cmp(exptattr,rawattr) + + + def runCommand(cmd, env=None): """ Run one command only, when you don't want to bother setting up the Popen stuff. @@ -106,10 +120,15 @@ def UpdateAttrInFile(fpath,fformat,objtype,objname,attrpath,value): Util_rmnullindict(objdict) else: origobjdict=Util_getdictval(objdict,myattrpath) - if isinstance(origobjdict,list) and not isinstance(value,list): - newvalue=[value] + origattrtype=type(origobjdict) + if origattrtype != str and type(value) == str: + print(value) + newvalue=eval(value) else: - newvalue=value + if isinstance(origobjdict,list) and isinstance(value,str): + newvalue=[value] + else: + newvalue=value Util_setdictval(objdict,myattrpath,newvalue) f=open(fpath,'w') if fformat == "yaml": @@ -191,7 +210,7 @@ else: if myattrvalue is not None: rcyaml=1 else: - if myattrvalue != attrvalue: + if compattr(myattrvalue,attrvalue) != 0 : rcyaml=1 if rcyaml == 0: @@ -229,7 +248,7 @@ else: if myattrvalue is not None: rcjson=1 else: - if myattrvalue != attrvalue: + if compattr(myattrvalue,attrvalue) != 0 : rcjson=1 if rcjson ==0: From 4dbbd5f3be32d608dc03103274e239373f411d43 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 28 Mar 2018 05:53:12 -0400 Subject: [PATCH 098/161] refine validatehelper --- .../xcat-inventory/cases.osimage.validation | 10 ++++---- .../testcase/xcat-inventory/validatehelper | 25 ++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation index 917ee8a1d..372a34020 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation @@ -38,15 +38,15 @@ cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper check: rc!=0 -cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "nfs" "/tmp/xcat_inventory_import_validation_osimage/trash/" +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "genimgoptions.rootfstype" "nfs" "/tmp/xcat_inventory_import_validation_osimage/trash/" check: rc==0 -cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "ramdisk" "/tmp/xcat_inventory_import_validation_osimage/trash/" +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "genimgoptions.rootfstype" "ramdisk" "/tmp/xcat_inventory_import_validation_osimage/trash/" check: rc==0 -cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "invalid" "/tmp/xcat_inventory_import_validation_osimage/trash/" +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "genimgoptions.rootfstype" "invalid" "/tmp/xcat_inventory_import_validation_osimage/trash/" check: rc!=0 -cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "rootfstype" "" "/tmp/xcat_inventory_import_validation_osimage/trash/" +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "genimgoptions.rootfstype" "" "/tmp/xcat_inventory_import_validation_osimage/trash/" check: rc==0 -cmd: cat /tmp/xcat_inventory_import_validation_osimage/backup/testosimage1.stanza 2>/dev/null |mkdef -z +cmd: cat /tmp/xcat_inventory_import_validation_osimage/backup/testosimage1.stanza 2>/dev/null |mkdef -z -f cmd: rm -rf /tmp/xcat_inventory_import_validation_osimage end diff --git a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper index 501db3406..bedc695a7 100755 --- a/xCAT-test/autotest/testcase/xcat-inventory/validatehelper +++ b/xCAT-test/autotest/testcase/xcat-inventory/validatehelper @@ -67,15 +67,13 @@ def GetAttrInFile(fpath,objtype,objname,attrpath): return myvalue def compattr(exptattr,rawattr): - if isinstance(exptattr,list) and isinstance(rawattr,str): + if isinstance(exptattr,list) and re.match(r'^\[.*\]$',rawattr): rawattr=eval(rawattr) - if isinstance(rawattr,str): - if rawattr in exptattr: - return 0 - else: - return 1 + if isinstance(rawattr,str): + if rawattr in exptattr: + return 0 else: - return cmp(exptattr,rawattr) + return 1 else: return cmp(exptattr,rawattr) @@ -121,14 +119,13 @@ def UpdateAttrInFile(fpath,fformat,objtype,objname,attrpath,value): else: origobjdict=Util_getdictval(objdict,myattrpath) origattrtype=type(origobjdict) - if origattrtype != str and type(value) == str: - print(value) + newvalue=value + if origattrtype == list and re.match(r'^\[.*\]$',value): + #import pdb + #pdb.set_trace() newvalue=eval(value) - else: - if isinstance(origobjdict,list) and isinstance(value,str): - newvalue=[value] - else: - newvalue=value + if isinstance(origobjdict,list) and isinstance(newvalue,str): + newvalue=[newvalue] Util_setdictval(objdict,myattrpath,newvalue) f=open(fpath,'w') if fformat == "yaml": From 8f61ee5aceacd0ee4278cf7b3d4f905a25c23828 Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 29 Mar 2018 05:50:04 -0400 Subject: [PATCH 099/161] Add ondiscover support for chain table (#4903) * Add ondiscover support for chain table * For ondiscover, run nextdestiny after the current operation is done * Don't set OpenPower server boot from network if boot --- xCAT-genesis-scripts/usr/bin/doxcat | 20 ++++++++++++++------ xCAT-server/lib/xcat/plugins/destiny.pm | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/xCAT-genesis-scripts/usr/bin/doxcat b/xCAT-genesis-scripts/usr/bin/doxcat index e5bbe71b0..1e909551d 100755 --- a/xCAT-genesis-scripts/usr/bin/doxcat +++ b/xCAT-genesis-scripts/usr/bin/doxcat @@ -359,17 +359,17 @@ while :; do logger -s -t $log_label -p local4.info "Running nextdestiny $XCATMASTER:$XCATPORT..." destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT` logger -s -t $log_label -p local4.info "nextdestiny - Complete." + elif [ "$dest" = ondiscover ]; then + logger -s -t $log_label -p local4.info "Running nextdestiny (ondiscover) $XCATMASTER:$XCATPORT..." + destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT` + logger -s -t $log_label -p local4.info "nextdestiny (ondiscover) - Complete." elif [ "$dest" = runcmd ]; then + $destparameter logger -s -t $log_label -p local4.info "Running nextdestiny $XCATMASTER:$XCATPORT..." destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT` dest=`echo $destiny|awk -F= '{print $1}'` - $destparameter logger -s -t $log_label -p local4.info "nextdestiny - Complete." elif [ "$dest" = runimage ]; then - logger -s -t $log_label -p local4.info "Running nextdestiny $XCATMASTER:$XCATPORT..." - destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT` - dest=`echo $destiny|awk -F= '{print $1}'` - logger -s -t $log_label -p local4.info "nextdestiny - Complete." mkdir /tmp/`basename $destparameter` cd /tmp/`basename $destparameter` eval destparameter=$destparameter @@ -389,12 +389,20 @@ while :; do tar xvf `basename $destparameter` ./runme.sh cd - + logger -s -t $log_label -p local4.info "Running nextdestiny $XCATMASTER:$XCATPORT..." + destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT` + dest=`echo $destiny|awk -F= '{print $1}'` + logger -s -t $log_label -p local4.info "nextdestiny - Complete." + elif [ "$dest" = "reboot" -o "$dest" = "boot" ]; then logger -s -t $log_label -p local4.info "Running nextdestiny $XCATMASTER:$XCATPORT..." /bin/nextdestiny $XCATMASTER:$XCATPORT logger -s -t $log_label -p local4.info "nextdestiny - Complete." if [ $IPMI_SUPPORT -ne 0 ]; then - ipmitool chassis bootdev pxe + # Set boot from network will cause OpenPOWER server wait at petitboot menu, so do nothing here + if uname -m | grep x86_64; then + ipmitool chassis bootdev pxe + fi fi reboot -f elif [ "$dest" = "install" -o "$dest" = "netboot" ]; then diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 48b8411a2..38f16ed1b 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -226,6 +226,25 @@ sub setdestiny { if ($ient->{initrd}) { $bphash->{initrd} = $ient->{initrd} } if ($ient->{kcmdline}) { $bphash->{kcmdline} = $ient->{kcmdline} } } + } elsif ($state =~ /ondiscover/) { + my $target; + if ($state =~ /=/) { + ($state, $target) = split '=', $state, 2; + } + if(!$target){ + $callback->({ error => "invalid argument: \"$state\"", errorcode => [1] }); + return; + } + my @cmds = split '\|', $target; + foreach my $tmpnode (@{ $req->{node} }) { + foreach my $cmd (@cmds) { + my $action; + ($cmd, $action) = split ':', $cmd; + my $runcmd = "$cmd $tmpnode $action"; + xCAT::Utils->runcmd($runcmd, 0); + xCAT::MsgUtils->trace($verbose, "d", "run ondiscover command: $runcmd"); + } + } } elsif ($state =~ /^install[=\$]/ or $state eq 'install' or $state =~ /^netboot[=\$]/ or $state eq 'netboot' or $state eq "image" or $state eq "winshell" or $state =~ /^osimage/ or $state =~ /^statelite/) { my $target; my $action; From ade70242f7ca676664fb9292e01ebf1f38632acc Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 29 Mar 2018 06:09:26 -0400 Subject: [PATCH 100/161] add test cases for xcat-inventory validation -- node part --- .../testcase/xcat-inventory/cases.node | 1392 +++++++---------- .../xcat-inventory/templates/node.json | 970 ++++++++++++ .../xcat-inventory/templates/node.yaml | 741 +++++++++ 3 files changed, 2257 insertions(+), 846 deletions(-) create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/node.json create mode 100644 xCAT-test/autotest/testcase/xcat-inventory/templates/node.yaml diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.node b/xCAT-test/autotest/testcase/xcat-inventory/cases.node index c91b9c24d..7489a031a 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.node +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.node @@ -1979,957 +1979,657 @@ cmd:rm -rf /tmp/export_import_single_group_yaml check:rc==0 end -start:import_validation_json_node_obj_type -description:This case is used to test node validation function of xcat-inventory import json file. To test "obj_type" attribute -cmd:mkdir -p /tmp/import_validation_json_node_obj_type +start:import_validation_node_obj_type +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "obj_type" attribute +cmd:mkdir -p /tmp/import_validation_node_obj_type_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_obj_type/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_obj_type_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_obj_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "server", - "network_info": { - "primarynic": { - "mac": [ - "11:11:11:11:11:11" - ] - } - }, - "obj_info": { - "groups": "bogusgroup" - }, - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_obj_type/node.json +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_obj_type_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~Error: failed to validate attribute -check:output=~obj_type +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "obj_type" "" "import_validation_node_obj_type" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "obj_type" "aaa" "import_validation_node_obj_type" check:rc!=0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "server", - "network_info": { - "primarynic": { - "mac": [ - "11:11:11:11:11:11" - ] - } - }, - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "aaa", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_obj_type/node.json +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "obj_type" "node" "import_validation_node_obj_type" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~Error: failed to validate attribute -check:output=~obj_type +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "obj_type" "group" "import_validation_node_obj_type" +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_obj_type_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_obj_type_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_obj_type_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_obj_type_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_obj_type_bak +check:rc==0 +end + +start:import_validation_node_obj_info_groups +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "obj_info.groups" attribute +cmd:mkdir -p /tmp/import_validation_node_obj_info_groups_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_obj_info_groups_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_obj_info_groups_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "obj_info.groups" "" "import_validation_node_obj_info_groups" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "obj_info.groups" "aaa" "import_validation_node_obj_info_groups" +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_obj_info_groups_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_obj_info_groups_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_obj_info_groups_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_obj_info_groups_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_obj_info_groups_bak +check:rc==0 +end + +start:import_validation_node_device_type +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "device_type" attribute +cmd:mkdir -p /tmp/import_validation_node_device_type_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_device_type_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_device_type_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_type" "" "import_validation_node_device_type" check:rc!=0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "server", - "network_info": { - "primarynic": { - "mac": [ - "11:11:11:11:11:11" - ] - } - }, - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_obj_type/node.json +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_type" "aaa" "import_validation_node_device_type" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_type" "switch" "import_validation_node_device_type" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~Inventory import successfully +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_type" "pdu" "import_validation_node_device_type" check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_type" "rack" "import_validation_node_device_type" check:rc==0 -cmd:rmdef bogusnode +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_type" "hmc" "import_validation_node_device_type" check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusgroup": { - "device_type": "server", - "engines": { - "hardware_mgt_engine": { - "engine_type": "ipmi" - } - }, - "obj_info": { - "grouptype": "static" - }, - "obj_type": "group", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_obj_type/node.json +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_type" "server" "import_validation_node_device_type" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_obj_type/node.json -check:output=~Inventory import successfully +cmd:if [[ -e /tmp/import_validation_node_device_type_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_device_type_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:lsdef -t group -o bogusgroup -check:output=~Object name: bogusgroup +cmd:if [[ -e /tmp/import_validation_node_device_type_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_device_type_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:rmdef -t group -o bogusgroup +cmd:rm -rf /tmp/import_validation_node_device_type_bak check:rc==0 -cmd:if [[ -e /tmp/import_validation_json_node_obj_type/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_obj_type/bogusnode.stanza | mkdef -z;fi +end + +start:import_validation_node_device_info_arch +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "device_info.arch" attribute +cmd:mkdir -p /tmp/import_validation_node_device_info_arch_bak check:rc==0 -cmd:if [[ -e /tmp/import_validation_json_node_obj_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_obj_type/bogusgroup.stanza |mkdef -z -f;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_device_info_arch_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:rm -rf /tmp/import_validation_json_node_obj_type +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_device_info_arch_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_info.arch" "" "import_validation_node_device_info_arch" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_info.arch" "aaa" "import_validation_node_device_info_arch" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_info.arch" "ppc64" "import_validation_node_device_info_arch" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_info.arch" "ppc64el" "import_validation_node_device_info_arch" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_info.arch" "ppc64le" "import_validation_node_device_info_arch" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_info.arch" "x86_64" "import_validation_node_device_info_arch" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "device_info.arch" "armv7l" "import_validation_node_device_info_arch" +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_device_info_arch_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_device_info_arch_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_device_info_arch_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_device_info_arch_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_device_info_arch_bak +check:rc==0 +end + +start:import_validation_node_security_info_snmp_securitylevel +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "security_info.snmp.securitylevel" attribute +cmd:mkdir -p /tmp/import_validation_node_security_info_snmp_securitylevel_bak +check:rc==0 +cmd:lsdef boguspdu > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef boguspdu -z >/tmp/import_validation_node_security_info_snmp_securitylevel_bak/boguspdu.stanza ;rmdef boguspdu;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_security_info_snmp_securitylevel_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.securitylevel" "" "/tmp/import_validation_node_security_info_snmp_securitylevel" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.securitylevel" "noAuthNoPriv" "/tmp/import_validation_node_security_info_snmp_securitylevel" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.securitylevel" "authNoPriv" "/tmp/import_validation_node_security_info_snmp_securitylevel" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.securitylevel" "authPriv" "/tmp/import_validation_node_security_info_snmp_securitylevel" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.securitylevel" "aaaaa" "/tmp/import_validation_node_security_info_snmp_securitylevel" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.securitylevel" "noauthnopriv" "/tmp/import_validation_node_security_info_snmp_securitylevel" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_security_info_snmp_securitylevel_bak/boguspdu.stanza ]]; then cat /tmp/import_validation_node_security_info_snmp_securitylevel_bak/boguspdu.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_security_info_snmp_securitylevel_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_security_info_snmp_securitylevel_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_security_info_snmp_securitylevel_bak +check:rc==0 +end + +start:import_validation_node_security_info_snmp_authprotocol +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "security_info.snmp.authprotocol" attribute +cmd:mkdir -p /tmp/import_validation_node_security_info_snmp_authprotocol_bak +check:rc==0 +cmd:lsdef boguspdu > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef boguspdu -z >/tmp/import_validation_node_security_info_snmp_authprotocol_bak/boguspdu.stanza ;rmdef boguspdu;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_security_info_snmp_authprotocol_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.authprotocol" "" "/tmp/import_validation_node_security_info_snmp_authprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.authprotocol" "MD5" "/tmp/import_validation_node_security_info_snmp_authprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.authprotocol" "SHA" "/tmp/import_validation_node_security_info_snmp_authprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.authprotocol" "aaaa" "/tmp/import_validation_node_security_info_snmp_authprotocol" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.authprotocol" "md5" "/tmp/import_validation_node_security_info_snmp_authprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.authprotocol" "sha" "/tmp/import_validation_node_security_info_snmp_authprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "boguspdu" "security_info.snmp.authprotocol" "SHA256" "/tmp/import_validation_node_security_info_snmp_authprotocol" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_security_info_snmp_authprotocol_bak/boguspdu.stanza ]]; then cat /tmp/import_validation_node_security_info_snmp_authprotocol_bak/boguspdu.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_security_info_snmp_authprotocol_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_security_info_snmp_authprotocol_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_security_info_snmp_authprotocol_bak check:rc==0 end -start:import_validation_yaml_node_obj_type -description:This case is used to test node validation function of xcat-inventory import yaml file. To test "obj_type" attribute -cmd:mkdir -p /tmp/import_validation_yaml_node_obj_type +start:import_validation_node_security_info_snmp_privacyprotocol +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "security_info.snmp.privacyprotocol" attribute +cmd:mkdir -p /tmp/import_validation_node_security_info_snmp_privacyprotocol_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_obj_type/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusswitch > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusswitch -z >/tmp/import_validation_node_security_info_snmp_privacyprotocol_bak/bogusswitch.stanza ;rmdef bogusswitch;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_obj_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: server - network_info: - primarynic: - mac: - - '11:11:11:11:11:11' - obj_info: - groups: bogusgroup - role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_security_info_snmp_privacyprotocol_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~Error: failed to validate attribute -check:output=~obj_type +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.snmp.privacyprotocol" "AES" "/tmp/import_validation_node_security_info_snmp_privacyprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.snmp.privacyprotocol" "DES" "/tmp/import_validation_node_security_info_snmp_privacyprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.snmp.privacyprotocol" "authNoPriv" "/tmp/import_validation_node_security_info_snmp_privacyprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.snmp.privacyprotocol" "" "/tmp/import_validation_node_security_info_snmp_privacyprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.snmp.privacyprotocol" "authnopriv" "/tmp/import_validation_node_security_info_snmp_privacyprotocol" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.snmp.privacyprotocol" "aaaa" "/tmp/import_validation_node_security_info_snmp_privacyprotocol" check:rc!=0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: server - network_info: - primarynic: - mac: - - '11:11:11:11:11:11' - obj_info: - groups: bogusgroup - obj_type: aaa - role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml +cmd:if [[ -e /tmp/import_validation_node_security_info_snmp_privacyprotocol_bak/bogusswitch.stanza ]]; then cat /tmp/import_validation_node_security_info_snmp_privacyprotocol_bak/bogusswitch.stanza | mkdef -z;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~Error: failed to validate attribute -check:output=~obj_type -check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' -check:rc!=0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: server - network_info: - primarynic: - mac: - - '11:11:11:11:11:11' - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml +cmd:if [[ -e /tmp/import_validation_node_security_info_snmp_privacyprotocol_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_security_info_snmp_privacyprotocol_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusgroup: - device_type: server - engines: - hardware_mgt_engine: - engine_type: ipmi - obj_info: - grouptype: static - obj_type: group - role: compute" > /tmp/import_validation_yaml_node_obj_type/node.yaml -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_obj_type/node.yaml -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef -t group -o bogusgroup -check:output=~Object name: bogusgroup -check:rc==0 -cmd:rmdef -t group -o bogusgroup -check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_obj_type/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_obj_type/bogusnode.stanza | mkdef -z;fi -check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_obj_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_obj_type/bogusgroup.stanza |mkdef -z -f;fi -check:rc==0 -cmd:rm -rf /tmp/import_validation_yaml_node_obj_type +cmd:rm -rf /tmp/import_validation_node_security_info_snmp_privacyprotocol_bak check:rc==0 end -start:import_validation_json_node_group -description:This case is used to test node validation function of xcat-inventory import json file. To test "group" attribute -cmd:mkdir -p /tmp/import_validation_json_node_group +start:import_validation_node_security_info_remotecontrol_remoteprotocol +descrremoteprotocoltion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "security_info.remotecontrol.remoteprotocol" attribute +cmd:mkdir -p /tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_group/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusswitch > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusswitch -z >/tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak/bogusswitch.stanza ;rmdef bogusswitch;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_group/bogusgroup.stanza; rmdef -t group bogusgroup;fi +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "server", - "network_info": { - "primarynic": { - "mac": [ - "11:11:11:11:11:11" - ] - } - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_group/node.inv +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.remotecontrol.remoteprotocol" "telnet" "/tmp/import_validation_node_security_info_remotecontrol_remoteprotocol" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_group/node.inv -check:output=~Error: failed to validate attribute -check:output=~group +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.remotecontrol.remoteprotocol" "ssh" "/tmp/import_validation_node_security_info_remotecontrol_remoteprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.remotecontrol.remoteprotocol" "" "/tmp/import_validation_node_security_info_remotecontrol_remoteprotocol" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.remotecontrol.remoteprotocol" "SSH" "/tmp/import_validation_node_security_info_remotecontrol_remoteprotocol" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusswitch" "security_info.remotecontrol.remoteprotocol" "aaa" "/tmp/import_validation_node_security_info_remotecontrol_remoteprotocol" check:rc!=0 -cmd:if [[ -e /tmp/import_validation_json_node_group/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_group/bogusnode.stanza | mkdef -z;fi +cmd:if [[ -e /tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak/bogusswitch.stanza ]]; then cat /tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak/bogusswitch.stanza | mkdef -z;fi check:rc==0 -cmd:if [[ -e /tmp/import_validation_json_node_group/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_group/bogusgroup.stanza |mkdef -z -f;fi +cmd:if [[ -e /tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:rm -rf /tmp/import_validation_json_node_group +cmd:rm -rf /tmp/import_validation_node_security_info_remotecontrol_remoteprotocol_bak check:rc==0 end -start:import_validation_yaml_node_group -description:This case is used to test node validation function of xcat-inventory import yaml file. To test "group" attribute -cmd:mkdir -p /tmp/import_validation_yaml_node_group +start:import_validation_node_network_info_primarynic_ip +description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "network_info.primarynic.ip" attribute +cmd:mkdir -p /tmp/import_validation_node_network_info_primarynic_ip_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_group/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_network_info_primarynic_ip_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_group/bogusgroup.stanza; rmdef -t group bogusgroup;fi +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_network_info_primarynic_ip_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: server - network_info: - primarynic: - mac: - - '11:11:11:11:11:11' - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_group/node.inv +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.ip" "" "/tmp/import_validation_node_network_info_primarynic_ip" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_group/node.inv -check:output=~Error: failed to validate attribute -check:output=~group +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.ip" "100.100.100.100" "/tmp/import_validation_node_network_info_primarynic_ip" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.ip" "100.100.100.a" "/tmp/import_validation_node_network_info_primarynic_ip" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.ip" "100.100" "/tmp/import_validation_node_network_info_primarynic_ip" check:rc!=0 -cmd:if [[ -e /tmp/import_validation_yaml_node_group/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_group/bogusnode.stanza | mkdef -z;fi +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.ip" "fe80::40d6:aff:fe03:508" "/tmp/import_validation_node_network_info_primarynic_ip" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_ip_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_ip_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_group/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_group/bogusgroup.stanza |mkdef -z -f;fi +cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_ip_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_ip_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:rm -rf /tmp/import_validation_yaml_node_group +cmd:rm -rf /tmp/import_validation_node_network_info_primarynic_ip_bak check:rc==0 end -start:import_validation_json_node_device_type -description:This case is used to test node validation function of xcat-inventory import json file. To test "device_type" attribute -cmd:mkdir -p /tmp/import_validation_json_node_device_type +start:import_validation_node_network_info_primarynic_mac +descrmaction:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "network_info.primarynic.mac" attribute +cmd:mkdir -p /tmp/import_validation_node_network_info_primarynic_mac_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_device_type/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_network_info_primarynic_mac_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_device_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_network_info_primarynic_mac_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_device_type/node.inv +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.mac" "" "/tmp/import_validation_node_network_info_primarynic_mac" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Error: failed to validate attribute -check:output=~devtype +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.mac" "42:d6:0a:03:05:08" "/tmp/import_validation_node_network_info_primarynic_mac" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.mac" "42:6:a:03:05:08" "/tmp/import_validation_node_network_info_primarynic_mac" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.mac" "42:d6:0a:03:05:08:05:08" "/tmp/import_validation_node_network_info_primarynic_mac" check:rc!=0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "aaa", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_device_type/node.inv +cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_mac_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_mac_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Error: failed to validate attribute -check:output=~devtype +cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_mac_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_mac_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_network_info_primarynic_mac_bak +check:rc==0 +end + +start:import_validation_node_nics_network_info_nics_ips +descrnics_network_info_nics_ipstion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "network_info.nics.ips" attribute +cmd:mkdir -p /tmp/import_validation_node_nics_network_info_nics_ips_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_nics_network_info_nics_ips_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_nics_network_info_nics_ips_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.nics.eth0.ips" "" "/tmp/import_validation_node_nics_network_info_nics_ips" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.nics.eth0.ips" "['192.168.30.101','192.168.30.102']" "/tmp/import_validation_node_nics_network_info_nics_ips" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.nics.eth0.ips" "|\D+(\d+)|30.0.0.($1%100)|" "/tmp/import_validation_node_nics_network_info_nics_ips" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.nics.eth0.ips" "10.10" "/tmp/import_validation_node_nics_network_info_nics_ips" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.nics.eth0.ips" "aa" "/tmp/import_validation_node_nics_network_info_nics_ips" check:rc!=0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "server", - "network_info": { - "primarynic": { - "mac": [ - "11:11:11:11:11:11" - ] - } - }, - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_device_type/node.inv +cmd:if [[ -e /tmp/import_validation_node_nics_network_info_nics_ips_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_nics_network_info_nics_ips_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Inventory import successfully +cmd:if [[ -e /tmp/import_validation_node_nics_network_info_nics_ips_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_nics_network_info_nics_ips_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "switch", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "pdu", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "hmc", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_type": "rack", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:if [[ -e /tmp/import_validation_json_node_device_type/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_device_type/bogusnode.stanza | mkdef -z;fi -check:rc==0 -cmd:if [[ -e /tmp/import_validation_json_node_device_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_device_type/bogusgroup.stanza |mkdef -z -f;fi -check:rc==0 -cmd:rm -rf /tmp/import_validation_json_node_device_type +cmd:rm -rf /tmp/import_validation_node_nics_network_info_nics_ips_bak check:rc==0 end -start:import_validation_yaml_node_device_type -description:This case is used to test node validation function of xcat-inventory import yaml file. To test "device_type" attribute -cmd:mkdir -p /tmp/import_validation_yaml_node_device_type +start:import_validation_node_network_info_primarynic_switchport +descrswitchporttion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "network_info.primarynic.switchport" attribute +cmd:mkdir -p /tmp/import_validation_node_network_info_primarynic_switchport_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_device_type/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_device_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.switchport" "" "/tmp/import_validation_node_network_info_primarynic_switchport" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Error: failed to validate attribute -check:output=~devtype +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.switchport" "70" "/tmp/import_validation_node_network_info_primarynic_switchport" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "network_info.primarynic.switchport" "a90" "/tmp/import_validation_node_network_info_primarynic_switchport" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' -check:rc!=0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: aaa - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Error: failed to validate attribute -check:output=~devtype -check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' -check:rc!=0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: switch - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv +cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: pdu - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: rack - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: hmc - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_type: server - network_info: - primarynic: - mac: - - '11:11:11:11:11:11' - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_device_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_device_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_device_type/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_device_type/bogusnode.stanza | mkdef -z;fi -check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_device_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_device_type/bogusgroup.stanza |mkdef -z -f;fi -check:rc==0 -cmd:rm -rf /tmp/import_validation_yaml_node_device_type +cmd:rm -rf /tmp/import_validation_node_network_info_primarynic_switchport_bak check:rc==0 end -start:import_validation_json_node_arch_type -description:This case is used to test node validation function of xcat-inventory import json file. To test "arch" attribute -cmd:mkdir -p /tmp/import_validation_json_node_arch_type +start:import_validation_node_engines_hardware_mgt_engine_engine_type +descrengine_typetion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "engines.hardware_mgt_engine.engine_type" attribute +cmd:mkdir -p /tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_json_node_arch_type/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_json_node_arch_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_info": { - "arch": "ppc" - }, - "device_type": "server", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_arch_type/node.inv +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "openbmc" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv -check:output=~Error: failed to validate attribute -check:output=~arch +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "ipmi" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "hmc" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "fsp" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "kvm" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "mp" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "bpa" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "ivm" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "blade" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "HMC" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "OpenBMC" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" check:rc!=0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_info": { - "arch": "ppc64" - }, - "device_type": "server", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_arch_type/node.inv +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.hardware_mgt_engine.engine_type" "aaa" "/tmp/import_validation_node_engines_hardware_mgt_engine_engine_type" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv -check:output=~Inventory import successfully +cmd:if [[ -e /tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=ppc64 -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_info": { - "arch": "ppc64el" - }, - "device_type": "server", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_arch_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=ppc64el -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_info": { - "arch": "ppc64le" - }, - "device_type": "server", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_arch_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=ppc64le -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_info": { - "arch": "x86_64" - }, - "device_type": "server", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_arch_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=x86_64 -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo '{ - "node": { - "bogusnode": { - "device_info": { - "arch": "armv71" - }, - "device_type": "server", - "obj_info": { - "groups": "bogusgroup" - }, - "obj_type": "node", - "role": "compute" - } - }, -}' > /tmp/import_validation_json_node_arch_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_json_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=armv71 -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:if [[ -e /tmp/import_validation_json_node_arch_type/bogusnode.stanza ]]; then cat /tmp/import_validation_json_node_arch_type/bogusnode.stanza | mkdef -z;fi -check:rc==0 -cmd:if [[ -e /tmp/import_validation_json_node_arch_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_json_node_arch_type/bogusgroup.stanza |mkdef -z -f;fi -check:rc==0 -cmd:rm -rf /tmp/import_validation_json_node_arch_type +cmd:rm -rf /tmp/import_validation_node_engines_hardware_mgt_engine_engine_type_bak check:rc==0 end -start:import_validation_yaml_node_arch_type -description:This case is used to test node validation function of xcat-inventory import yaml file. To test "arch" attribute -cmd:mkdir -p /tmp/import_validation_yaml_node_arch_type + + +start:import_validation_node_engines_netboot_engine_engine_type +descrengine_typetion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "engines.netboot_engine.engine_type" attribute +cmd:mkdir -p /tmp/import_validation_node_engines_netboot_engine_engine_type_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_arch_type/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_engines_netboot_engine_engine_type_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_arch_type/bogusgroup.stanza; rmdef -t group bogusgroup;fi +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_engines_netboot_engine_engine_type_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_info: - arch: ppc - device_type: server - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "" "/tmp/import_validation_node_engines_netboot_engine_engine_type" check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv -check:output=~Error: failed to validate attribute -check:output=~arch +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "pxe" "/tmp/import_validation_node_engines_netboot_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "xnba" "/tmp/import_validation_node_engines_netboot_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "grub2" "/tmp/import_validation_node_engines_netboot_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "yaboot" "/tmp/import_validation_node_engines_netboot_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "petitboot" "/tmp/import_validation_node_engines_netboot_engine_engine_type" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "Grub2" "/tmp/import_validation_node_engines_netboot_engine_engine_type" check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "engines.netboot_engine.engine_type" "aaa" "/tmp/import_validation_node_engines_netboot_engine_engine_type" check:rc!=0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_info: - arch: ppc64 - device_type: server - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv +cmd:if [[ -e /tmp/import_validation_node_engines_netboot_engine_engine_type_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_engines_netboot_engine_engine_type_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv -check:output=~Inventory import successfully +cmd:if [[ -e /tmp/import_validation_node_engines_netboot_engine_engine_type_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_engines_netboot_engine_engine_type_bak/bogusgroup.stanza |mkdef -z -f;fi check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=ppc64 -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_info: - arch: ppc64el - device_type: server - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=ppc64el -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_info: - arch: ppc64le - device_type: server - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=ppc64le -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_info: - arch: x86_64 - device_type: server - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=x86_64 -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - device_info: - arch: armv71 - device_type: server - obj_info: - groups: bogusgroup - obj_type: node - role: compute" > /tmp/import_validation_yaml_node_arch_type/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_arch_type/node.inv -check:output=~Inventory import successfully -check:rc==0 -cmd:lsdef bogusnode -check:output=~Object name: bogusnode -check:output=~arch=armv71 -check:rc==0 -cmd:rmdef bogusnode -check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_arch_type/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_arch_type/bogusnode.stanza | mkdef -z;fi -check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_arch_type/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_arch_type/bogusgroup.stanza |mkdef -z -f;fi -check:rc==0 -cmd:rm -rf /tmp/import_validation_yaml_node_arch_type +cmd:rm -rf /tmp/import_validation_node_engines_netboot_engine_engine_type_bak check:rc==0 end -start:import_validation_yaml_node_securitylevel -description:This case is used to test node validation function of xcat-inventory import yaml file. To test "securitylevel" attribute -cmd:mkdir -p /tmp/import_validation_yaml_node_securitylevel -check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_yaml_node_securitylevel/bogusnode.stanza ;rmdef bogusnode;fi -check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_yaml_node_securitylevel/bogusgroup.stanza; rmdef -t group bogusgroup;fi -check:rc==0 -cmd:#!/bin/bash -echo "node: - bogusnode: - deprecated: - pdunodetype: pdu - device_info: - characteristics: pdu - device_type: server - obj_info: - groups: bogusgroup - obj_type: node - role: compute - security_info: - snmp: - securitylevel: noAuthNoPriv" >/tmp/import_validation_yaml_node_securitylevel/node.inv -check:rc==0 -cmd:xcat-inventory import -f /tmp/import_validation_yaml_node_securitylevel/node.inv -check:output=~Error: failed to validate attribute -check:output=~securitylevel -check:rc!=0 -cmd:lsdef bogusnode -check:output=~Error: Could not find an object named 'bogusnode' -check:rc!=0 -cmd:if [[ -e /tmp/import_validation_yaml_node_securitylevel/bogusnode.stanza ]]; then cat /tmp/import_validation_yaml_node_securitylevel/bogusnode.stanza | mkdef -z;fi +start:import_validation_node_role +descrroletion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role" attribute +cmd:mkdir -p /tmp/import_validation_node_role_bak check:rc==0 -cmd:if [[ -e /tmp/import_validation_yaml_node_securitylevel/bogusgroup.stanza ]]; then cat /tmp/import_validation_yaml_node_securitylevel/bogusgroup.stanza |mkdef -z -f;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:rm -rf /tmp/import_validation_yaml_node_securitylevel +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role" "compute" "/tmp/import_validation_node_role" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role" "service" "/tmp/import_validation_node_role" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role" "" "/tmp/import_validation_node_role" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role" "Compute" "/tmp/import_validation_node_role" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role" "aa" "/tmp/import_validation_node_role" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_bak check:rc==0 end + +start:import_validation_node_role_info_setuptftp +descrsetuptftption:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setuptftp" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setuptftp_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setuptftp_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setuptftp_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setuptftp" "" "/tmp/import_validation_node_role_info_setuptftp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setuptftp" "0" "/tmp/import_validation_node_role_info_setuptftp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setuptftp" "1" "/tmp/import_validation_node_role_info_setuptftp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setuptftp" "aa" "/tmp/import_validation_node_role_info_setuptftp" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setuptftp" "10" "/tmp/import_validation_node_role_info_setuptftp" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setuptftp_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setuptftp_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setuptftp_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setuptftp_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setuptftp_bak +check:rc==0 +end + +start:import_validation_node_role_info_setupnameserver +descrsetupnameservertion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupnameserver" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupnameserver_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupnameserver_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupnameserver_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnameserver" "" "/tmp/import_validation_node_role_info_setupnameserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnameserver" "0" "/tmp/import_validation_node_role_info_setupnameserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnameserver" "1" "/tmp/import_validation_node_role_info_setupnameserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnameserver" "2" "/tmp/import_validation_node_role_info_setupnameserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnameserver" "3" "/tmp/import_validation_node_role_info_setupnameserver" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnameserver" "a" "/tmp/import_validation_node_role_info_setupnameserver" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupnameserver_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupnameserver_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupnameserver_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupnameserver_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupnameserver_bak +end + + +start:import_validation_node_role_info_setupdhcp +descrsetupdhcption:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupdhcp" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupdhcp_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupdhcp_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupdhcp_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupdhcp" "" "/tmp/import_validation_node_role_info_setupdhcp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupdhcp" "0" "/tmp/import_validation_node_role_info_setupdhcp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupdhcp" "1" "/tmp/import_validation_node_role_info_setupdhcp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupdhcp" "2" "/tmp/import_validation_node_role_info_setupdhcp" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupdhcp" "a" "/tmp/import_validation_node_role_info_setupdhcp" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupdhcp_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupdhcp_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupdhcp_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupdhcp_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupdhcp_bak +end + +start:import_validation_node_role_info_setupntp +descrsetupntption:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupntp" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupntp_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupntp_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupntp_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupntp" "" "/tmp/import_validation_node_role_info_setupntp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupntp" "0" "/tmp/import_validation_node_role_info_setupntp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupntp" "1" "/tmp/import_validation_node_role_info_setupntp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupntp" "2" "/tmp/import_validation_node_role_info_setupntp" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupntp" "a" "/tmp/import_validation_node_role_info_setupntp" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupntp_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupntp_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupntp_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupntp_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupntp_bak +end + +start:import_validation_node_role_info_setupldap +descrsetupldaption:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupldap" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupldap_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupldap_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupldap_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupldap" "" "/tmp/import_validation_node_role_info_setupldap" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupldap" "0" "/tmp/import_validation_node_role_info_setupldap" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupldap" "1" "/tmp/import_validation_node_role_info_setupldap" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupldap" "2" "/tmp/import_validation_node_role_info_setupldap" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupldap" "a" "/tmp/import_validation_node_role_info_setupldap" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupldap_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupldap_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupldap_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupldap_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupldap_bak +end + +start:import_validation_node_role_info_setupproxydhcp +descrsetupproxydhcption:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupproxydhcp" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupproxydhcp_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupproxydhcp_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupproxydhcp_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupproxydhcp" "" "/tmp/import_validation_node_role_info_setupproxydhcp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupproxydhcp" "0" "/tmp/import_validation_node_role_info_setupproxydhcp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupproxydhcp" "1" "/tmp/import_validation_node_role_info_setupproxydhcp" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupproxydhcp" "2" "/tmp/import_validation_node_role_info_setupproxydhcp" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupproxydhcp" "a" "/tmp/import_validation_node_role_info_setupproxydhcp" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupproxydhcp_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupproxydhcp_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupproxydhcp_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupproxydhcp_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupproxydhcp_bak +end + +start:import_validation_node_role_info_setupipforward +descrsetupipforwardtion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupipforward" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupipforward_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupipforward_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupipforward_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupipforward" "" "/tmp/import_validation_node_role_info_setupipforward" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupipforward" "0" "/tmp/import_validation_node_role_info_setupipforward" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupipforward" "1" "/tmp/import_validation_node_role_info_setupipforward" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupipforward" "2" "/tmp/import_validation_node_role_info_setupipforward" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupipforward" "a" "/tmp/import_validation_node_role_info_setupipforward" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupipforward_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupipforward_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupipforward_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupipforward_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupipforward_bak +end + +start:import_validation_node_role_info_setupconserver +descrsetupnfstion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupconserver" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupconserver_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupconserver_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupconserver_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupconserver" "" "/tmp/import_validation_node_role_info_setupconserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupconserver" "0" "/tmp/import_validation_node_role_info_setupconserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupconserver" "1" "/tmp/import_validation_node_role_info_setupconserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupconserver" "2" "/tmp/import_validation_node_role_info_setupconserver" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupconserver" "3" "/tmp/import_validation_node_role_info_setupconserver" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupconserver" "a" "/tmp/import_validation_node_role_info_setupconserver" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupconserver_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupconserver_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupconserver_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupconserver_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupconserver_bak +end + + + +start:import_validation_node_role_info_setupnfs +descrsetupconservertion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role_info.setupnfs" attribute +cmd:mkdir -p /tmp/import_validation_node_role_info_setupnfs_bak +check:rc==0 +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_role_info_setupnfs_bak/bogusnode.stanza ;rmdef bogusnode;fi +check:rc==0 +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_role_info_setupnfs_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnfs" "" "/tmp/import_validation_node_role_info_setupnfs" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnfs" "0" "/tmp/import_validation_node_role_info_setupnfs" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnfs" "1" "/tmp/import_validation_node_role_info_setupnfs" +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnfs" "2" "/tmp/import_validation_node_role_info_setupnfs" +check:rc!=0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "node" "bogusnode" "role_info.setupnfs" "a" "/tmp/import_validation_node_role_info_setupnfs" +check:rc!=0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupnfs_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_role_info_setupnfs_bak/bogusnode.stanza | mkdef -z;fi +check:rc==0 +cmd:if [[ -e /tmp/import_validation_node_role_info_setupnfs_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_role_info_setupnfs_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_role_info_setupnfs_bak +end + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/node.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/node.json new file mode 100644 index 000000000..f0a8df835 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/node.json @@ -0,0 +1,970 @@ +{ + "node": { + "bogusnode": { + "deprecated": { + "cfgmgtcfgmgr": "cfgmgr", + "cfgmgtcfgserver": "cfgserver", + "cfgmgtroles": "cfgmgtroles", + "chainondiscover": "ondiscover", + "hypervisorcluster": "hostcluster", + "hypervisorinterface": "hostinterface", + "hypervisormgr": "hostmanager", + "hypervisortype": "hosttype", + "iscsipasswd": "iscsipassword", + "iscsiserver": "iscsiserver", + "iscsitarget": "iscsitarget", + "iscsiuserid": "iscsiuserid", + "macinterface": "interface", + "nodehmcmdmapping": "cmdmapping", + "nodehmgetmac": "getmac", + "nodelisthidden": "hidden", + "noderesnfsdir": "nfsdir", + "noderesnimserver": "nimserver", + "noderesprimarynic": "primarynic", + "noderesproxydhcp": "supportproxydhcp", + "servicenodeftpserver": "setupftp", + "servicenodenimserver": "setupnim", + "storagecontroller": "storagcontroller", + "storageosvolume": "osvolume", + "storagetype": "storagetype", + "tftpdir": "tftpdir", + "vmmigrationdest": "migrationdest", + "vmtextconsole": "vmtextconsole", + "vpdside": "side" + }, + "device_info": { + "arch": "ppc64le", + "characteristics": "mp", + "cpucount": "cpucount", + "cputype": "cputype", + "disksize": "disksize", + "memory": "memory", + "mtm": "mtm", + "serial": "serial", + "supportedarchs": "supportedarchs" + }, + "device_type": "server", + "domain_info": { + "adminpassword": "domainadminpassword", + "adminuser": "domainadminuser", + "authdomain": "authdomain", + "ou": "ou", + "type": "domaintype" + }, + "engines": { + "console_engine": { + "engine_info": { + "conserver": "conserver", + "consoleondemand": "consoleondemand", + "serialflow": "serialflow", + "serialport": "serialport", + "serialspeed": "serialspeed", + "terminalport": "termport", + "terminalserver": "termserver" + }, + "engine_type": "cons" + }, + "hardware_mgt_engine": { + "engine_info": { + "bmc": "bmc", + "bmcpassword": "bmcpassword", + "bmctaggedvlan": "bmcvlantag", + "bmcusername": "bmcusername", + "consport": "consport", + "hwtype": "hwtype", + "mpa": "mpa", + "sfp": "sfp", + "supernode": "supernode", + "vmbeacon": "vmbeacon", + "vmbootorder": "vmbootorder", + "vmcfgstore": "vmcfgstore", + "vmcluster": "vmcluster", + "vmmanager": "vmmanager", + "vmmaster": "vmmaster", + "vmnicnicmodel": "vmnicnicmodel", + "vmphyslots": "vmphyslots", + "vmstorage": "vmstorage", + "vmstoragecache": "vmstoragecache", + "vmstorageformat": "vmstorageformat", + "vmstoragemodel": "vmstoragemodel", + "vmtextconsole": "vmstorageformat", + "vmvirtflags": "vmvirtflags", + "vmvncport": "vmvncport" + }, + "engine_type": "openbmc" + }, + "netboot_engine": { + "engine_info": { + "addkcmdline": "addkcmdline", + "chain": "chain", + "installnic": "installnic", + "osimage": "provmethod", + "postbootscripts": "postbootscripts", + "postscripts": "postscripts", + "prescriptsbegin": "prescripts-begin", + "prescriptsend": "prescripts-end" + }, + "engine_type": "grub2" + }, + "power_mgt_engine": { + "engine_info": { + "pdu": "pdu" + }, + "engine_type": "power" + } + }, + "network_info": { + "nics": { + "bond0": { + "nicdevices": [ + "eth0", + "eth2" + ] + }, + "br0": { + "nicdevices": [ + "bond0" + ] + }, + "enP3p3s0f1": { + "nicsinfo": [ + "mac=98:be:94:59:fa:cd linkstate=DOWN" + ] + }, + "enP3p3s0f2": { + "nicsinfo": [ + "mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" + ] + }, + "enP48p1s0f0": { + "ips": [ + "129.40.234.11" + ], + "networks": [ + "pub_yellow" + ], + "type": [ + "Ethernet" + ] + }, + "enP48p1s0f1": { + "networks": [ + "xcat_util" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1": { + "networks": [ + "xcat_compute" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.4": { + "networks": [ + "xcat_bmc" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.5": { + "networks": [ + "xcat_infra" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.6": { + "networks": [ + "xcat_pdu" + ], + "type": [ + "unused" + ] + }, + "eth0": { + "alias": [ + "moe larry curly" + ], + "configscripts": [ + "configeth eth0" + ], + "extraconfig": [ + "MTU=1500" + ], + "hostnameprefixe": [ + "eth0-" + ], + "ips": [ + "1.1.1.1" + ], + "hostnamesuffixes": [ + "-eth0" + ] + }, + "eth1": { + "alias": [ + "tom", + "jerry" + ] + }, + "ib0": { + "configscripts": [ + "configib ib0" + ], + "extraconfig": [ + "MTU=65520 CONNECTED_MODE=yes" + ], + "hostnameprefixe": [ + "ib-" + ], + "hostnamesuffixes": [ + "-ib0" + ], + "ips": [ + "10.10.100.9" + ], + "networks": [ + "IB00" + ], + "type": [ + "Infiniband" + ] + }, + "ib1": { + "ips": [ + "10.11.100.9" + ], + "networks": [ + "IB01" + ], + "type": [ + "Infiniband" + ] + }, + "ib2": { + "networks": [ + "IB02" + ], + "type": [ + "unused" + ] + }, + "ib3": { + "networks": [ + "IB03" + ], + "type": [ + "unused" + ] + } + }, + "otherinterfaces": "otherinterfaces", + "primarynic": { + "hostnames": "hostnames", + "ip": "10.10.10.10", + "mac": [ + "42:d6:0a:03:05:08" + ], + "switch": "switch", + "switchinterface": "switchinterface", + "switchport": "50", + "switchvlan": "switchvlan" + }, + "routenames": "routenames" + }, + "obj_info": { + "description": "usercomment", + "groups": "bogusgroup" + }, + "obj_type": "node", + "position_info": { + "chassis": "chassis", + "height": "height", + "rack": "rack", + "room": "room", + "slot": "slot", + "unit": "unit" + }, + "role": "service", + "role_info": { + "dhcpinterfaces": "dhcpinterfaces", + "enablesyslog": "syslog", + "monserver": "monserver", + "nameservers": "nameservers", + "nfsserver": "nfsserver", + "nodelistprimarysn": "primarysn", + "servicenode": "servicenode", + "setupconserver": "0", + "setupdhcp": "0", + "setupipforward": "0", + "setupldap": "0", + "setupnameserver": "0", + "setupnfs": "0", + "setupntp": "0", + "setupproxydhcp": "0", + "setuptftp": "0", + "tftpserver": "tftpserver", + "xcatmaster": "xcatmaster" + }, + "security_info": { + "productkey": "productkey", + "zonename": "zonename" + } + }, + "boguspdu": { + "deprecated": { + "cfgmgtcfgmgr": "cfgmgr", + "cfgmgtcfgserver": "cfgserver", + "cfgmgtroles": "cfgmgtroles", + "chainondiscover": "ondiscover", + "hypervisorcluster": "hostcluster", + "hypervisorinterface": "hostinterface", + "hypervisormgr": "hostmanager", + "hypervisortype": "hosttype", + "iscsipasswd": "iscsipassword", + "iscsiserver": "iscsiserver", + "iscsitarget": "iscsitarget", + "iscsiuserid": "iscsiuserid", + "macinterface": "interface", + "nodehmcmdmapping": "cmdmapping", + "nodehmgetmac": "getmac", + "nodelisthidden": "hidden", + "noderesnfsdir": "nfsdir", + "noderesnimserver": "nimserver", + "noderesprimarynic": "primarynic", + "noderesproxydhcp": "supportproxydhcp", + "pdunodetype": "pdu", + "servicenodeftpserver": "setupftp", + "servicenodenimserver": "setupnim", + "storagecontroller": "storagcontroller", + "storageosvolume": "osvolume", + "storagetype": "storagetype", + "tftpdir": "tftpdir", + "vmmigrationdest": "migrationdest", + "vmtextconsole": "vmtextconsole", + "vpdside": "side" + }, + "device_info": { + "arch": "ppc64", + "characteristics": "pdu", + "cpucount": "cpucount", + "cputype": "cputype", + "disksize": "disksize", + "memory": "memory", + "mtm": "mtm", + "outlets": "outlet", + "pdutype": "pdutype", + "serial": "serial", + "supportedarchs": "supportedarchs" + }, + "device_type": "pdu", + "domain_info": { + "adminpassword": "domainadminpassword", + "adminuser": "domainadminuser", + "authdomain": "authdomain", + "ou": "ou", + "type": "domaintype" + }, + "engines": { + "console_engine": { + "engine_info": { + "conserver": "conserver", + "consoleondemand": "consoleondemand", + "serialflow": "serialflow", + "serialport": "serialport", + "serialspeed": "serialspeed", + "terminalport": "termport", + "terminalserver": "termserver" + }, + "engine_type": "cons" + }, + "hardware_mgt_engine": { + "engine_info": { + "mpa": "mpa", + "sfp": "sfp", + "supernode": "supernode", + "vmbeacon": "vmbeacon", + "vmbootorder": "vmbootorder", + "vmcfgstore": "vmcfgstore", + "vmcluster": "vmcluster", + "vmmanager": "vmmanager", + "vmmaster": "vmmaster", + "vmnicnicmodel": "vmnicnicmodel", + "vmphyslots": "vmphyslots", + "vmstorage": "vmstorage", + "vmstoragecache": "vmstoragecache", + "vmstorageformat": "vmstorageformat", + "vmstoragemodel": "vmstoragemodel", + "vmtextconsole": "vmstorageformat", + "vmvirtflags": "vmvirtflags", + "vmvncport": "vmvncport" + }, + "engine_type": "pdu" + }, + "netboot_engine": { + "engine_info": { + "addkcmdline": "addkcmdline", + "chain": "chain", + "installnic": "installnic", + "osimage": "provmethod", + "postbootscripts": "postbootscripts", + "postscripts": "postscripts", + "prescriptsbegin": "prescripts-begin", + "prescriptsend": "prescripts-end" + }, + "engine_type": "grub2" + }, + "power_mgt_engine": { + "engine_info": { + "pdu": "pdu" + }, + "engine_type": "power" + } + }, + "network_info": { + "nics": { + "bond0": { + "nicdevices": [ + "eth0", + "eth2" + ] + }, + "br0": { + "nicdevices": [ + "bond0" + ] + }, + "enP3p3s0f1": { + "nicsinfo": [ + "mac=98:be:94:59:fa:cd linkstate=DOWN" + ] + }, + "enP3p3s0f2": { + "nicsinfo": [ + "mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" + ] + }, + "enP48p1s0f0": { + "ips": [ + "129.40.234.11" + ], + "networks": [ + "pub_yellow" + ], + "type": [ + "Ethernet" + ] + }, + "enP48p1s0f1": { + "networks": [ + "xcat_util" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1": { + "networks": [ + "xcat_compute" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.4": { + "networks": [ + "xcat_bmc" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.5": { + "networks": [ + "xcat_infra" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.6": { + "networks": [ + "xcat_pdu" + ], + "type": [ + "unused" + ] + }, + "eth0": { + "alias": [ + "moe larry curly" + ], + "configscripts": [ + "configeth eth0" + ], + "extraconfig": [ + "MTU=1500" + ], + "hostnameprefixe": [ + "eth0-" + ], + "hostnamesuffixes": [ + "-eth0" + ] + }, + "eth1": { + "alias": [ + "tom", + "jerry" + ] + }, + "ib0": { + "configscripts": [ + "configib ib0" + ], + "extraconfig": [ + "MTU=65520 CONNECTED_MODE=yes" + ], + "hostnameprefixe": [ + "ib-" + ], + "hostnamesuffixes": [ + "-ib0" + ], + "ips": [ + "10.10.100.9" + ], + "networks": [ + "IB00" + ], + "type": [ + "Infiniband" + ] + }, + "ib1": { + "ips": [ + "10.11.100.9" + ], + "networks": [ + "IB01" + ], + "type": [ + "Infiniband" + ] + }, + "ib2": { + "networks": [ + "IB02" + ], + "type": [ + "unused" + ] + }, + "ib3": { + "networks": [ + "IB03" + ], + "type": [ + "unused" + ] + } + }, + "otherinterfaces": "otherinterfaces", + "primarynic": { + "hostnames": "hostnames", + "ip": "10.10.10.10", + "mac": [ + "42:d6:0a:03:05:08" + ], + "switch": "switch", + "switchinterface": "switchinterface", + "switchport": "50", + "switchvlan": "switchvlan" + }, + "routenames": "routenames" + }, + "obj_info": { + "description": "usercomment", + "groups": "bogusgroup" + }, + "obj_type": "node", + "position_info": { + "chassis": "chassis", + "height": "height", + "rack": "rack", + "room": "room", + "slot": "slot", + "unit": "unit" + }, + "role": "service", + "role_info": { + "dhcpinterfaces": "dhcpinterfaces", + "enablesyslog": "syslog", + "monserver": "monserver", + "nameservers": "nameservers", + "nfsserver": "nfsserver", + "nodelistprimarysn": "primarysn", + "servicenode": "servicenode", + "setupconserver": "0", + "setupdhcp": "0", + "setupipforward": "0", + "setupldap": "0", + "setupnameserver": "0", + "setupnfs": "0", + "setupntp": "0", + "setupproxydhcp": "0", + "setuptftp": "0", + "tftpserver": "tftpserver", + "xcatmaster": "xcatmaster" + }, + "security_info": { + "productkey": "productkey", + "remotecontrol": { + "password": "password", + "username": "username" + }, + "snmp": { + "authkey": "authkey", + "authprotocol": "MD5", + "community": "community", + "privacyprotocol": "AES", + "privkey": "privkey", + "securitylevel": "noAuthNoPriv", + "username": "snmpuser", + "version": "SNMPv1" + }, + "zonename": "zonename" + } + }, + "bogusswitch": { + "deprecated": { + "cfgmgtcfgmgr": "cfgmgr", + "cfgmgtcfgserver": "cfgserver", + "cfgmgtroles": "cfgmgtroles", + "chainondiscover": "ondiscover", + "hypervisorcluster": "hostcluster", + "hypervisorinterface": "hostinterface", + "hypervisormgr": "hostmanager", + "hypervisortype": "hosttype", + "iscsipasswd": "iscsipassword", + "iscsiserver": "iscsiserver", + "iscsitarget": "iscsitarget", + "iscsiuserid": "iscsiuserid", + "macinterface": "interface", + "nodehmcmdmapping": "cmdmapping", + "nodehmgetmac": "getmac", + "nodelisthidden": "hidden", + "noderesnfsdir": "nfsdir", + "noderesnimserver": "nimserver", + "noderesprimarynic": "primarynic", + "noderesproxydhcp": "supportproxydhcp", + "servicenodeftpserver": "setupftp", + "servicenodenimserver": "setupnim", + "storagecontroller": "storagcontroller", + "storageosvolume": "osvolume", + "storagetype": "storagetype", + "tftpdir": "tftpdir", + "vmmigrationdest": "migrationdest", + "vmtextconsole": "vmtextconsole", + "vpdside": "side" + }, + "device_info": { + "arch": "ppc64", + "characteristics": "switch", + "cpucount": "cpucount", + "cputype": "cputype", + "disksize": "disksize", + "memory": "memory", + "mtm": "mtm", + "serial": "serial", + "supportedarchs": "supportedarchs", + "switchtype": "switchtype" + }, + "device_type": "switch", + "domain_info": { + "adminpassword": "domainadminpassword", + "adminuser": "domainadminuser", + "authdomain": "authdomain", + "ou": "ou", + "type": "domaintype" + }, + "engines": { + "console_engine": { + "engine_info": { + "conserver": "conserver", + "consoleondemand": "consoleondemand", + "serialflow": "serialflow", + "serialport": "serialport", + "serialspeed": "serialspeed", + "terminalport": "termport", + "terminalserver": "termserver" + }, + "engine_type": "cons" + }, + "hardware_mgt_engine": { + "engine_info": { + "mpa": "mpa", + "sfp": "sfp", + "supernode": "supernode", + "vmbeacon": "vmbeacon", + "vmbootorder": "vmbootorder", + "vmcfgstore": "vmcfgstore", + "vmcluster": "vmcluster", + "vmmanager": "vmmanager", + "vmmaster": "vmmaster", + "vmnicnicmodel": "vmnicnicmodel", + "vmphyslots": "vmphyslots", + "vmstorage": "vmstorage", + "vmstoragecache": "vmstoragecache", + "vmstorageformat": "vmstorageformat", + "vmstoragemodel": "vmstoragemodel", + "vmtextconsole": "vmstorageformat", + "vmvirtflags": "vmvirtflags", + "vmvncport": "vmvncport" + }, + "engine_type": "switch" + }, + "netboot_engine": { + "engine_info": { + "addkcmdline": "addkcmdline", + "chain": "chain", + "installnic": "installnic", + "osimage": "provmethod", + "postbootscripts": "postbootscripts", + "postscripts": "postscripts", + "prescriptsbegin": "prescripts-begin", + "prescriptsend": "prescripts-end" + }, + "engine_type": "grub2" + }, + "power_mgt_engine": { + "engine_info": { + "pdu": "pdu" + }, + "engine_type": "power" + } + }, + "network_info": { + "linkports": "linkports", + "nics": { + "bond0": { + "nicdevices": [ + "eth0", + "eth2" + ] + }, + "br0": { + "nicdevices": [ + "bond0" + ] + }, + "enP3p3s0f1": { + "nicsinfo": [ + "mac=98:be:94:59:fa:cd linkstate=DOWN" + ] + }, + "enP3p3s0f2": { + "nicsinfo": [ + "mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face" + ] + }, + "enP48p1s0f0": { + "ips": [ + "129.40.234.11" + ], + "networks": [ + "pub_yellow" + ], + "type": [ + "Ethernet" + ] + }, + "enP48p1s0f1": { + "networks": [ + "xcat_util" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1": { + "networks": [ + "xcat_compute" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.4": { + "networks": [ + "xcat_bmc" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.5": { + "networks": [ + "xcat_infra" + ], + "type": [ + "unused" + ] + }, + "enP5p1s0f1.6": { + "networks": [ + "xcat_pdu" + ], + "type": [ + "unused" + ] + }, + "eth0": { + "alias": [ + "moe larry curly" + ], + "configscripts": [ + "configeth eth0" + ], + "extraconfig": [ + "MTU=1500" + ], + "hostnameprefixe": [ + "eth0-" + ], + "hostnamesuffixes": [ + "-eth0" + ] + }, + "eth1": { + "alias": [ + "tom", + "jerry" + ] + }, + "ib0": { + "configscripts": [ + "configib ib0" + ], + "extraconfig": [ + "MTU=65520 CONNECTED_MODE=yes" + ], + "hostnameprefixe": [ + "ib-" + ], + "hostnamesuffixes": [ + "-ib0" + ], + "ips": [ + "10.10.100.9" + ], + "networks": [ + "IB00" + ], + "type": [ + "Infiniband" + ] + }, + "ib1": { + "ips": [ + "10.11.100.9" + ], + "networks": [ + "IB01" + ], + "type": [ + "Infiniband" + ] + }, + "ib2": { + "networks": [ + "IB02" + ], + "type": [ + "unused" + ] + }, + "ib3": { + "networks": [ + "IB03" + ], + "type": [ + "unused" + ] + } + }, + "otherinterfaces": "otherinterfaces", + "primarynic": { + "hostnames": "hostnames", + "ip": "10.10.10.10", + "mac": [ + "42:d6:0a:03:05:08" + ], + "switch": "switch", + "switchinterface": "switchinterface", + "switchport": "50", + "switchvlan": "switchvlan" + }, + "routenames": "routenames" + }, + "obj_info": { + "description": "usercomment", + "groups": "bogusgroup" + }, + "obj_type": "node", + "position_info": { + "chassis": "chassis", + "height": "height", + "rack": "rack", + "room": "room", + "slot": "slot", + "unit": "unit" + }, + "role": "service", + "role_info": { + "dhcpinterfaces": "dhcpinterfaces", + "enablesyslog": "syslog", + "monserver": "monserver", + "nameservers": "nameservers", + "nfsserver": "nfsserver", + "nodelistprimarysn": "primarysn", + "servicenode": "servicenode", + "setupconserver": "0", + "setupdhcp": "0", + "setupipforward": "0", + "setupldap": "0", + "setupnameserver": "0", + "setupnfs": "0", + "setupntp": "0", + "setupproxydhcp": "0", + "setuptftp": "0", + "tftpserver": "tftpserver", + "xcatmaster": "xcatmaster" + }, + "security_info": { + "productkey": "productkey", + "remotecontrol": { + "password": "password", + "remoteprotocol": "ssh", + "username": "username" + }, + "snmp": { + "authkey": "snmppassword", + "authprotocol": "SHA", + "community": "snmppassword", + "privacyprotocol": "DES", + "username": "snmpusername", + "version": "SNMPv1" + }, + "zonename": "zonename" + } + } + }, + "schema_version": "1.0" +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/node.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/node.yaml new file mode 100644 index 000000000..172759d41 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/node.yaml @@ -0,0 +1,741 @@ +node: + bogusnode: + deprecated: + cfgmgtcfgmgr: cfgmgr + cfgmgtcfgserver: cfgserver + cfgmgtroles: cfgmgtroles + chainondiscover: ondiscover + hypervisorcluster: hostcluster + hypervisorinterface: hostinterface + hypervisormgr: hostmanager + hypervisortype: hosttype + iscsipasswd: iscsipassword + iscsiserver: iscsiserver + iscsitarget: iscsitarget + iscsiuserid: iscsiuserid + macinterface: interface + nodehmcmdmapping: cmdmapping + nodehmgetmac: getmac + nodelisthidden: hidden + noderesnfsdir: nfsdir + noderesnimserver: nimserver + noderesprimarynic: primarynic + noderesproxydhcp: supportproxydhcp + servicenodeftpserver: setupftp + servicenodenimserver: setupnim + storagecontroller: storagcontroller + storageosvolume: osvolume + storagetype: storagetype + tftpdir: tftpdir + vmmigrationdest: migrationdest + vmtextconsole: vmtextconsole + vpdside: side + device_info: + arch: ppc64le + characteristics: mp + cpucount: cpucount + cputype: cputype + disksize: disksize + memory: memory + mtm: mtm + serial: serial + supportedarchs: supportedarchs + device_type: server + domain_info: + adminpassword: domainadminpassword + adminuser: domainadminuser + authdomain: authdomain + ou: ou + type: domaintype + engines: + console_engine: + engine_info: + conserver: conserver + consoleondemand: consoleondemand + serialflow: serialflow + serialport: serialport + serialspeed: serialspeed + terminalport: termport + terminalserver: termserver + engine_type: cons + hardware_mgt_engine: + engine_info: + bmc: bmc + bmcpassword: bmcpassword + bmctaggedvlan: bmcvlantag + bmcusername: bmcusername + consport: consport + hwtype: hwtype + mpa: mpa + sfp: sfp + supernode: supernode + vmbeacon: vmbeacon + vmbootorder: vmbootorder + vmcfgstore: vmcfgstore + vmcluster: vmcluster + vmmanager: vmmanager + vmmaster: vmmaster + vmnicnicmodel: vmnicnicmodel + vmphyslots: vmphyslots + vmstorage: vmstorage + vmstoragecache: vmstoragecache + vmstorageformat: vmstorageformat + vmstoragemodel: vmstoragemodel + vmtextconsole: vmstorageformat + vmvirtflags: vmvirtflags + vmvncport: vmvncport + engine_type: openbmc + netboot_engine: + engine_info: + addkcmdline: addkcmdline + chain: chain + installnic: installnic + osimage: provmethod + postbootscripts: postbootscripts + postscripts: postscripts + prescriptsbegin: prescripts-begin + prescriptsend: prescripts-end + engine_type: grub2 + power_mgt_engine: + engine_info: + pdu: pdu + engine_type: power + network_info: + nics: + bond0: + nicdevices: + - eth0 + - eth2 + br0: + nicdevices: + - bond0 + enP3p3s0f1: + nicsinfo: + - mac=98:be:94:59:fa:cd linkstate=DOWN + enP3p3s0f2: + nicsinfo: + - mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face + enP48p1s0f0: + ips: + - 129.40.234.11 + networks: + - pub_yellow + type: + - Ethernet + enP48p1s0f1: + networks: + - xcat_util + type: + - unused + enP5p1s0f1: + networks: + - xcat_compute + type: + - unused + enP5p1s0f1.4: + networks: + - xcat_bmc + type: + - unused + enP5p1s0f1.5: + networks: + - xcat_infra + type: + - unused + enP5p1s0f1.6: + networks: + - xcat_pdu + type: + - unused + eth0: + alias: + - moe larry curly + configscripts: + - configeth eth0 + extraconfig: + - MTU=1500 + hostnameprefixe: + - eth0- + hostnamesuffixes: + - -eth0 + ips: + - 10.1.1.1 + eth1: + alias: + - tom + - jerry + ib0: + configscripts: + - configib ib0 + extraconfig: + - MTU=65520 CONNECTED_MODE=yes + hostnameprefixe: + - ib- + hostnamesuffixes: + - -ib0 + ips: + - 10.10.100.9 + networks: + - IB00 + type: + - Infiniband + ib1: + ips: + - 10.11.100.9 + networks: + - IB01 + type: + - Infiniband + ib2: + networks: + - IB02 + type: + - unused + ib3: + networks: + - IB03 + type: + - unused + otherinterfaces: otherinterfaces + primarynic: + hostnames: hostnames + ip: 10.10.10.10 + mac: + - 42:d6:0a:03:05:08 + switch: switch + switchinterface: switchinterface + switchport: '50' + switchvlan: switchvlan + routenames: routenames + obj_info: + description: usercomment + groups: bogusgroup + obj_type: node + position_info: + chassis: chassis + height: height + rack: rack + room: room + slot: slot + unit: unit + role: service + role_info: + dhcpinterfaces: dhcpinterfaces + enablesyslog: syslog + monserver: monserver + nameservers: nameservers + nfsserver: nfsserver + nodelistprimarysn: primarysn + servicenode: servicenode + setupconserver: '0' + setupdhcp: '0' + setupipforward: '0' + setupldap: '0' + setupnameserver: '0' + setupnfs: '0' + setupntp: '0' + setupproxydhcp: '0' + setuptftp: '0' + tftpserver: tftpserver + xcatmaster: xcatmaster + security_info: + productkey: productkey + zonename: zonename + boguspdu: + deprecated: + cfgmgtcfgmgr: cfgmgr + cfgmgtcfgserver: cfgserver + cfgmgtroles: cfgmgtroles + chainondiscover: ondiscover + hypervisorcluster: hostcluster + hypervisorinterface: hostinterface + hypervisormgr: hostmanager + hypervisortype: hosttype + iscsipasswd: iscsipassword + iscsiserver: iscsiserver + iscsitarget: iscsitarget + iscsiuserid: iscsiuserid + macinterface: interface + nodehmcmdmapping: cmdmapping + nodehmgetmac: getmac + nodelisthidden: hidden + noderesnfsdir: nfsdir + noderesnimserver: nimserver + noderesprimarynic: primarynic + noderesproxydhcp: supportproxydhcp + pdunodetype: pdu + servicenodeftpserver: setupftp + servicenodenimserver: setupnim + storagecontroller: storagcontroller + storageosvolume: osvolume + storagetype: storagetype + tftpdir: tftpdir + vmmigrationdest: migrationdest + vmtextconsole: vmtextconsole + vpdside: side + device_info: + arch: ppc64 + characteristics: pdu + cpucount: cpucount + cputype: cputype + disksize: disksize + memory: memory + mtm: mtm + outlets: outlet + pdutype: pdutype + serial: serial + supportedarchs: supportedarchs + device_type: pdu + domain_info: + adminpassword: domainadminpassword + adminuser: domainadminuser + authdomain: authdomain + ou: ou + type: domaintype + engines: + console_engine: + engine_info: + conserver: conserver + consoleondemand: consoleondemand + serialflow: serialflow + serialport: serialport + serialspeed: serialspeed + terminalport: termport + terminalserver: termserver + engine_type: cons + hardware_mgt_engine: + engine_info: + mpa: mpa + sfp: sfp + supernode: supernode + vmbeacon: vmbeacon + vmbootorder: vmbootorder + vmcfgstore: vmcfgstore + vmcluster: vmcluster + vmmanager: vmmanager + vmmaster: vmmaster + vmnicnicmodel: vmnicnicmodel + vmphyslots: vmphyslots + vmstorage: vmstorage + vmstoragecache: vmstoragecache + vmstorageformat: vmstorageformat + vmstoragemodel: vmstoragemodel + vmtextconsole: vmstorageformat + vmvirtflags: vmvirtflags + vmvncport: vmvncport + engine_type: pdu + netboot_engine: + engine_info: + addkcmdline: addkcmdline + chain: chain + installnic: installnic + osimage: provmethod + postbootscripts: postbootscripts + postscripts: postscripts + prescriptsbegin: prescripts-begin + prescriptsend: prescripts-end + engine_type: grub2 + power_mgt_engine: + engine_info: + pdu: pdu + engine_type: power + network_info: + nics: + bond0: + nicdevices: + - eth0 + - eth2 + br0: + nicdevices: + - bond0 + enP3p3s0f1: + nicsinfo: + - mac=98:be:94:59:fa:cd linkstate=DOWN + enP3p3s0f2: + nicsinfo: + - mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face + enP48p1s0f0: + ips: + - 129.40.234.11 + networks: + - pub_yellow + type: + - Ethernet + enP48p1s0f1: + networks: + - xcat_util + type: + - unused + enP5p1s0f1: + networks: + - xcat_compute + type: + - unused + enP5p1s0f1.4: + networks: + - xcat_bmc + type: + - unused + enP5p1s0f1.5: + networks: + - xcat_infra + type: + - unused + enP5p1s0f1.6: + networks: + - xcat_pdu + type: + - unused + eth0: + alias: + - moe larry curly + configscripts: + - configeth eth0 + extraconfig: + - MTU=1500 + hostnameprefixe: + - eth0- + hostnamesuffixes: + - -eth0 + eth1: + alias: + - tom + - jerry + ib0: + configscripts: + - configib ib0 + extraconfig: + - MTU=65520 CONNECTED_MODE=yes + hostnameprefixe: + - ib- + hostnamesuffixes: + - -ib0 + ips: + - 10.10.100.9 + networks: + - IB00 + type: + - Infiniband + ib1: + ips: + - 10.11.100.9 + networks: + - IB01 + type: + - Infiniband + ib2: + networks: + - IB02 + type: + - unused + ib3: + networks: + - IB03 + type: + - unused + otherinterfaces: otherinterfaces + primarynic: + hostnames: hostnames + ip: 10.10.10.10 + mac: + - 42:d6:0a:03:05:08 + switch: switch + switchinterface: switchinterface + switchport: '50' + switchvlan: switchvlan + routenames: routenames + obj_info: + description: usercomment + groups: bogusgroup + obj_type: node + position_info: + chassis: chassis + height: height + rack: rack + room: room + slot: slot + unit: unit + role: service + role_info: + dhcpinterfaces: dhcpinterfaces + enablesyslog: syslog + monserver: monserver + nameservers: nameservers + nfsserver: nfsserver + nodelistprimarysn: primarysn + servicenode: servicenode + setupconserver: '0' + setupdhcp: '0' + setupipforward: '0' + setupldap: '0' + setupnameserver: '0' + setupnfs: '0' + setupntp: '0' + setupproxydhcp: '0' + setuptftp: '0' + tftpserver: tftpserver + xcatmaster: xcatmaster + security_info: + productkey: productkey + remotecontrol: + password: password + username: username + snmp: + authkey: authkey + authprotocol: MD5 + community: community + privacyprotocol: AES + privkey: privkey + securitylevel: noAuthNoPriv + username: snmpuser + version: SNMPv1 + zonename: zonename + bogusswitch: + deprecated: + cfgmgtcfgmgr: cfgmgr + cfgmgtcfgserver: cfgserver + cfgmgtroles: cfgmgtroles + chainondiscover: ondiscover + hypervisorcluster: hostcluster + hypervisorinterface: hostinterface + hypervisormgr: hostmanager + hypervisortype: hosttype + iscsipasswd: iscsipassword + iscsiserver: iscsiserver + iscsitarget: iscsitarget + iscsiuserid: iscsiuserid + macinterface: interface + nodehmcmdmapping: cmdmapping + nodehmgetmac: getmac + nodelisthidden: hidden + noderesnfsdir: nfsdir + noderesnimserver: nimserver + noderesprimarynic: primarynic + noderesproxydhcp: supportproxydhcp + servicenodeftpserver: setupftp + servicenodenimserver: setupnim + storagecontroller: storagcontroller + storageosvolume: osvolume + storagetype: storagetype + tftpdir: tftpdir + vmmigrationdest: migrationdest + vmtextconsole: vmtextconsole + vpdside: side + device_info: + arch: ppc64 + characteristics: switch + cpucount: cpucount + cputype: cputype + disksize: disksize + memory: memory + mtm: mtm + serial: serial + supportedarchs: supportedarchs + switchtype: switchtype + device_type: switch + domain_info: + adminpassword: domainadminpassword + adminuser: domainadminuser + authdomain: authdomain + ou: ou + type: domaintype + engines: + console_engine: + engine_info: + conserver: conserver + consoleondemand: consoleondemand + serialflow: serialflow + serialport: serialport + serialspeed: serialspeed + terminalport: termport + terminalserver: termserver + engine_type: cons + hardware_mgt_engine: + engine_info: + mpa: mpa + sfp: sfp + supernode: supernode + vmbeacon: vmbeacon + vmbootorder: vmbootorder + vmcfgstore: vmcfgstore + vmcluster: vmcluster + vmmanager: vmmanager + vmmaster: vmmaster + vmnicnicmodel: vmnicnicmodel + vmphyslots: vmphyslots + vmstorage: vmstorage + vmstoragecache: vmstoragecache + vmstorageformat: vmstorageformat + vmstoragemodel: vmstoragemodel + vmtextconsole: vmstorageformat + vmvirtflags: vmvirtflags + vmvncport: vmvncport + engine_type: switch + netboot_engine: + engine_info: + addkcmdline: addkcmdline + chain: chain + installnic: installnic + osimage: provmethod + postbootscripts: postbootscripts + postscripts: postscripts + prescriptsbegin: prescripts-begin + prescriptsend: prescripts-end + engine_type: grub2 + power_mgt_engine: + engine_info: + pdu: pdu + engine_type: power + network_info: + linkports: linkports + nics: + bond0: + nicdevices: + - eth0 + - eth2 + br0: + nicdevices: + - bond0 + enP3p3s0f1: + nicsinfo: + - mac=98:be:94:59:fa:cd linkstate=DOWN + enP3p3s0f2: + nicsinfo: + - mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face + enP48p1s0f0: + ips: + - 129.40.234.11 + networks: + - pub_yellow + type: + - Ethernet + enP48p1s0f1: + networks: + - xcat_util + type: + - unused + enP5p1s0f1: + networks: + - xcat_compute + type: + - unused + enP5p1s0f1.4: + networks: + - xcat_bmc + type: + - unused + enP5p1s0f1.5: + networks: + - xcat_infra + type: + - unused + enP5p1s0f1.6: + networks: + - xcat_pdu + type: + - unused + eth0: + alias: + - moe larry curly + configscripts: + - configeth eth0 + extraconfig: + - MTU=1500 + hostnameprefixe: + - eth0- + hostnamesuffixes: + - -eth0 + eth1: + alias: + - tom + - jerry + ib0: + configscripts: + - configib ib0 + extraconfig: + - MTU=65520 CONNECTED_MODE=yes + hostnameprefixe: + - ib- + hostnamesuffixes: + - -ib0 + ips: + - 10.10.100.9 + networks: + - IB00 + type: + - Infiniband + ib1: + ips: + - 10.11.100.9 + networks: + - IB01 + type: + - Infiniband + ib2: + networks: + - IB02 + type: + - unused + ib3: + networks: + - IB03 + type: + - unused + otherinterfaces: otherinterfaces + primarynic: + hostnames: hostnames + ip: 10.10.10.10 + mac: + - 42:d6:0a:03:05:08 + switch: switch + switchinterface: switchinterface + switchport: '50' + switchvlan: switchvlan + routenames: routenames + obj_info: + description: usercomment + groups: bogusgroup + obj_type: node + position_info: + chassis: chassis + height: height + rack: rack + room: room + slot: slot + unit: unit + role: service + role_info: + dhcpinterfaces: dhcpinterfaces + enablesyslog: syslog + monserver: monserver + nameservers: nameservers + nfsserver: nfsserver + nodelistprimarysn: primarysn + servicenode: servicenode + setupconserver: '0' + setupdhcp: '0' + setupipforward: '0' + setupldap: '0' + setupnameserver: '0' + setupnfs: '0' + setupntp: '0' + setupproxydhcp: '0' + setuptftp: '0' + tftpserver: tftpserver + xcatmaster: xcatmaster + security_info: + productkey: productkey + remotecontrol: + password: password + remoteprotocol: ssh + username: username + snmp: + authkey: snmppassword + authprotocol: SHA + community: snmppassword + privacyprotocol: DES + username: snmpusername + version: SNMPv1 + zonename: zonename +schema_version: '1.0' + From 3c0ed0db349327df4f211bdb1e48566236bfd00b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 29 Mar 2018 11:13:53 -0400 Subject: [PATCH 101/161] Updates to REST API documentation --- .../restapi/restapi_setup/restapi_setup.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst b/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst index 8f831211a..3208826bc 100644 --- a/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst +++ b/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst @@ -83,10 +83,10 @@ Extend the Timeout of Web Server Some operations like 'create osimage' (copycds) need a long time (longer than 3 minutes sometimes) to complete. It would fail with a ``timeout error`` (504 Gateway Time-out) if the timeout setting in the web server is not extended: :: For [RHEL] - sed -i 's/^Timeout.*/Timeout 600/' /etc/httpd/conf/httpd.conf + Edit /etc/httpd/conf/httpd.conf and change existing or add new entry: "Timeout 600" service htttd restart For [SLES] - echo "Timeout 600" >> /etc/apache2/httpd.conf + Edit /etc/apache2/httpd.conf and change existing or add new entry: "Timeout 600" service apache2 restart Set Up an Account for Web Service Access @@ -114,13 +114,18 @@ Use non-root Account Create new user and setup the password and policy rules. :: - useradd wsuser + useradd -u wsuser passwd wsuser # set the password - tabch key=xcat,username=wsuser passwd.password=cluster + tabch key=xcat,username=wsuser passwd.password= mkdef -t policy 6 name=wsuser rule=allow ``Note:`` in the tabch command above you can put the salted password (from /etc/shadow) in the xCAT passwd table instead of the clear text password, if you prefer. +Identical user with the same name and userid need to be created on each compute node. :: + + useradd -u wsuser + passwd wsuser # set the password + Create the SSL certificate under that user's home directory so that user can be authenticated to xCAT. This is done by running the following command on the Management node as root: :: /opt/xcat/share/xcat/scripts/setup-local-client.sh @@ -141,3 +146,5 @@ or if you did not set up the certificate: :: You should see some output that includes your list of nodes. +If errors returned, check `/var/log/httpd/ssl_error_log` on xCAT MN. + From 78fa1c63e851f9116309b254ab73886bdfa37cf5 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Fri, 30 Mar 2018 11:32:32 +0800 Subject: [PATCH 102/161] enhance exlist without typo and duplicate lines (#5036) --- .../share/xcat/netboot/rh/compute.rhels7.ppc64.exlist | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist index 38de24002..30b29ed63 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist @@ -8,13 +8,13 @@ ./usr/lib64/perl5/Encode/KR* ./lib/kbd/keymaps/i386* ./lib/kbd/keymaps/mac* -./lib/kdb/keymaps/include* +./lib/kbd/keymaps/include* ./usr/local/include* ./usr/local/share/man* ./usr/share/man* ./usr/share/cracklib* ./usr/share/doc* -./usr/share/doc/packages/cyrus-sasl/doc* +#./usr/share/doc/packages/cyrus-sasl/doc* ./usr/share/gnome* ./usr/share/i18n* +./usr/share/i18n/en_US* @@ -25,7 +25,6 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* -./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* ./usr/share/vim/vim74/doc* From 71bb049f21f3c5446ac61decb23a2c71275dcb71 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 30 Mar 2018 02:53:11 -0400 Subject: [PATCH 103/161] Modify xcatws.cgi permission --- xCAT-server/xCAT-wsapi/xcatws.cgi | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 xCAT-server/xCAT-wsapi/xcatws.cgi diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi old mode 100644 new mode 100755 From 2e5815e7fe0bf8063549fc662ffae068b4cc5a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Fri, 30 Mar 2018 16:03:10 +0800 Subject: [PATCH 104/161] Use lowercase file name xcat-core.repo instead of xCAT-core.repo (#5010) * Use lowercase file name xcat-core.repo instead of xCAT-core.repo * Rename xCAT-core.repo to xCAT-core.repo.nouse if it exists * Change xCAT-dep.repo mentioned in document to xcat-dep.repo --- buildcore.sh | 11 +++++++---- builddep.sh | 6 +++--- buildlocal.sh | 10 +++++----- .../guides/install-guides/yum/configure_xcat.rst | 4 ++-- .../guides/install-guides/zypper/configure_xcat.rst | 4 ++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/buildcore.sh b/buildcore.sh index 7ed9e277e..f1b7794d9 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -500,8 +500,8 @@ if [ "$OSNAME" != "AIX" ]; then # Always recreate it, in case the whole dir was copied from devel to 2.x if [ -n "$1" ]; then embed="$1/" else embed=""; fi - cat >xCAT-core.repo << EOF -[xcat-2-core] + cat >xcat-core.repo << EOF +[xcat-core] name=xCAT 2 Core packages baseurl=$YUMREPOURL/$REL$EMBEDDIR/$CORE enabled=1 @@ -514,8 +514,8 @@ EOF cat >mklocalrepo.sh << 'EOF2' #!/bin/sh cd `dirname $0` -REPOFILE=`basename xCAT-*.repo` -if [[ $REPOFILE == "xCAT-*.repo" ]]; then +REPOFILE=`basename xcat-*.repo` +if [[ $REPOFILE == "xcat-*.repo" ]]; then echo "ERROR: For xcat-dep, please execute $0 in the correct / subdirectory" exit 1 fi @@ -527,6 +527,9 @@ if [ ! -d "$DIRECTORY" ]; then DIRECTORY="/etc/zypp/repos.d" fi sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > "$DIRECTORY/$REPOFILE" +if [ -f "$DIRECTORY/xCAT-core.repo" ]; then + mv "$DIRECTORY/xCAT-core.repo" "$DIRECTORY/xCAT-core.repo.nouse" +fi cd - EOF2 chmod 775 mklocalrepo.sh diff --git a/builddep.sh b/builddep.sh index 1413dcca2..7a4e4de8f 100755 --- a/builddep.sh +++ b/builddep.sh @@ -125,8 +125,8 @@ if [ "$OSNAME" != "AIX" ]; then fi done - # Modify xCAT-dep.repo files to point to the correct place - echo "===> Modifying the xCAT-dep.repo files to point to the correct location..." + # Modify xcat-dep.repo files to point to the correct place + echo "===> Modifying the xcat-dep.repo files to point to the correct location..." # 10/01/2015 - vkhu # The URLs have been updated in GSA, this section is not needed at the moment # @@ -138,7 +138,7 @@ if [ "$OSNAME" != "AIX" ]; then # oldurl="$YUMREPOURL2" #fi # - #sed -i -e "s|=$oldurl|=$newurl|g" `find . -name "xCAT-dep.repo" ` + #sed -i -e "s|=$oldurl|=$newurl|g" `find . -name "xcat-dep.repo" ` fi if [ "$OSNAME" == "AIX" ]; then diff --git a/buildlocal.sh b/buildlocal.sh index da6f64899..60da105aa 100755 --- a/buildlocal.sh +++ b/buildlocal.sh @@ -144,19 +144,19 @@ echo "This is an $OSNAME system" grep -i 'Red' /etc/*release*; if [ "$OSNAME" != "AIX" -a $? -eq 0 ]; then - cat >$CURDIR/build/xCAT-core.repo << EOF -[xcat-2-core] + cat >$CURDIR/build/xcat-core.repo << EOF +[xcat-core] name=xCAT 2 Core packages baseurl=file://$CURDIR/build enabled=1 gpgcheck=0 EOF - cp $CURDIR/build/xCAT-core.repo /etc/yum.repos.d/ + cp $CURDIR/build/xcat-core.repo /etc/yum.repos.d/ createrepo $CURDIR/build else - rm -f /etc/zypp/repos.d/xCAT-core.repo - zypper ar file://$CURDIR/build xCAT-core + rm -f /etc/zypp/repos.d/xcat-core.repo + zypper ar file://$CURDIR/build xcat-core fi fi diff --git a/docs/source/guides/install-guides/yum/configure_xcat.rst b/docs/source/guides/install-guides/yum/configure_xcat.rst index b57380ae2..c8106a163 100644 --- a/docs/source/guides/install-guides/yum/configure_xcat.rst +++ b/docs/source/guides/install-guides/yum/configure_xcat.rst @@ -8,11 +8,11 @@ Internet Repository **[xcat-core]** -For the xCAT build you want to install, download the ``xCAT-core.repo`` file and copy to ``/etc/yum.repos.d`` +For the xCAT build you want to install, download the ``xcat-core.repo`` file and copy to ``/etc/yum.repos.d`` **[xcat-dep]** -From the `xCAT-dep Online Repository `_, navigate to the correct subdirectory for the target machine and download the ``xCAT-dep.repo`` file and copy to ``/etc/yum.repos.d``. +From the `xCAT-dep Online Repository `_, navigate to the correct subdirectory for the target machine and download the ``xcat-dep.repo`` file and copy to ``/etc/yum.repos.d``. If using internet repositories, continue to the next step to install xCAT. diff --git a/docs/source/guides/install-guides/zypper/configure_xcat.rst b/docs/source/guides/install-guides/zypper/configure_xcat.rst index 7728ef7ff..fb0dc015c 100644 --- a/docs/source/guides/install-guides/zypper/configure_xcat.rst +++ b/docs/source/guides/install-guides/zypper/configure_xcat.rst @@ -8,11 +8,11 @@ Internet Repository **[xcat-core]** -For the xCAT build you want to install, download the ``xCAT-core.repo`` file and copy to ``/etc/zypp/repos.d`` +For the xCAT build you want to install, download the ``xcat-core.repo`` file and copy to ``/etc/zypp/repos.d`` **[xcat-dep]** -From the `xCAT-dep Online Repository `_, navigate to the correct subdirectory for the target machine and download the ``xCAT-dep.repo`` file and copy to ``/etc/zypp/repos.d``. +From the `xCAT-dep Online Repository `_, navigate to the correct subdirectory for the target machine and download the ``xcat-dep.repo`` file and copy to ``/etc/zypp/repos.d``. If using internet repositories, continue to the next step to install xCAT. From 91ca29e2521f8e10d2871980d481111c7a665279 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 30 Mar 2018 18:03:36 +0800 Subject: [PATCH 105/161] Add performance tunning best practice in RTD --- docs/source/advanced/index.rst | 1 + .../performance_tuning/database_tuning.rst | 13 ++++++ .../advanced/performance_tuning/index.rst | 13 ++++++ .../performance_tuning/linux_os_tuning.rst | 45 +++++++++++++++++++ .../performance_tuning/xcatd_tuning.rst | 27 +++++++++++ 5 files changed, 99 insertions(+) create mode 100644 docs/source/advanced/performance_tuning/database_tuning.rst create mode 100644 docs/source/advanced/performance_tuning/index.rst create mode 100644 docs/source/advanced/performance_tuning/linux_os_tuning.rst create mode 100644 docs/source/advanced/performance_tuning/xcatd_tuning.rst diff --git a/docs/source/advanced/index.rst b/docs/source/advanced/index.rst index c98d96d8c..648381be0 100755 --- a/docs/source/advanced/index.rst +++ b/docs/source/advanced/index.rst @@ -23,6 +23,7 @@ Advanced Topics raid/index.rst restapi/index.rst security/index.rst + performance_tuning/index.rst softlayer/index.rst sysclone/index.rst zones/index.rst diff --git a/docs/source/advanced/performance_tuning/database_tuning.rst b/docs/source/advanced/performance_tuning/database_tuning.rst new file mode 100644 index 000000000..29e0997ee --- /dev/null +++ b/docs/source/advanced/performance_tuning/database_tuning.rst @@ -0,0 +1,13 @@ +Tuning the Database Server +========================== + +1. MariaDB database + +MariaDB: `Tuning Server Parameters `_ + +According to this documentation, the two most important variables to configure are key_buffer_size and table_open_cache. + + +2. PostgreSQL database + +PostgreSQL: `Server Configuration `_ diff --git a/docs/source/advanced/performance_tuning/index.rst b/docs/source/advanced/performance_tuning/index.rst new file mode 100644 index 000000000..30a4fc635 --- /dev/null +++ b/docs/source/advanced/performance_tuning/index.rst @@ -0,0 +1,13 @@ +Performance Tuning +================== + +xCAT supports clusters of all sizes. This document is a collection of hints, tips, and special considerations when working with large clusters, especially a single server (management node or service node) manages more than 128 nodes. + +The information in this document should be viewed as example data only. Many of the suggestions are based on anecdotal experiences and may not apply to your particular environment. Suggestions in different sections of this document may recommend different or conflicting settings since they may have been provided by different people for different cluster environments. Often there is a significant amount of flexiblity in most of these settings -- you will need to resolve these differences in a way that works best for your cluster. + +.. toctree:: + :maxdepth: 2 + + linux_os_tuning.rst + xcatd_tuning.rst + database_tuning.rst \ No newline at end of file diff --git a/docs/source/advanced/performance_tuning/linux_os_tuning.rst b/docs/source/advanced/performance_tuning/linux_os_tuning.rst new file mode 100644 index 000000000..5a7a9833d --- /dev/null +++ b/docs/source/advanced/performance_tuning/linux_os_tuning.rst @@ -0,0 +1,45 @@ +System Tuning Settings for Linux +================================== + +Adjusting Operating System tunables can improve large scale cluster performance, avoid bottlenecks, and prevent failures. The following sections are a collection of suggestions that have been gathered from various large scale HPC clusters. You should investigate and evaluate the validity of each suggestion before applying them to your cluster. + + +1. Tuning Linux ulimits: + +The open file limits are important to high concurrence network services, such as *xcatd*. For a large cluster, it is required to increase the number of open file limit to avoid **Too many open files** error. The default value is *1024* in most OS distributions, to add below configuration in ``/etc/security/limits.conf`` to increase to *14096*. +:: + + * soft nofiles 14096 + * hard nofiles 14096 + + +2. Tuning Network kernel parameters: + +There might be hundreds of hosts in a big network for large cluster, tuning the network kernel parameters for optimum throughput and latency could improve the performance of distributed application. For example, adding below configuration in ``/etc/sysctl.conf`` to increase the buffer. + +:: + + net.core.rmem_max = 33554432 + net.core.wmem_max = 33554432 + net.core.rmem_default = 65536 + net.core.wmem_default = 65536 + + net.ipv4.tcp_rmem = 4096 33554432 33554432 + net.ipv4.tcp_wmem = 4096 33554432 33554432 + net.ipv4.tcp_mem= 33554432 33554432 33554432 + net.ipv4.route.flush=1 + net.core.netdev_max_backlog=1500 + + +And if you encounter **Neighbour table overflow** error, it meams there are two many ARP requests and the server cannot reply. Tune the ARP cache with below parameters. + +:: + + net.ipv4.conf.all.arp_filter = 1 + net.ipv4.conf.all.rp_filter = 1 + net.ipv4.neigh.default.gc_thresh1 = 30000 + net.ipv4.neigh.default.gc_thresh2 = 32000 + net.ipv4.neigh.default.gc_thresh3 = 32768 + net.ipv4.neigh.ib0.gc_stale_time = 2000000 + +For more tunable parameters, you can refer to "Linux System Tuning Recommendations". diff --git a/docs/source/advanced/performance_tuning/xcatd_tuning.rst b/docs/source/advanced/performance_tuning/xcatd_tuning.rst new file mode 100644 index 000000000..ce276ed02 --- /dev/null +++ b/docs/source/advanced/performance_tuning/xcatd_tuning.rst @@ -0,0 +1,27 @@ +Tuning xCAT Daemon Attributes +================================== + +For large clusters, you consider changing the default settings in `site` table to improve the performance on a large-scale cluster or if you are experiencing timeouts or failures in these areas: + +*consoleondemand* : When set to 'yes', conserver connects and creates the console output for a node only when the user explicitly opens the console using rcons or wcons. Default is 'no' on Linux, 'yes' on AIX. Setting this to 'yes' can reduce the load conserver places on your xCAT management node. If you need this set to 'no', you may then need to consider setting up multiple servers to run the conserver daemon, and specify the correct server on a per-node basis by setting each node's conserver attribute. + +*nodestatus* : If set to 'n', the nodelist.status column will not be updated during the node deployment, node discovery and power operations. Default is 'y', always update nodelist.status. Setting this to 'n' for large clusters can eliminate one node-to-server contact and one xCAT database write operation for each node during node deployment, but you will then need to determine deployment status through some other means. + +*precreatemypostscripts* : (yes/1 or no/0, only for Linux). Default is no. If yes, it will instruct xcat at nodeset and updatenode time to query the database once for all of the nodes passed into the command and create the mypostscript file for each node, and put them in a directory in tftpdir(such as: /tftpboot). This prevents xcatd from having to create the mypostscript files one at a time when each deploying node contacts it, so it will speed up the deployment process. (But it also means that if you change database values for these nodes, you must rerun nodeset.) If precreatemypostscripts is set to no, the mypostscript files will not be generated ahead of time. Instead they will be generated when each node is deployed. + +*svloglocal* : if set to 1, syslog on the service node will not get forwarded to the mgmt node. The default is to forward all syslog messages. The tradeoff on setting this attribute is reducing network traffic and log size versus having local management node access to all system messages from across the cluster. + +*skiptables* : a comma separated list of tables to be skipped by dumpxCATdb. A recommended setting is "auditlog,eventlog" because these tables can grow very large. Default is to skip no tables. + +*useNmapfromMN* : When set to yes, nodestat command should obtain the node status using nmap (if available) from the management node instead of the service node. This will improve the performance in a flat network. Default is 'no'. + +*dhcplease* : The lease time for the dhcp client. The default value is 43200. + +*xcatmaxconnections* : Number of concurrent xCAT protocol requests before requests begin queueing. This applies to both client command requests and node requests, e.g. to get postscripts. Default is 64. + +*xcatmaxbatchconnections* : Number of concurrent xCAT connections allowed from the nodes. Number must be less than xcatmaxconnections. See useflowcontrol attribute. + +*useflowcontrol* : If yes, the postscript processing on each node contacts xcatd on the MN/SN using a lightweight UDP packet to wait until xcatd is ready to handle the requests associated with postscripts. This prevents deploying nodes from flooding xcatd and locking out admin interactive use. This value works with the *xcatmaxconnections* and *xcatmaxbatch* attributes. If the value is no, nodes sleep for a random time before contacting xcatd, and retry. The default is no.. Not supported on AIX. + + +These attributes may be changed based on the size of your cluster. For a large cluster, it is better to enable *useflowcontrol* and set *xcatmaxconnection = 128*, *xcatmaxbatchconnections = 100*. Then the daemon will only allow 100 concurrent connections from the nodes. This will allow 28 connections still to be available on the management node for xCAT commands (e.g nodels). From 203c4754455e1f078b347aacae3adbea732a05f2 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Sun, 1 Apr 2018 21:58:11 -0400 Subject: [PATCH 106/161] Add test cases for support diskless SN installation and python environment setup --- .../installation/SN_diskless_setup_case | 123 ++++++++++++++++++ .../autotest/testcase/pythonsupport/cases0 | 55 ++++---- 2 files changed, 149 insertions(+), 29 deletions(-) create mode 100644 xCAT-test/autotest/testcase/installation/SN_diskless_setup_case diff --git a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case new file mode 100644 index 000000000..5b1fcafdb --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case @@ -0,0 +1,123 @@ +start:SN_diskless_setup_case +description:this case is used to test diskless service node installation +os:Linux +#stop:yes +cmd:fdisk -l +cmd:df -T +cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__ +check:rc==0 +cmd:chtab key=nameservers site.value="" +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:makeconservercf $$SN +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$SN +check:output=~$$SN +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$SN -V; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$SN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$SN;fi +check:output=~$$SN +cmd:chdef -t node $$SN groups=service,all +check:rc==0 +cmd:chdef -t group -o service profile=service primarynic=mac installnic=mac +check:rc==0 +cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=1 setupntp=1 +check:rc==0 +cmd:chdef -t group -o service nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN monserver=$$MN +check:rc==0 +cmd:chtab node=service postscripts.postscripts="servicenode" +check:rc==0 + +cmd:if ! lsdef -t osimage |grep -q __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-compute; then copycds $$ISO; fi +check:rc==0 + +cmd:chdef -t site clustersite installloc="/install" +check:rc==0 + + +cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo . +check:rc==0 + +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; +check:rc==0 + +cmd:mkdef -t osimage -o __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service --template __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-compute profile=service provmethod=netboot postscripts=servicenode +check:rc==0 + +cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__ +check:rc==0 + +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service otherpkglist=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist pkglist=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.pkglist exlist=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.exlist postinstall=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.postinstall; echo "xcat/xcat-core/xCAT-openbmc-py" >> /opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; cat /opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist +check:rc==0 + + +cmd:path="/install/netboot/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/service"; if [ -d "$path" ]; then mv $path $path."org"; fi; mkdir -p $path +check:rc==0 +cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service rootimgdir=/install/netboot/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/service +check:rc==0 + +cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service -p pkgdir=$$PYTHON_DEP_EPEL_DIR,$$PYTHON_DEP_EXTRAS_DIR,$$PYTHON_DEP_FED_DIR +check:rc==0 + +cmd:lsdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service +check:rc==0 + + +cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi +cmd:mount |sort > /tmp/mountoutput/file.org + +cmd:genimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service +check:rc==0 + +cmd:mount |sort > /tmp/mountoutput/file.new +cmd:diff -y /tmp/mountoutput/file.org /tmp/mountoutput/file.new +check:rc==0 +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 +check:rc==0 +check:output=~Provision node\(s\)\: $$SN + + +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 180 + +cmd:a=0;while ! `lsdef -l $$SN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done + +cmd:ping $$SN -c 3 +check:rc==0 +check:output=~64 bytes from $$SN +cmd:lsdef -l $$SN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$SN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$SN mount +check:rc==0 +check:output=~on / type tmpfs +cmd:xdsh $$SN rpm -qa|grep "xCAT-openbmc-py" +check:rc==0 +check:output=~xCAT-openbmc-py-\d +cmd:xdsh $$SN rpm -qa|grep "gevent" +check:rc==0 +check:output=~ gevent-\d +cmd:xdsh $$SN "service httpd status" +check:rc==0 +cmd:xdsh $$SN "service systemd status" +#check:rc==0 + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.org ]; then rm -rf $rootimgdir; mv $rootimgdir.org $rootimgdir; fi +check:rc==0 +cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" +end diff --git a/xCAT-test/autotest/testcase/pythonsupport/cases0 b/xCAT-test/autotest/testcase/pythonsupport/cases0 index 285f4c8f0..eb3cb55ae 100644 --- a/xCAT-test/autotest/testcase/pythonsupport/cases0 +++ b/xCAT-test/autotest/testcase/pythonsupport/cases0 @@ -1,43 +1,40 @@ start:set_up_env_for_support_openbmc_in_python description:this case is used to test environment setup for supporting openbmc in python os:Linux -hcp:openbmc +hcp:openbmc,kvm cmd:mkdir -p /tmp/set_up_env_for_support_openbmc_in_python check:rc==0 -cmd: wget https://bootstrap.pypa.io/get-pip.py --retry-connrefused -O /tmp/set_up_env_for_support_openbmc_in_python/get-pip.py +cmd:#!/usr/bin/bash +echo "[xcat-python-dep-EPEL] +name=epel generated repo +baseurl=file://__REPLACE_PATH__EPEL__ +enabled=1 +gpgcheck=0 + +[xcat-python-dep-EXTRAS] +name=extras generated repo +baseurl=file://__REPLACE_PATH__EXTRAS__ +enabled=1 +gpgcheck=0 + +[xcat-python-dep-FEDORA28] +name=FC28 generated repo +baseurl=file://__REPLACE_PATH__FED__ +enabled=1 +gpgcheck=0" > /etc/yum.repos.d/xcat-dep-python-local.repo check:rc==0 -cmd:python /tmp/set_up_env_for_support_openbmc_in_python/get-pip.py +cmd:sed -i "s|__REPLACE_PATH__EPEL__|$$PYTHON_DEP_EPEL_DIR|g" /etc/yum.repos.d/xcat-dep-python-local.repo check:rc==0 -cmd:yum -y install gcc python-devel libffi-devel openssl-devel +cmd:sed -i "s|__REPLACE_PATH__EXTRAS__|$$PYTHON_DEP_EXTRAS_DIR|g" /etc/yum.repos.d/xcat-dep-python-local.repo check:rc==0 -cmd:rpm -qa |grep "^gcc-" -check:output=~ gcc-\d +cmd:sed -i "s|__REPLACE_PATH__FED__|$$PYTHON_DEP_FED_DIR|" /etc/yum.repos.d/xcat-dep-python-local.repo check:rc==0 -cmd:rpm -qa|grep "^python-devel" -check:output=~ python-devel-\d +cmd: cat /etc/yum.repos.d/xcat-dep-python-local.repo check:rc==0 -cmd:rpm -qa|grep "^libffi-devel" -check:output=~ libffi-devel-\d +cmd:yum install -y xCAT-openbmc-py check:rc==0 -cmd:rpm -qa|grep "^openssl-devel" -check:output=~ openssl-devel-\d -check:rc==0 -cmd:pip install gevent docopt requests paramiko scp -check:rc==0 -cmd:pip list 2>/dev/null | grep "^gevent" -check:output=~ gevent \(\d -check:rc==0 -cmd:pip list 2>/dev/null | grep "^docopt" -check:output=~ docopt \(\d -check:rc==0 -cmd:pip list 2>/dev/null | grep "^requests" -check:output=~ requests \(\d -check:rc==0 -cmd:pip list 2>/dev/null | grep "^paramiko" -check:output=~ paramiko \(\d -check:rc==0 -cmd:pip list 2>/dev/null | grep "^scp" -check:output=~ scp \(\d +cmd:rpm -qa|grep "^xCAT-openbmc-py" +check:output=~ xCAT-openbmc-py-\d check:rc==0 cmd:rm -rf /tmp/set_up_env_for_support_openbmc_in_python check:rc==0 From affa38e7330a5154679063e767e99570cfbefbf2 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Mon, 2 Apr 2018 13:44:26 +0800 Subject: [PATCH 107/161] set rspconfig run on python default (#5040) --- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 2 +- xCAT-server/lib/perl/xCAT/OPENBMC.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 0e6375d68..7d4c48775 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -917,7 +917,7 @@ class OpenBMCRest(object): def set_ipdhcp(self): payload = { "data": [] } - return self.request('PUT', RSPCONFIG_NETINFO_URL['ipdhcp'], payload=payload, cmd="set_bmcip_dhcp") + return self.request('POST', RSPCONFIG_NETINFO_URL['ipdhcp'], payload=payload, cmd="set_bmcip_dhcp") class OpenBMCImage(object): diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 1429626e9..832618247 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -255,7 +255,7 @@ sub run_cmd_in_perl { } # List of commands currently not supported in Python - my @unsupported_in_python_commands = ('rflash', 'rspconfig', 'getopenbmccons'); + my @unsupported_in_python_commands = ('rflash', 'getopenbmccons'); if ($command ~~ @unsupported_in_python_commands) { # Command currently not supported in Python From 950c57ef6d29112964d4cf4a051d9ae30567cdb6 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Mon, 2 Apr 2018 15:31:40 +0800 Subject: [PATCH 108/161] Need paramiko >= 2.0.0, only rspconfig need paramiko (#5034) --- xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py | 4 +++- xCAT-openbmc-py/xCAT-openbmc-py.spec | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 25be9ecb9..7f8039a68 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -20,7 +20,6 @@ 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_bmcconfig import OpenBMCBmcConfigTask from hwctl.executor.openbmc_eventlog import OpenBMCEventlogTask from hwctl.beacon import DefaultBeaconManager from hwctl.setboot import DefaultBootManager @@ -287,6 +286,9 @@ class OpenBMCManager(base.BaseManager): DefaultPowerManager().set_power_state(runner, power_state=action) def rspconfig(self, nodesinfo, args): + + from hwctl.executor.openbmc_bmcconfig import OpenBMCBmcConfigTask + try: opts=docopt(RSPCONFIG_USAGE, argv=args) except DocoptExit as e: diff --git a/xCAT-openbmc-py/xCAT-openbmc-py.spec b/xCAT-openbmc-py/xCAT-openbmc-py.spec index acfe6fdb5..3070167fd 100644 --- a/xCAT-openbmc-py/xCAT-openbmc-py.spec +++ b/xCAT-openbmc-py/xCAT-openbmc-py.spec @@ -20,7 +20,8 @@ BuildArch: noarch Requires: xCAT-server Requires: python-gevent >= 1.2.2-2 Requires: python-greenlet >= 0.4.13-2 -Requires: python2-docopt python-requests python-paramiko python-scp +Requires: python-paramiko >= 2.0.0 +Requires: python2-docopt python-requests python-scp %description xCAT-openbmc-py provides openbmc related functions. From c99b50d5dc7188a646d24620b195b3ef9964cbd2 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Mon, 2 Apr 2018 16:04:44 +0800 Subject: [PATCH 109/161] Fix the issue (#5041) when no server name infor with --verbose, but -V does --- xCAT-client/bin/xcatclient | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-client/bin/xcatclient b/xCAT-client/bin/xcatclient index 7f68579c9..aeb0b7124 100755 --- a/xCAT-client/bin/xcatclient +++ b/xCAT-client/bin/xcatclient @@ -102,9 +102,9 @@ foreach (keys %ENV) { } } -# Allow to print server information when -V +# Allow to print server information when -V/--verbose foreach (reverse(@ARGV)) { - if ($_ eq '-V') { + if ($_ eq '-V' || $_ eq '--verbose') { $ENV{'XCATSHOWSVR'} = 1; last; } From 68f4271dbd63a11cc138bb186397111049f6d75e Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Mon, 2 Apr 2018 16:54:16 +0800 Subject: [PATCH 110/161] updated style based on the comments --- .../performance_tuning/database_tuning.rst | 10 ++-- .../performance_tuning/linux_os_tuning.rst | 55 ++++++++++--------- .../performance_tuning/xcatd_tuning.rst | 24 ++++---- 3 files changed, 44 insertions(+), 45 deletions(-) diff --git a/docs/source/advanced/performance_tuning/database_tuning.rst b/docs/source/advanced/performance_tuning/database_tuning.rst index 29e0997ee..d9919d815 100644 --- a/docs/source/advanced/performance_tuning/database_tuning.rst +++ b/docs/source/advanced/performance_tuning/database_tuning.rst @@ -1,13 +1,13 @@ Tuning the Database Server ========================== -1. MariaDB database +#. MariaDB database -MariaDB: `Tuning Server Parameters `_ + MariaDB: `Tuning Server Parameters `_ -According to this documentation, the two most important variables to configure are key_buffer_size and table_open_cache. + According to this documentation, the two most important variables to configure are key_buffer_size and table_open_cache. -2. PostgreSQL database +#. PostgreSQL database -PostgreSQL: `Server Configuration `_ + PostgreSQL: `Server Configuration `_ diff --git a/docs/source/advanced/performance_tuning/linux_os_tuning.rst b/docs/source/advanced/performance_tuning/linux_os_tuning.rst index 5a7a9833d..315c83e36 100644 --- a/docs/source/advanced/performance_tuning/linux_os_tuning.rst +++ b/docs/source/advanced/performance_tuning/linux_os_tuning.rst @@ -4,42 +4,43 @@ System Tuning Settings for Linux Adjusting Operating System tunables can improve large scale cluster performance, avoid bottlenecks, and prevent failures. The following sections are a collection of suggestions that have been gathered from various large scale HPC clusters. You should investigate and evaluate the validity of each suggestion before applying them to your cluster. -1. Tuning Linux ulimits: +#. Tuning Linux ulimits: -The open file limits are important to high concurrence network services, such as *xcatd*. For a large cluster, it is required to increase the number of open file limit to avoid **Too many open files** error. The default value is *1024* in most OS distributions, to add below configuration in ``/etc/security/limits.conf`` to increase to *14096*. -:: + The open file limits are important to high concurrence network services, such as ``xcatd``. For a large cluster, it is required to increase the number of open file limit to avoid **Too many open files** error. The default value is *1024* in most OS distributions, to add below configuration in ``/etc/security/limits.conf`` to increase to *14096*. + :: - * soft nofiles 14096 - * hard nofiles 14096 + * soft nofiles 14096 + * hard nofiles 14096 -2. Tuning Network kernel parameters: +#. Tuning Network kernel parameters: -There might be hundreds of hosts in a big network for large cluster, tuning the network kernel parameters for optimum throughput and latency could improve the performance of distributed application. For example, adding below configuration in ``/etc/sysctl.conf`` to increase the buffer. + There might be hundreds of hosts in a big network for large cluster, tuning the network kernel parameters for optimum throughput and latency could improve the performance of distributed application. For example, adding below configuration in ``/etc/sysctl.conf`` to increase the buffer. -:: + :: - net.core.rmem_max = 33554432 - net.core.wmem_max = 33554432 - net.core.rmem_default = 65536 - net.core.wmem_default = 65536 - - net.ipv4.tcp_rmem = 4096 33554432 33554432 - net.ipv4.tcp_wmem = 4096 33554432 33554432 - net.ipv4.tcp_mem= 33554432 33554432 33554432 - net.ipv4.route.flush=1 - net.core.netdev_max_backlog=1500 + net.core.rmem_max = 33554432 + net.core.wmem_max = 33554432 + net.core.rmem_default = 65536 + net.core.wmem_default = 65536 + + net.ipv4.tcp_rmem = 4096 33554432 33554432 + net.ipv4.tcp_wmem = 4096 33554432 33554432 + net.ipv4.tcp_mem= 33554432 33554432 33554432 + net.ipv4.route.flush=1 + net.core.netdev_max_backlog=1500 -And if you encounter **Neighbour table overflow** error, it meams there are two many ARP requests and the server cannot reply. Tune the ARP cache with below parameters. + And if you encounter **Neighbour table overflow** error, it meams there are two many ARP requests and the server cannot reply. Tune the ARP cache with below parameters. -:: + :: - net.ipv4.conf.all.arp_filter = 1 - net.ipv4.conf.all.rp_filter = 1 - net.ipv4.neigh.default.gc_thresh1 = 30000 - net.ipv4.neigh.default.gc_thresh2 = 32000 - net.ipv4.neigh.default.gc_thresh3 = 32768 - net.ipv4.neigh.ib0.gc_stale_time = 2000000 + net.ipv4.conf.all.arp_filter = 1 + net.ipv4.conf.all.rp_filter = 1 + net.ipv4.neigh.default.gc_thresh1 = 30000 + net.ipv4.neigh.default.gc_thresh2 = 32000 + net.ipv4.neigh.default.gc_thresh3 = 32768 + net.ipv4.neigh.ib0.gc_stale_time = 2000000 -For more tunable parameters, you can refer to "Linux System Tuning Recommendations". + + For more tunable parameters, you can refer to `Linux System Tuning Recommendations `_. diff --git a/docs/source/advanced/performance_tuning/xcatd_tuning.rst b/docs/source/advanced/performance_tuning/xcatd_tuning.rst index ce276ed02..577038326 100644 --- a/docs/source/advanced/performance_tuning/xcatd_tuning.rst +++ b/docs/source/advanced/performance_tuning/xcatd_tuning.rst @@ -1,27 +1,25 @@ Tuning xCAT Daemon Attributes ================================== -For large clusters, you consider changing the default settings in `site` table to improve the performance on a large-scale cluster or if you are experiencing timeouts or failures in these areas: +For large clusters, you consider changing the default settings in ``site`` table to improve the performance on a large-scale cluster or if you are experiencing timeouts or failures in these areas: -*consoleondemand* : When set to 'yes', conserver connects and creates the console output for a node only when the user explicitly opens the console using rcons or wcons. Default is 'no' on Linux, 'yes' on AIX. Setting this to 'yes' can reduce the load conserver places on your xCAT management node. If you need this set to 'no', you may then need to consider setting up multiple servers to run the conserver daemon, and specify the correct server on a per-node basis by setting each node's conserver attribute. +**consoleondemand** : When set to ``yes``, conserver connects and creates the console output for a node only when the user explicitly opens the console using rcons or wcons. Default is ``no`` on Linux, ``yes`` on AIX. Setting this to ``yes`` can reduce the load conserver places on your xCAT management node. If you need this set to ``no``, you may then need to consider setting up multiple servers to run the conserver daemon, and specify the correct server on a per-node basis by setting each node's conserver attribute. -*nodestatus* : If set to 'n', the nodelist.status column will not be updated during the node deployment, node discovery and power operations. Default is 'y', always update nodelist.status. Setting this to 'n' for large clusters can eliminate one node-to-server contact and one xCAT database write operation for each node during node deployment, but you will then need to determine deployment status through some other means. +**nodestatus** : If set to ``n``, the ``nodelist.status`` column will not be updated during the node deployment, node discovery and power operations. Default is ``y``, always update ``nodelist.status``. Setting this to ``n`` for large clusters can eliminate one node-to-server contact and one xCAT database write operation for each node during node deployment, but you will then need to determine deployment status through some other means. -*precreatemypostscripts* : (yes/1 or no/0, only for Linux). Default is no. If yes, it will instruct xcat at nodeset and updatenode time to query the database once for all of the nodes passed into the command and create the mypostscript file for each node, and put them in a directory in tftpdir(such as: /tftpboot). This prevents xcatd from having to create the mypostscript files one at a time when each deploying node contacts it, so it will speed up the deployment process. (But it also means that if you change database values for these nodes, you must rerun nodeset.) If precreatemypostscripts is set to no, the mypostscript files will not be generated ahead of time. Instead they will be generated when each node is deployed. +**precreatemypostscripts** : (``yes/1`` or ``no/0``, only for Linux). Default is ``no``. If ``yes``, it will instruct xcat at ``nodeset`` and ``updatenode`` time to query the database once for all of the nodes passed into the command and create the ``mypostscript`` file for each node, and put them in a directory in ``site.tftpdir`` (such as: ``/tftpboot``). This prevents ``xcatd`` from having to create the ``mypostscript`` files one at a time when each deploying node contacts it, so it will speed up the deployment process. (But it also means that if you change database values for these nodes, you must rerun ``nodeset``.) If **precreatemypostscripts** is set to ``no``, the ``mypostscript`` files will not be generated ahead of time. Instead they will be generated when each node is deployed. -*svloglocal* : if set to 1, syslog on the service node will not get forwarded to the mgmt node. The default is to forward all syslog messages. The tradeoff on setting this attribute is reducing network traffic and log size versus having local management node access to all system messages from across the cluster. +**svloglocal** : if set to ``1``, syslog on the service node will not get forwarded to the mgmt node. The default is to forward all syslog messages. The tradeoff on setting this attribute is reducing network traffic and log size versus having local management node access to all system messages from across the cluster. -*skiptables* : a comma separated list of tables to be skipped by dumpxCATdb. A recommended setting is "auditlog,eventlog" because these tables can grow very large. Default is to skip no tables. +**skiptables** : a comma separated list of tables to be skipped by ``dumpxCATdb``. A recommended setting is ``auditlog,eventlog`` because these tables can grow very large. Default is to skip no tables. -*useNmapfromMN* : When set to yes, nodestat command should obtain the node status using nmap (if available) from the management node instead of the service node. This will improve the performance in a flat network. Default is 'no'. +**dhcplease** : The lease time for the DHCP client. The default value is *43200*. -*dhcplease* : The lease time for the dhcp client. The default value is 43200. +**xcatmaxconnections** : Number of concurrent xCAT protocol requests before requests begin queueing. This applies to both client command requests and node requests, e.g. to get postscripts. Default is ``64``. -*xcatmaxconnections* : Number of concurrent xCAT protocol requests before requests begin queueing. This applies to both client command requests and node requests, e.g. to get postscripts. Default is 64. +**xcatmaxbatchconnections** : Number of concurrent xCAT connections allowed from the nodes. Number must be less than **xcatmaxconnections**. -*xcatmaxbatchconnections* : Number of concurrent xCAT connections allowed from the nodes. Number must be less than xcatmaxconnections. See useflowcontrol attribute. - -*useflowcontrol* : If yes, the postscript processing on each node contacts xcatd on the MN/SN using a lightweight UDP packet to wait until xcatd is ready to handle the requests associated with postscripts. This prevents deploying nodes from flooding xcatd and locking out admin interactive use. This value works with the *xcatmaxconnections* and *xcatmaxbatch* attributes. If the value is no, nodes sleep for a random time before contacting xcatd, and retry. The default is no.. Not supported on AIX. +**useflowcontrol** : If ``yes``, the postscript processing on each node contacts ``xcatd`` on the MN/SN using a lightweight UDP packet to wait until ``xcatd`` is ready to handle the requests associated with postscripts. This prevents deploying nodes from flooding ``xcatd`` and locking out admin interactive use. This value works with the **xcatmaxconnections** and **xcatmaxbatch** attributes. If the value is ``no``, nodes sleep for a random time before contacting ``xcatd``, and retry. The default is ``no``. Not supported on AIX. -These attributes may be changed based on the size of your cluster. For a large cluster, it is better to enable *useflowcontrol* and set *xcatmaxconnection = 128*, *xcatmaxbatchconnections = 100*. Then the daemon will only allow 100 concurrent connections from the nodes. This will allow 28 connections still to be available on the management node for xCAT commands (e.g nodels). +These attributes may be changed based on the size of your cluster. For a large cluster, it is better to enable **useflowcontrol** and set ``xcatmaxconnection = 128``, ``xcatmaxbatchconnections = 100``. Then the daemon will only allow 100 concurrent connections from the nodes. This will allow 28 connections still to be available on the management node for xCAT commands (e.g ``nodels``). From cd07bf9d16efc77a6fcc4bf7bbd3dc4f302da66e Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 30 Mar 2018 11:19:16 -0400 Subject: [PATCH 111/161] Updated for review comments --- .../restapi/restapi_setup/restapi_setup.rst | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst b/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst index 3208826bc..84e15230f 100644 --- a/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst +++ b/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst @@ -75,7 +75,7 @@ The REST API client needs to download the xCAT certificate CA from the xCAT http When accessing the REST API, the certificate CA must be specified and the FQDN of the https server must be used. For example: :: - curl -X GET --cacert /root/ca-cert.pem 'https:///xcatws/nodes?userName=root& userPW=cluster' + curl -X GET --cacert /root/ca-cert.pem 'https:///xcatws/nodes?userName=root&userPW=' Extend the Timeout of Web Server ================================ @@ -83,10 +83,10 @@ Extend the Timeout of Web Server Some operations like 'create osimage' (copycds) need a long time (longer than 3 minutes sometimes) to complete. It would fail with a ``timeout error`` (504 Gateway Time-out) if the timeout setting in the web server is not extended: :: For [RHEL] - Edit /etc/httpd/conf/httpd.conf and change existing or add new entry: "Timeout 600" - service htttd restart + Edit "/etc/httpd/conf/httpd.conf" and change existing or add new entry: "Timeout 600" + service httpd restart For [SLES] - Edit /etc/apache2/httpd.conf and change existing or add new entry: "Timeout 600" + Edit "/etc/apache2/httpd.conf" and change existing or add new entry: "Timeout 600" service apache2 restart Set Up an Account for Web Service Access @@ -114,21 +114,27 @@ Use non-root Account Create new user and setup the password and policy rules. :: - useradd -u wsuser - passwd wsuser # set the password - tabch key=xcat,username=wsuser passwd.password= - mkdef -t policy 6 name=wsuser rule=allow + # create a user + useradd -u + # set the password + passwd + # add password to passwd table + tabch key=xcat,username= passwd.password= + # add user to policy table + mkdef -t policy 6 name= rule=allow ``Note:`` in the tabch command above you can put the salted password (from /etc/shadow) in the xCAT passwd table instead of the clear text password, if you prefer. -Identical user with the same name and userid need to be created on each compute node. :: +Identical user with the same name and uid need to be created on each compute node. :: - useradd -u wsuser - passwd wsuser # set the password + # create a user + useradd -u + # set the password + passwd Create the SSL certificate under that user's home directory so that user can be authenticated to xCAT. This is done by running the following command on the Management node as root: :: - /opt/xcat/share/xcat/scripts/setup-local-client.sh + /opt/xcat/share/xcat/scripts/setup-local-client.sh When running this command you'll see SSL certificates created. Enter "y" where prompted and take the defaults. @@ -138,11 +144,11 @@ To enable the POST method of resources like nodeshell, nodecopy, updating and fi Run a test request to see if everything is working: :: - curl -X GET --cacert /root/ca-cert.pem 'https:///xcatws/nodes?userName=&userPW=' + curl -X GET --cacert /root/ca-cert.pem 'https:///xcatws/nodes?userName=&userPW=' or if you did not set up the certificate: :: - curl -X GET -k 'https:///xcatws/nodes?userName=&userPW=' + curl -X GET -k 'https:///xcatws/nodes?userName=&userPW=' You should see some output that includes your list of nodes. From c2373953d35eb957b23cf193e729a055664f4c37 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Mon, 2 Apr 2018 20:38:55 -0400 Subject: [PATCH 112/161] ADD NODE name to the /opt/xcat/xcatinfo for statelite image --- xCAT/postscripts/xcatdsklspost | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 4113667db..083320d6b 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -692,6 +692,12 @@ if [ $? -eq 0 ]; then else echo "USEFLOWCONTROL=$new_fc" >> /opt/xcat/xcatinfo fi +grep 'NODE' /opt/xcat/xcatinfo > /dev/null 2>&1 +if [ $? -eq 0 ]; then + sed -i "s/NODE=.*/NODE=$NODE/" /opt/xcat/xcatinfo +else + echo "NODE=$NODE" >> /opt/xcat/xcatinfo +fi # Store the SERVICEGROUP into the xcatinfo file for node deployment, and also for updatenode -s if [ $NODE_DEPLOYMENT -eq 1 ] || [ "$MODE" = "1" ]; then From 351cd68005e4fb42975587d483dd3c70f6df8f94 Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 3 Apr 2018 03:20:50 -0400 Subject: [PATCH 113/161] correct some typo --- .../autotest/testcase/xcat-inventory/cases.osimage.validation | 2 +- .../autotest/testcase/xcat-inventory/cases.site.validation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation index 372a34020..b52057c3f 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.osimage.validation @@ -7,7 +7,7 @@ cmd: mkdir -p /tmp/xcat_inventory_import_validation_osimage/trash/ cmd: mkdir -p /tmp/xcat_inventory_import_validation_osimage/backup/ cmd: lsdef -t osimage -o testosimage1 -z 2>/dev/null >/tmp/xcat_inventory_import_validation_osimage/backup/testosimage1.stanza -cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "compute" "/tmp/tmp/xcat_inventory_import_validation_osimage/trash/" +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "compute" "/tmp/xcat_inventory_import_validation_osimage/trash/" check: rc==0 cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "service" "/tmp/xcat_inventory_import_validation_osimage/trash/" check: rc==0 diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation b/xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation index 23a9237d3..4008a2bfc 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.site.validation @@ -7,7 +7,7 @@ cmd: mkdir -p /tmp/xcat_inventory_import_validation_site/trash/ cmd: mkdir -p /tmp/xcat_inventory_import_validation_site/backup/ cmd: lsdef -t site -o clustersite -z 2>/dev/null >/tmp/xcat_inventory_import_validation_site/backup/clustersite.stanza -cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "0" "/tmp/tmp/xcat_inventory_import_validation_site/trash/" +cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "0" "/tmp/xcat_inventory_import_validation_site/trash/" check: rc==0 cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "site" "clustersite" "dbtracelevel" "1" "/tmp/xcat_inventory_import_validation_site/trash/" check: rc==0 From 8a45b4e52504f13c190848ccaacf1aa0650a9914 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Tue, 3 Apr 2018 03:21:32 -0400 Subject: [PATCH 114/161] fix a bug for go-xcat test cases --- xCAT-test/autotest/testcase/go-xcat/case0 | 28 +++++++++++------------ xCAT-test/autotest/testcase/go-xcat/case1 | 16 ++++++------- xCAT-test/autotest/testcase/go-xcat/case2 | 24 +++++++++---------- xCAT-test/autotest/testcase/go-xcat/case4 | 4 ++-- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/xCAT-test/autotest/testcase/go-xcat/case0 b/xCAT-test/autotest/testcase/go-xcat/case0 index 49181c35b..2f575d4aa 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case0 +++ b/xCAT-test/autotest/testcase/go-xcat/case0 @@ -21,10 +21,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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 check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -59,10 +59,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core -y install" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -97,10 +97,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core.tar -y install" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -135,10 +135,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -181,10 +181,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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 check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -223,10 +223,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -259,10 +259,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" diff --git a/xCAT-test/autotest/testcase/go-xcat/case1 b/xCAT-test/autotest/testcase/go-xcat/case1 index 24db15efc..c2eac9449 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case1 +++ b/xCAT-test/autotest/testcase/go-xcat/case1 @@ -15,10 +15,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --yes install" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -49,10 +49,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;cd /;if grep Ubuntu /etc/*release;then cd / ; wget http://xcat.org/files/xcat/repos/apt/$migration_version/xcat-core/buildinfo;else cd / ; wget http://xcat.org/files/xcat/repos/yum/$migration_version/xcat-core/buildinfo; fi @@ -91,10 +91,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -125,10 +125,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;cd /;if grep Ubuntu /etc/*release;then cd / ; wget http://xcat.org/files/xcat/repos/apt/$migration_version/xcat-core/buildinfo;else cd / ; wget http://xcat.org/files/xcat/repos/yum/$migration_version/xcat-core/buildinfo; fi diff --git a/xCAT-test/autotest/testcase/go-xcat/case2 b/xCAT-test/autotest/testcase/go-xcat/case2 index 65eae3b44..1017d054c 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case2 +++ b/xCAT-test/autotest/testcase/go-xcat/case2 @@ -10,10 +10,10 @@ cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/yum/$$BRANCH/core-snap/xCAT-core.repo -y install" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 check:output=~Version $$BRANCH @@ -45,10 +45,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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 check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 check:output=~Version $$BRANCH @@ -80,10 +80,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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 check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 check:output=~Version 2.12 @@ -110,10 +110,10 @@ cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:dir="__GETNODEATTR($$CN,os)__"; if grep SUSE /etc/*release;then os=`echo $dir |cut -c 1-6` && xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/yum/devel/core-snap/xCAT-core.repo --xcat-dep=http://xcat.org/files/xcat/repos/yum/xcat-dep/$os/__GETNODEATTR($$CN,arch)__/xCAT-dep.repo -y install" ; elif grep "Red Hat" /etc/*release;then os=`echo $dir |cut -c 1-2` && xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/yum/devel/core-snap/xCAT-core.repo --xcat-dep=http://xcat.org/files/xcat/repos/yum/xcat-dep/$os`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/xCAT-dep.repo -y install";fi check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -146,10 +146,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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 check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" @@ -181,10 +181,10 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:rm -rf /tmp/go-xcat.log +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 check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" diff --git a/xCAT-test/autotest/testcase/go-xcat/case4 b/xCAT-test/autotest/testcase/go-xcat/case4 index 3bf2af7e0..54e0dce6e 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case4 +++ b/xCAT-test/autotest/testcase/go-xcat/case4 @@ -26,10 +26,10 @@ check:rc==0 cmd:xdsh $$CN "lsxcatd -v" check:rc==0 check:output=~Version $$MIGRATION1_VERSION -cmd:rm -rf /tmp/go-xcat.log +cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat update -y" check:rc==0 -cmd:cat /tmp/go-xcat.log +cmd:xdsh $$CN "cat /tmp/go-xcat.log" check:output=~xCAT has been successfully updated cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 From d2bb5a7290e7939eaec36ac46c069861d538a5ef Mon Sep 17 00:00:00 2001 From: bybai Date: Tue, 3 Apr 2018 05:33:47 -0400 Subject: [PATCH 115/161] add xCAT REST API for nodels --- xCAT-server/xCAT-wsapi/xcatws.cgi | 66 +++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 5fbea07ca..2dad37a46 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -138,6 +138,18 @@ my %URIdef = ( outhdler => \&actionout, }, }, + nodels => { + desc => "[URI:/nodes/{noderange}/nodels}] - Lists the nodes", + matcher => '^/nodes/[^/]*/nodels$', + GET => { + desc => "Lists the nodes.", + usage => "||An object which includes multiple entries like: : nodels|", + example => "|Get the running status for node node1|GET|/nodes/node1/nodels|", + cmd => "nodels", + fhandler => \&actionhdl, + outhdler => \&nodelsout, + }, + }, nodehost => { desc => "[URI:/nodes/{noderange}/host] - The mapping of ip and hostname for the node {noderange}", matcher => '^/nodes/[^/]*/host$', @@ -1755,6 +1767,56 @@ sub defout_remove_appended_info { } } +#handle output of nodels command +#input data like: +#$VAR1 = [ +# { +# 'xcatdsource' => [ +# 'bybc0602' +# ], +# 'node' => [ +# { +# 'name' => [ +# 'node1' +# ] +# }, +# { +# 'name' => [ +# 'node2' +# ] +# }, +# { +# 'name' => [ +# 'node3' +# ] +# } +# ] +# } +# ]; + +#TO: +#------------ +# [ +# 'node1', +# 'node2', +# 'node3' +# ]; +sub nodelsout { + my $data = shift; + my $json; + foreach my $d (@$data) { + my $jsonnode; + my $lines = $d->{node}; + foreach my $l (@$lines) { + + push(@{$json}, $l->{name}[0]); + + } + } + if ($json) { + addPageContent($JSON->encode($json), 1); + } +} sub localresout { my $data = shift; @@ -2060,6 +2122,10 @@ sub actionhdl { } else { error("Missed Action.", $STATUS_NOT_FOUND); } + } elsif ($params->{'resourcename'} eq "nodels") { + if (isGET()) { + + } } elsif ($params->{'resourcename'} =~ /(energy|energyattr)/) { if (isGET()) { if ($params->{'resourcename'} eq "energy") { From 3e9acb10d25ccfe7240fc88f7039c7595a7cf8c2 Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Tue, 3 Apr 2018 17:43:49 +0800 Subject: [PATCH 116/161] fix bug of test case updatenode_syncfile_MERGE (#5049) --- xCAT-test/autotest/testcase/updatenode/cases0 | 63 +++++++++++++------ 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index 9d8f7b6bb..4ef2115a7 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -211,35 +211,58 @@ check:rc==0 end start:updatenode_syncfile_MERGE -cmd:echo "bin:x:1:1:bin:/bin:/bin/bash" > /tmp/passwd -cmd:echo "test:x:1:1:bin:/bin:/bin/bash" >> /tmp/passwd -cmd:echo "bin:*:15385::::::" > /tmp/shadow -cmd:echo "test:*:15385::::::" >> /tmp/shadow -cmd:echo "bin:x:1:daemon" > /tmp/group -cmd:echo "test:x:1:daemon" >> /tmp/group -cmd:echo "MERGE:" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "/tmp/passwd -> /etc/passwd" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "/tmp/shadow -> /etc/shadow" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "/tmp/group -> /etc/group" >> /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:mkdir -p /tmp/updatenode_syncfile_MERGE +check:rc==0 +cmd:xdsh $$CN "mkdir -p /tmp/updatenode_syncfile_MERGE" +check:rc==0 +cmd:xdsh $$CN "cp /etc/passwd /etc/shadow /etc/group /tmp/updatenode_syncfile_MERGE" +check:rc==0 +cmd:xdsh $$CN "groupadd -g 19999 bogusgroup" +check:rc==0 +cmd:xdsh $$CN "useradd -g bogusgroup bogususer" +check:rc==0 +cmd:xdsh $$CN "grep bogususer /etc/passwd" +cmd:xdsh $$CN "grep bogususer /etc/shadow" +cmd:xdsh $$CN "grep bogusgroup /etc/group" +cmd:echo "bogususer:x:1000:19998::/home/bogususer:/bin/bash" > /tmp/updatenode_syncfile_MERGE/passwd +cmd:echo "bogususer1:x:1001:19998::/home/bogususer1:/bin/bash" >> /tmp/updatenode_syncfile_MERGE/passwd +cmd:echo "bogususer:*:15385::::::" > /tmp/updatenode_syncfile_MERGE/shadow +cmd:echo "bogususer1:*:15385::::::" >> /tmp/updatenode_syncfile_MERGE/shadow +cmd:echo "bogusgroup:x:29999:" > /tmp/updatenode_syncfile_MERGE/group +cmd:echo "bogusgroup1:x:19998:" >> /tmp/updatenode_syncfile_MERGE/group +cmd:echo "MERGE:" > /tmp/updatenode_syncfile_MERGE/compute.synclist +cmd:echo "/tmp/updatenode_syncfile_MERGE/passwd -> /etc/passwd" >> /tmp/updatenode_syncfile_MERGE/compute.synclist +cmd:echo "/tmp/updatenode_syncfile_MERGE/shadow -> /etc/shadow" >> /tmp/updatenode_syncfile_MERGE/compute.synclist +cmd:echo "/tmp/updatenode_syncfile_MERGE/group -> /etc/group" >> /tmp/updatenode_syncfile_MERGE/compute.synclist +cmd:cat /tmp/updatenode_syncfile_MERGE/compute.synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/tmp/updatenode_syncfile_MERGE/compute.synclist check:rc==0 cmd:updatenode $$CN -F check:rc==0 -cmd:xdsh $$CN "cat /etc/passwd |grep -i \"bin:x:1:1:bin:/bin:/bin/bash\"|wc -l" -check:output=~1 -cmd:xdsh $$CN "cat /etc/passwd |grep -i \"test:x:1:1:bin:/bin:/bin/bash\"" +cmd:xdsh $$CN "cat /etc/passwd |grep -i \"bogususer1:x:1001:19998::/home/bogususer1:/bin/bash\"" check:rc==0 -cmd:xdsh $$CN "cat /etc/shadow |grep -i \"bin:*:15385::::::\"|wc -l" -check:output=~1 -cmd:xdsh $$CN "cat /etc/shadow |grep -i test" +cmd:xdsh $$CN "cat /etc/passwd |grep -i bogususer||grep -v -i bogususer1|grep 19998" check:rc==0 -cmd:xdsh $$CN "cat /etc/group |grep -i \"bin:x:1:daemon\"|wc -l" +cmd:xdsh $$CN "cat /etc/shadow |grep -i \"bogususer:\*:15385::::::\"" +check:rc==0 +cmd:xdsh $$CN "cat /etc/shadow |grep -i \"bogususer1:\*:15385::::::\"" +check:rc==0 +cmd:xdsh $$CN "cat /etc/group |grep -i bogusgroup1|grep 19998" check:output=~1 -cmd:xdsh $$CN "cat /etc/group |grep -i test" +cmd:xdsh $$CN "cat /etc/group |grep -i bogusgroup|grep 29999" +check:rc==0 +cmd:xdsh $$CN "mv -f /tmp/updatenode_syncfile_MERGE/passwd /etc/passwd" +check:rc==0 +cmd:xdsh $$CN "mv -f /tmp/updatenode_syncfile_MERGE/group /etc/group" +check:rc==0 +cmd:xdsh $$CN "mv -f /tmp/updatenode_syncfile_MERGE/shadow /etc/shadow" +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/updatenode_syncfile_MERGE" check:rc==0 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 +cmd:rm -rf /tmp/updatenode_syncfile_MERGE +check:rc==0 end start:updatenode_P_script1 From eb967a72e6caacf62c57421c83662a6988277a89 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Tue, 3 Apr 2018 17:44:33 +0800 Subject: [PATCH 117/161] catch all type error for rspconfig options (#5048) --- .../python/agent/hwctl/executor/openbmc_bmcconfig.py | 6 +++--- .../lib/python/agent/hwctl/openbmc_client.py | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 104a3bd2f..322827da5 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -145,7 +145,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): for key in keys: self._dump_download(obmc, node, str(key)) - except SelfServerException as e: + except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) def dump_process(self, **kw): @@ -174,7 +174,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): else: self.callback.error('Could not find dump %s after waiting %d seconds.' % (dump_id, 20 * 15), node) - except SelfServerException as e: + except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) def gard_clear(self, **kw): @@ -188,7 +188,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): obmc.clear_gard() self.callback.info('%s: GARD cleared' % node) - except SelfServerException as e: + except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) def pre_set_sshcfg(self, *arg, **kw): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 7d4c48775..a73281a3a 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -198,8 +198,8 @@ RSPCONFIG_APIS = { 'get_data': [], 'display_name': "BMC PowerSupplyRedundancy", 'attr_values': { - 'disabled': "Disables", - 'enabled': "Enabled", + 'disabled': ["Disables"], + 'enabled': ["Enabled"], }, }, 'powerrestorepolicy': { @@ -751,7 +751,11 @@ class OpenBMCRest(object): data = attr_info['attr_values'][value] else: data = value - self.request('PUT', set_url, payload={"data": data}, cmd="set_%s" % key) + + method = 'PUT' + if key == 'powersupplyredundancy': + method = 'POST' + self.request(method, set_url, payload={"data": data}, cmd="set_%s" % key) def get_apis_values(self, key): attr_info = RSPCONFIG_APIS[key] From f7867c9e516f28843b498e69399c6029adf52bca Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Tue, 3 Apr 2018 18:13:55 +0800 Subject: [PATCH 118/161] workaround python agent when /dev/log is not available (#5051) --- xCAT-openbmc-py/lib/python/agent/common/utils.py | 6 +++++- xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/common/utils.py b/xCAT-openbmc-py/lib/python/agent/common/utils.py index e84bca7b1..a2f2e00b0 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/utils.py +++ b/xCAT-openbmc-py/lib/python/agent/common/utils.py @@ -23,7 +23,11 @@ def getxCATLog(name=None): return xl def enableSyslog(name='xcat'): - h = SysLogHandler(address='/dev/log', facility=SysLogHandler.LOG_LOCAL4) + try: + h = SysLogHandler(address='/dev/log', facility=SysLogHandler.LOG_LOCAL4) + except: + # this will connect localhost:514 + h = SysLogHandler(facility=SysLogHandler.LOG_LOCAL4) h.setFormatter(logging.Formatter('%s: ' % name + '%(levelname)s %(message)s')) logging.getLogger('xcatagent').addHandler(h) diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 7f8039a68..c7cf2a85c 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -33,8 +33,11 @@ from hwctl.eventlog import DefaultEventlogManager from xcatagent import base import logging logger = logging.getLogger('xcatagent') -if not logger.handlers: - utils.enableSyslog('xcat.agent') +try: + if not logger.handlers: + utils.enableSyslog('xcat.agent') +except: + pass HTTP_PROTOCOL = "https://" PROJECT_URL = "/xyz/openbmc_project" From 302e80dc9384ed14d4aa5bfe275608807a638c2a Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 3 Apr 2018 15:34:12 -0400 Subject: [PATCH 119/161] Add Image name/uuid/timestamp to /opt/xcat/xcatinfo --- xCAT-server/lib/xcat/plugins/statelite.pm | 12 ++++++++++++ xCAT/postscripts/xcatdsklspost | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index e6f2e5e2d..2d76a55b8 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -531,6 +531,18 @@ sub process_request { # before packaging the image system("umount $rootimg_dir/proc"); + #put the image name, uuid and timestamp into diskless image when it is packed. + $callback->({ data => ["add image info to xcatinfo file"] }); + `echo IMAGENAME="'$imagename'" > $rootimg_dir/opt/xcat/xcatinfo`; + + my $uuid = `uuidgen`; + chomp $uuid; + `echo IMAGEUUID="'$uuid'" >> $rootimg_dir/opt/xcat/xcatinfo`; + + my $timestamp = `date`; + chomp $timestamp; + `echo TIMESTAMP="'$timestamp'" >> $rootimg_dir/opt/xcat/xcatinfo`; + my $verb = "Packing"; my $temppath; diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 083320d6b..4ec93d7aa 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -384,12 +384,6 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) if [ -z "$NODE" ]; then NODE=`hostname -s` fi - grep 'NODE' /opt/xcat/xcatinfo > /dev/null 2>&1 - if [ $? -eq 0 ]; then - sed -i "s/NODE=.*/NODE=$NODE/" /opt/xcat/xcatinfo - else - echo "NODE=$NODE" >> /opt/xcat/xcatinfo - fi downloaded=0; # have not downloaded the postscripts # try the -m/-M input (P_SIP) if it is specified, @@ -692,6 +686,11 @@ if [ $? -eq 0 ]; then else echo "USEFLOWCONTROL=$new_fc" >> /opt/xcat/xcatinfo fi + +# Add Node name to /opt/xcat/xcatinfo +if [ -z "$NODE" ]; then + NODE=`hostname -s` +fi grep 'NODE' /opt/xcat/xcatinfo > /dev/null 2>&1 if [ $? -eq 0 ]; then sed -i "s/NODE=.*/NODE=$NODE/" /opt/xcat/xcatinfo @@ -699,6 +698,7 @@ else echo "NODE=$NODE" >> /opt/xcat/xcatinfo fi + # Store the SERVICEGROUP into the xcatinfo file for node deployment, and also for updatenode -s if [ $NODE_DEPLOYMENT -eq 1 ] || [ "$MODE" = "1" ]; then sn_group=`grep '^SERVICEGROUP' /$xcatpost/mypostscript |cut -d= -f2 | tr -d \'\"` From 033d12253032818e680b2556e34da00f0609b2a1 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Wed, 4 Apr 2018 09:36:44 +0800 Subject: [PATCH 120/161] fix issue 5047, modify url for rspconfig autoreboot (#5052) --- .../lib/python/agent/hwctl/executor/openbmc_bmcconfig.py | 2 +- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 322827da5..8890f5ce2 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -400,7 +400,7 @@ rmdir \"/tmp/$userid\" \n") return self.callback.error(e.message, node) if isinstance(value, dict): - str_value = value.values()[0] + str_value = str(value.values()[0]) elif value: str_value = str(value) else: diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index a73281a3a..a33714129 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -181,8 +181,8 @@ RSPCONFIG_APIS = { 'display_name': "BMC Hostname", }, 'autoreboot' : { - 'baseurl': "/control/host0/auto_reboot/", - 'set_url': "attr/AutoReboot", + 'baseurl': "/control/host0/auto_reboot", + 'set_url': "/attr/AutoReboot", 'get_url': "", 'display_name': "BMC AutoReboot", 'attr_values': { From 6d5ca924f74d407517b6fb3063cf323199c4339c Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 4 Apr 2018 01:18:07 -0400 Subject: [PATCH 121/161] Refine test cases based on new output --- xCAT-test/autotest/testcase/reventlog/cases0 | 2 +- xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 | 9 +++------ xCAT-test/autotest/testcase/rspconfig/cases0 | 11 +++++------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/xCAT-test/autotest/testcase/reventlog/cases0 b/xCAT-test/autotest/testcase/reventlog/cases0 index 82fa7cc30..8ebfcdec6 100644 --- a/xCAT-test/autotest/testcase/reventlog/cases0 +++ b/xCAT-test/autotest/testcase/reventlog/cases0 @@ -33,7 +33,7 @@ cmd:reventlog $$CN 10 -s 1 check:output=~The -s option is not supported for OpenBMC check:rc!=0 cmd:reventlog $$CN -s all -check:output=~The -s option is not supported for OpenBMC +check:output=~The -s option is not supported for OpenBMC|Only one option is supported at the same time for reventlog check:rc!=0 cmd:reventlog $$CN -s check:output=~Error: Unsupported command diff --git a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 index 4db2ba69b..a0f2d8fd0 100644 --- a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 +++ b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 @@ -448,22 +448,19 @@ check:rc != 0 cmd:mkdir -p /tmp/bogus123 check:rc == 0 cmd:rflash $$CN /tmp/bogus123 -d -check:output =~Error: No BMC tar file found -check:output =~Error: No Host tar file found +check:output =~Error: No BMC tar file found|Can't open directory check:output!~Attempting to check:rc != 0 cmd:touch /tmp/bogus123/obmc-phosphor-image-witherspoon.ubi.mtd.tar check:rc == 0 cmd:rflash $$CN -d /tmp/bogus123 -check:output =~Error: No BMC tar file found -check:output =~Error: No Host tar file found +check:output =~Error: No BMC tar file found|Can't open directory check:output!~Attempting to check:rc != 0 cmd:touch /tmp/bogus123/witherspoon.pnor.squashfs.tar check:rc == 0 cmd:rflash $$CN -d /tmp/bogus123 -check:output =~Error: No BMC tar file found -check:output =~Error: No Host tar file found +check:output =~Error: No BMC tar file found|Can't open directory check:output!~Attempting to check:rc != 0 cmd:rm -rf /tmp/bogus123 diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index 5dc0ee6a8..1054e48fa 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -127,7 +127,7 @@ start:rspconfig_set_vlan description:rspconfig change openbmc gateway Attribute: $$CN-The operation object of rspconfig command cmd:rspconfig $$CN vlan=0 -check:output=~Error: Invalid parameter for option vlan +check:output=~Error: Invalid parameter for option vlan|Error: VLAN must be configured with IP, netmask and gateway check:rc!=0 cmd:rspconfig $$CN vlan=111 check:output=~Error: VLAN must be configured with IP, netmask and gateway @@ -258,6 +258,7 @@ check:rc == 0 cmd:rspconfig $$CN hostname=* check:rc == 0 check:output =~ Invalid OpenBMC Hostname +cmd:ssh __GETNODEATTR(f6u03,bmc)__ "hostname" end @@ -342,17 +343,15 @@ cmd:rspconfig $$CN sshcfg check:rc == 0 cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_set_hostname/working_hostname check:rc == 0 -cmd:cat /tmp/rspconfig_set_hostname/working_hostname -check:rc == 0 cmd:a=$(cat /tmp/rspconfig_set_hostname/working_hostname); rspconfig $$CN hostname=test_$a |tee /tmp/rspconfig_set_hostname/rspconfig_output check:rc == 0 -cmd:grep -i 'BMC hostname' /tmp/rspconfig_set_hostname/rspconfig_output|awk -F':' '{print $3}' |sed s/\\s//g > /tmp/rspconfig_set_hostname/rspconfig_get_hostname +cmd:grep -i '$$CN: BMC hostname:' /tmp/rspconfig_set_hostname/rspconfig_output|awk -F':' '{print $3}' |sed s/\\s//g |tee /tmp/rspconfig_set_hostname/rspconfig_get_hostname check:rc == 0 cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_set_hostname/new_working_hostname check:rc == 0 -cmd:diff /tmp/rspconfig_set_hostname/rspconfig_get_hostname /tmp/rspconfig_set_hostname/new_working_hostname +cmd:diff -y /tmp/rspconfig_set_hostname/rspconfig_get_hostname /tmp/rspconfig_set_hostname/new_working_hostname check:rc == 0 -cmd:diff /tmp/rspconfig_set_hostname/new_working_hostname /tmp/rspconfig_set_hostname/working_hostname +cmd:diff -y /tmp/rspconfig_set_hostname/new_working_hostname /tmp/rspconfig_set_hostname/working_hostname check:rc != 0 cmd:a=test_$(cat /tmp/rspconfig_set_hostname/working_hostname);b=$(cat /tmp/rspconfig_set_hostname/new_working_hostname);echo "a=$a b=$b";if [ "$a" = "$b" ];then exit 0;else exit 1; fi check:rc == 0 From c9dc4439ecd94217f5dc2c17d4663b7bea67797b Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 5 Apr 2018 09:39:56 -0400 Subject: [PATCH 122/161] Add postscript to enable CAPI mode for mlnxofed --- xCAT/postscripts/enablecapi | 92 +++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 xCAT/postscripts/enablecapi diff --git a/xCAT/postscripts/enablecapi b/xCAT/postscripts/enablecapi new file mode 100644 index 000000000..e99e6fe6c --- /dev/null +++ b/xCAT/postscripts/enablecapi @@ -0,0 +1,92 @@ +#!/bin/bash + +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi + +#--------------------------------------------------------------------------- +#=head1 enablecapi +#=head2 enable CAPI and tunnel Atomics for compute nodes +# at least MOFED 4.3.1 has to be installed and only support on ConnectX5 +# +# updatenode enablecapi +# +#--------------------------------------------------------------------------- + +#check if mlnx ofed installed +if [ ! -x /usr/bin/ofed_info ]; then + logger -t xcat -p local4.err "MOFED is not installed" + echo "MOFED is not installed on the system" + exit -1 +fi + +#mofed version at least 4.3-1 +version=`/usr/bin/ofed_info -n` +majorversion=`echo $version | cut -d- -f1` +minorversion=`echo $version | cut -d- -f2` +if (( $(echo "$majorversion < 4.3" |bc -l) )); then + logger -t xcat -p local4.err "Current MOFED version is $version and needs to be at least 4.3-1" + echo "Current MOFED version is $version and needs to be at least 4.3-1" + exit -1 +fi +if (( $(echo "$majorversion == 4.3" |bc -l) )); then + minor=`echo $minorversion | cut -d. -f1` + if (( $(echo "$minor < 1") )); then + logger -t xcat -p local4.err "MOFED version needs to be at least 4.3-1" + echo "Current MOFED version is $version and needs to be at least 4.3-1" + exit -1 + fi +fi + +#check if mst is existed +if [ ! -x /usr/bin/mst ]; then + logger -t xcat -p local4.err "mst command is not available" + echo "mst command is not available" + exit -1 +fi + +service mst restart >/dev/null 2>&1 +if [ "$?" != "0" ] ;then + logger -t xcat -p local4.err "[Error] failed to start mst." + echo "[Error] failed to start mst." + exit -1 +fi + + +#check if mlxconfig is existed +if [ ! -x /usr/bin/mlxconfig ]; then + logger -t xcat -p local4.err "mlxconfig command is not available" + echo "mlxconfig command is not available" + exit -1 +fi + +reboot_flag=0 + +for x in `ls /dev/mst/mt*` +do + mlxconfig -y -d $x q | grep 'ConnectX5' >/dev/null 2>&1 + if [ $? == 0 ]; then + mlxconfig -y -d $x set ADVANCED_PCI_SETTINGS=true >/dev/null 2>&1 + mlxconfig -y -d $x set IBM_CAPI_EN=true >/dev/null 2>&1 + mlxconfig -y -d $x set IBM_TUNNELED_ATOMIC_EN=true >/dev/null 2>&1 + mlxconfig -y -d $x set IBM_AS_NOTIFY_EN=true >/dev/null 2>&1 + echo "Apply new Configuration for $x:" + mlxconfig -y -d $x q | grep 'IBM' + reboot_flag=1 + fi +done + +if [[ $reboot_flag == 0 ]]; then + echo "Didn't find ConnectX5 Devices, will not apply the new configuration" +fi + +if [[ $reboot_flag == 1 ]]; then + echo "******************************************************" + echo " New configuration applied" + echo " Please reboot system to load new configurations" + echo "******************************************************" +fi + +exit 0 + From 4240fd54c96e8d3b2c3c8a5be9a45641e2705935 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 5 Apr 2018 10:42:51 -0400 Subject: [PATCH 123/161] modify from review --- xCAT/postscripts/enablecapi | 59 ++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/xCAT/postscripts/enablecapi b/xCAT/postscripts/enablecapi index e99e6fe6c..628e8f19a 100644 --- a/xCAT/postscripts/enablecapi +++ b/xCAT/postscripts/enablecapi @@ -14,51 +14,46 @@ fi # #--------------------------------------------------------------------------- -#check if mlnx ofed installed -if [ ! -x /usr/bin/ofed_info ]; then - logger -t xcat -p local4.err "MOFED is not installed" - echo "MOFED is not installed on the system" - exit -1 -fi +function logerr { + echo "$@" + logger -t xcat -p local4.err $@ +} + + +#check if mlnx ofed commands are installed +COMMANDS="ofed_info mst mlxconfig" +for CMD in ${COMMANDS}; do + RC=`command -v ${CMD} >> /dev/nul 2>&1; echo $?` + if [[ ${RC} != 0 ]]; then + ERRMSG="Command: ${CMD} is not found, unable to run the scripts" + logerr $ERRMSG + exit 1 + fi +done #mofed version at least 4.3-1 version=`/usr/bin/ofed_info -n` majorversion=`echo $version | cut -d- -f1` minorversion=`echo $version | cut -d- -f2` if (( $(echo "$majorversion < 4.3" |bc -l) )); then - logger -t xcat -p local4.err "Current MOFED version is $version and needs to be at least 4.3-1" - echo "Current MOFED version is $version and needs to be at least 4.3-1" - exit -1 + ERRMSG="Current MOFED version is $version and needs to be at least 4.3-1" + logerr $ERRMSG + exit 1 fi if (( $(echo "$majorversion == 4.3" |bc -l) )); then minor=`echo $minorversion | cut -d. -f1` if (( $(echo "$minor < 1") )); then - logger -t xcat -p local4.err "MOFED version needs to be at least 4.3-1" - echo "Current MOFED version is $version and needs to be at least 4.3-1" - exit -1 + ERRMSG="Current MOFED version is $version and needs to be at least 4.3-1" + logerr $ERRMSG + exit 1 fi fi -#check if mst is existed -if [ ! -x /usr/bin/mst ]; then - logger -t xcat -p local4.err "mst command is not available" - echo "mst command is not available" - exit -1 -fi - service mst restart >/dev/null 2>&1 if [ "$?" != "0" ] ;then - logger -t xcat -p local4.err "[Error] failed to start mst." - echo "[Error] failed to start mst." - exit -1 -fi - - -#check if mlxconfig is existed -if [ ! -x /usr/bin/mlxconfig ]; then - logger -t xcat -p local4.err "mlxconfig command is not available" - echo "mlxconfig command is not available" - exit -1 + ERRMSG "[Error] failed to start mst." + logerr $ERRMSG + exit 1 fi reboot_flag=0 @@ -79,9 +74,7 @@ done if [[ $reboot_flag == 0 ]]; then echo "Didn't find ConnectX5 Devices, will not apply the new configuration" -fi - -if [[ $reboot_flag == 1 ]]; then +else echo "******************************************************" echo " New configuration applied" echo " Please reboot system to load new configurations" From dc61ea57da18e41be0d51973e679dfe2ab454e49 Mon Sep 17 00:00:00 2001 From: XuWei Date: Sun, 8 Apr 2018 22:27:14 -0400 Subject: [PATCH 124/161] Show error msg when set hostname as IP address --- .../agent/hwctl/executor/openbmc_bmcconfig.py | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 8890f5ce2..1da131af4 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -301,9 +301,10 @@ rmdir \"/tmp/$userid\" \n") def _set_hostname(self, hostname, **kw): node = kw['node'] if hostname == '*': - if kw['nodeinfo']['bmc'] == kw['nodeinfo']['bmcip']: - self.callback.info("%s: set BMC ip as BMC Hostname" % node) - hostname = kw['nodeinfo']['bmc'] + if kw['nodeinfo']['bmc'] != kw['nodeinfo']['bmcip']: + hostname = kw['nodeinfo']['bmc'] + else: + return self.callback.error("Invalid OpenBMC Hostname %s, can't set to OpenBMC" % kw['nodeinfo']['bmc'], node) self._set_apis_values("hostname", hostname, **kw) self._get_netinfo(hostname=True, ntpserver=False, **kw) return @@ -383,7 +384,15 @@ rmdir \"/tmp/$userid\" \n") try: obmc.login() obmc.set_apis_values(key, value) - except (SelfServerException, SelfClientException) as e: + except SelfServerException as e: + return self.callback.error(e.message, node) + except SelfClientException: + if e.code == 404: + return self.callback.error('404 Not Found - Requested endpoint does not exists and may \ + indicate function is not supported on this OpenBMC firmware.', node) + if e.code == 403: + return self.callback.error('403 Forbidden - Requested endpoint does not exists and may \ + indicate function is not yet supported by OpenBMC firmware.', node) return self.callback.error(e.message, node) self.callback.info("%s: BMC Setting %s..." % (node, openbmc.RSPCONFIG_APIS[key]['display_name'])) @@ -396,7 +405,15 @@ rmdir \"/tmp/$userid\" \n") obmc.login() value = obmc.get_apis_values(key) - except (SelfServerException, SelfClientException) as e: + except SelfServerException as e: + return self.callback.error(e.message, node) + except SelfClientException: + if e.code == 404: + return self.callback.error('404 Not Found - Requested endpoint does not exists and may \ + indicate function is not supported on this OpenBMC firmware.', node) + if e.code == 403: + return self.callback.error('403 Forbidden - Requested endpoint does not exists and may \ + indicate function is not yet supported by OpenBMC firmware.', node) return self.callback.error(e.message, node) if isinstance(value, dict): From 0560a81e41bf61fccfa3c89bd1730f0fee1800ac Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Mon, 9 Apr 2018 03:37:56 -0400 Subject: [PATCH 125/161] Remove deprecated SSH option KeyRegenerationInterval from remoteshell (#4599) --- xCAT/postscripts/remoteshell | 2 -- 1 file changed, 2 deletions(-) diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 3832208c5..5d35add8e 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -56,8 +56,6 @@ then #delete all occurance of the attribute and then add xCAT settings sed -i '/X11Forwarding /'d /etc/ssh/sshd_config echo "X11Forwarding yes" >>/etc/ssh/sshd_config - sed -i '/KeyRegenerationInterval /'d /etc/ssh/sshd_config - echo "KeyRegenerationInterval 0" >>/etc/ssh/sshd_config sed -i '/MaxStartups /'d /etc/ssh/sshd_config echo "MaxStartups 1024" >>/etc/ssh/sshd_config From df93416a916eb92e8f51fc0921d3a8a015f2aeb9 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Mon, 9 Apr 2018 17:40:38 +0800 Subject: [PATCH 126/161] Avoiding error log for `installmonitor` requesting during provisioning (#5069) * (#5067) to avoid error log for `installmonitor` requesting during provisioning * add 2 sec timeout as others for unsupport requesting --- xCAT-server/sbin/xcatd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 69bef0db1..6c717bebe 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -409,7 +409,7 @@ sub do_installm_service { } } $conn_peer_addr = $conn->peerhost(); - xCAT::MsgUtils->trace(0, "I", "xcatd: received a connection request from $conn_peer_addr"); + xCAT::MsgUtils->trace(0, "I", "xcatd: install monitor received a connection request from $conn_peer_addr"); my $client_name; my $client_aliases; @@ -590,11 +590,15 @@ sub do_installm_service { `/usr/bin/cat $myfile | /usr/bin/sed "/BASECUST_REMOVAL/d">/tmp/$text.nimtmp`; `/usr/bin/mv /tmp/$text.nimtmp $myfile`; close($conn); + } elsif ($text =~ /installmonitor/) { + xCAT::MsgUtils->trace(0, "I", "xcatd: handle installmonitor requesting from $text..."); + close($conn); } else { sleep 0.01; chomp $text; xCAT::MsgUtils->trace(0, "E", "xcatd: install monitor does not support \'$text\', the connection request from $conn_peer_addr will be ignored."); close($conn); #close it to avoid the DDOS attack + alarm(2); next; } xCAT::MsgUtils->trace(0, "I", "xcatd: finish a connection request for $node from $conn_peer_addr"); From aef3850b0e98b636541591096e83313387d2702b Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Tue, 10 Apr 2018 10:17:26 +0800 Subject: [PATCH 127/161] Add more log for SN setup test cases (#5070) --- xCAT-test/autotest/testcase/installation/SN_diskless_setup_case | 2 +- xCAT-test/autotest/testcase/installation/SN_setup_case | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case index 5b1fcafdb..4184572fc 100644 --- a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case @@ -116,7 +116,7 @@ cmd:xdsh $$SN "service httpd status" check:rc==0 cmd:xdsh $$SN "service systemd status" #check:rc==0 - +cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.org ]; then rm -rf $rootimgdir; mv $rootimgdir.org $rootimgdir; fi check:rc==0 cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 4d0c6baa0..0853c7cd3 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -90,7 +90,7 @@ check:output=~/install on /install cmd:xdsh $$SN "mount" check:rc==0 check:output=~/tftpboot on /tftpboot - +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 cmd:makentp -a From 94cd47a0018c614eb72a3b6d7bdd5173d823a805 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 9 Apr 2018 22:30:03 -0400 Subject: [PATCH 128/161] support rinv/rvitals run with Verbose option only --- xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index c7cf2a85c..af445c481 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -217,8 +217,8 @@ class OpenBMCManager(base.BaseManager): def rinv(self, nodesinfo, args): # 1, parse agrs - if not args: - args = ['all'] + if not args or (len(args) == 1 and args[0] in ['-V', '--verbose']): + args.append('all') rinv_usage = """ Usage: @@ -385,8 +385,8 @@ class OpenBMCManager(base.BaseManager): def rvitals(self, nodesinfo, args): # 1, parse agrs - if not args: - args = ['all'] + if not args or (len(args) == 1 and args[0] in ['-V', '--verbose']): + args.append('all') rvitals_usage = """ Usage: From bc0b23fe9c75119229b2e721f427b7f87180f9e8 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 9 Apr 2018 03:30:51 -0400 Subject: [PATCH 129/161] modify rflash args for docopt parse --- xCAT-openbmc-py/lib/python/agent/common/task.py | 1 + .../lib/python/agent/common/utils.py | 2 +- .../agent/hwctl/executor/openbmc_inventory.py | 2 +- .../lib/python/agent/xcatagent/openbmc.py | 3 +++ xCAT-server/lib/xcat/plugins/openbmc2.pm | 17 +++++++++++++++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/common/task.py b/xCAT-openbmc-py/lib/python/agent/common/task.py index 899d8fd8b..76f7fa04d 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/task.py +++ b/xCAT-openbmc-py/lib/python/agent/common/task.py @@ -54,6 +54,7 @@ class ParallelNodesCommand(BaseCommand): """ self.inventory = inventory self.callback = callback + self.cwd = kwargs.get('cwd') self.debugmode = kwargs.get('debugmode') self.verbose = kwargs.get('verbose') diff --git a/xCAT-openbmc-py/lib/python/agent/common/utils.py b/xCAT-openbmc-py/lib/python/agent/common/utils.py index a2f2e00b0..84e925d9a 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/utils.py +++ b/xCAT-openbmc-py/lib/python/agent/common/utils.py @@ -98,7 +98,7 @@ def mask_int2str(mask_int): def get_full_path(cwd, directory): if not os.path.isabs(directory): - directory = '%s/%s' % (cwd, directory) + directory = os.path.join(cwd, directory) return directory class Messager(object): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py index 8fdf93368..a59bd14a6 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py @@ -34,7 +34,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand): if 'version=' in line: version = line.split('=')[-1].strip() if 'purpose=' in line: - purpose = line.split('=')[-1].strip().split('.')[-1] + purpose = line.split('=')[-1].strip() if version and purpose: break diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index c7cf2a85c..11f35da34 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -190,6 +190,9 @@ class OpenBMCManager(base.BaseManager): try: opts = docopt(rflash_usage, argv=args) self.verbose = opts.pop('--verbose') + except DocoptExit as e: + self.messager.error("Failed to parse args by docopt: %s" % e) + return except Exception as e: self.messager.error("Failed to parse arguments for rflash: %s" % args) return diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index ce5c73f93..84b952049 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -508,6 +508,23 @@ sub refactor_args { unshift @$extrargs, "list"; } } + if ($command eq "rflash") { + my @new_args = ('') x 4; + foreach my $tmp (@$extrargs) { + if ($tmp =~ /^-/) { + if ($tmp !~ /^-V$|^--verbose$/) { + $new_args[0] = $tmp; + } elsif ($tmp =~ /^--no-host-reboot$/) { + $new_args[2] = $tmp; + } else { + $new_args[3] = $tmp; + } + } else { + $new_args[1] = $tmp; + } + } + @$extrargs = grep(/.+/, @new_args); + } return 0; } From a1e2a1c10f53fcf1fe2d7d340fba2f49283ebd4e Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 9 Apr 2018 22:41:03 -0400 Subject: [PATCH 130/161] fix bug of test case go_xcat_with_x --- xCAT-test/autotest/testcase/go-xcat/case1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/go-xcat/case1 b/xCAT-test/autotest/testcase/go-xcat/case1 index c2eac9449..ee34b3ceb 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case1 +++ b/xCAT-test/autotest/testcase/go-xcat/case1 @@ -53,10 +53,9 @@ 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" check:rc==0 cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" |tee /tmp/version check:rc==0 cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;cd /;if grep Ubuntu /etc/*release;then cd / ; wget http://xcat.org/files/xcat/repos/apt/$migration_version/xcat-core/buildinfo;else cd / ; wget http://xcat.org/files/xcat/repos/yum/$migration_version/xcat-core/buildinfo; fi -cmd:xdsh $$CN "lsxcatd -v" |tee /tmp/version cmd:if [ -e /buildinfo ]; then xcatversion=`grep VERSION /buildinfo |awk -F'=' '{print $2}'`;grep $xcatversion /tmp/version; fi check:rc==0 cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;grep $migration_version /tmp/version From e8eb7d55f9a60485a6a8c8bc3ac87d9c852c7497 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 9 Apr 2018 23:10:59 -0400 Subject: [PATCH 131/161] add nodels doc --- .../restapi_resource/restapi_reference.rst | 235 ++++++++++-------- 1 file changed, 132 insertions(+), 103 deletions(-) diff --git a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst index d2cf1f937..d8b74d00d 100644 --- a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst +++ b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst @@ -15,10 +15,10 @@ POST - Create a token. **Example:** -Acquire a token for user 'root'. :: +Aquire a token for user 'root'. :: - #curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}' + curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}' { "token":{ "id":"a6e89b59-2b23-429a-b3fe-d16807dd19eb", @@ -52,7 +52,7 @@ Refer to the man page: :doc:`lsdef ` + +**Returns:** + +* Json format: An array of node names. + +**Example:** + +Get the node names from xCAT database. :: + + + curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node[1-3]/nodels?userName=root&userPW=cluster&pretty=1' + [ + "node1", + "node2", + "node3", + ] + [URI:/nodes/{noderange}/subnodes] - The sub-nodes resources for the node {noderange} ------------------------------------------------------------------------------------ @@ -301,7 +322,7 @@ Refer to the man page: :doc:`rscan ` Get all the inventory attributes for node1. :: - #curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory?userName=root&userPW=cluster&pretty=1' + curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory?userName=root&userPW=cluster&pretty=1' { "node1":{ "DIMM 21 ":"8GB PC3-12800 (1600 MT/s) ECC RDIMM", @@ -673,7 +694,7 @@ Refer to the man page: :doc:`rinv ` Get the 'model' inventory attribute for node1. :: - #curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory/model?userName=root&userPW=cluster&pretty=1' + curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory/model?userName=root&userPW=cluster&pretty=1' { "node1":{ "System Description":"System x3650 M4", @@ -698,7 +719,7 @@ Refer to the man page: :doc:`reventlog ` Run the 'date' command on the node2. :: - #curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodeshell?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"command":["date","ls"]}' + curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodeshell?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"command":["date","ls"]}' { "node2":[ " Wed Apr 3 08:30:26 CST 2013", @@ -925,7 +946,7 @@ Refer to the man page: :doc:`xdcp ` Copy files /tmp/f1 and /tmp/f2 from xCAT MN to the node2:/tmp. :: - #curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodecopy?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"src":["/tmp/f1","/tmp/f2"],"target":"/tmp"}' + curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodecopy?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"src":["/tmp/f1","/tmp/f2"],"target":"/tmp"}' no output for succeeded copy. [URI:/nodes/{noderange}/vm] - The virtualization node {noderange}. @@ -953,20 +974,20 @@ Refer to the man page: :doc:`chvm ` Set memory to 3000MB. :: - #curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"memorysize":"3000"}' + curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"memorysize":"3000"}' **Example2:** Add a new 20G disk. :: - #curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"adddisk":"20G"}' + curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"adddisk":"20G"}' **Example3:** Purge the disk 'hdb'. :: - #curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"purgedisk":"hdb"}' + curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"purgedisk":"hdb"}' POST - Create the vm node {noderange}. `````````````````````````````````````` @@ -988,8 +1009,8 @@ Refer to the man page: :doc:`mkvm ` Create the vm node1 with a 30G disk, 2048M memory and 2 cpus. :: - #curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"disksize":"30G","memorysize":"2048","cpucount":"2"}' + curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"disksize":"30G","memorysize":"2048","cpucount":"2"}' DELETE - Remove the vm node {noderange}. ```````````````````````````````````````` @@ -1009,8 +1030,8 @@ Refer to the man page: :doc:`rmvm ` Remove the vm node1 by force and purge the disk. :: - #curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"force":"yes","purge":"yes"}' + curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"force":"yes","purge":"yes"}' [URI:/nodes/{noderange}/vmclone] - The clone resource for the virtual node {noderange}. --------------------------------------------------------------------------------------- @@ -1038,7 +1059,7 @@ Refer to the man page: :doc:`clonevm ` Generates a stateless image based on the specified osimage :: - #curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"gen"}' + curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"gen"}' **Example2:** Packs the stateless image from the chroot file system based on the specified osimage :: - #curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"pack"}' + curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"pack"}' **Example3:** Exports an xCAT image based on the specified osimage :: - #curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"export"}' + curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"export"}' DELETE - Delete the stateless or statelite image instance for the osimage {imgname} from the file system ```````````````````````````````````````````````````````````````````````````````````````````````````````` @@ -1290,8 +1312,8 @@ Refer to the man page: :doc:`rmimage ", @@ -1391,8 +1414,8 @@ Refer to the man page: :doc:`chdef Date: Mon, 9 Apr 2018 23:11:25 -0400 Subject: [PATCH 132/161] add nodels resource --- xCAT-server/xCAT-wsapi/genrestapidoc.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/genrestapidoc.pm b/xCAT-server/xCAT-wsapi/genrestapidoc.pm index 280cff9ca..eb01e9019 100755 --- a/xCAT-server/xCAT-wsapi/genrestapidoc.pm +++ b/xCAT-server/xCAT-wsapi/genrestapidoc.pm @@ -13,7 +13,7 @@ my @apigroups = ( groupname => 'nodes', header => "Node Resources", desc => "The URI list which can be used to create, query, change and manage node objects.", - resources => [ 'allnode', 'nodeallattr', 'nodeattr', 'nodehost', 'nodedns', 'nodedhcp', 'nodestat', 'subnodes', + resources => [ 'allnode', 'nodeallattr', 'nodeattr', 'nodehost', 'nodedns', 'nodedhcp', 'nodestat', 'nodels', 'subnodes', 'power', 'energy', 'energyattr', 'serviceprocessor', 'nextboot', 'bootstate', 'vitals', 'vitalsattr', 'inventory', 'inventoryattr', 'eventlog', 'beacon', 'updating', 'filesyncing', 'software_maintenance', 'postscript', 'nodeshell', 'nodecopy', @@ -181,9 +181,9 @@ sub make_rst_format { my ($uri, $data); if ($parts[3] =~ /\s+/) { ($uri, $data) = split(/ /, $parts[3]); - print "\n #curl -X $parts[2] -k \'https://127.0.0.1/xcatws$uri$postfix\' -H Content-Type:application/json --data \'$data\'\n"; + print "\n curl -X $parts[2] -k \'https://127.0.0.1/xcatws$uri$postfix\' -H Content-Type:application/json --data \'$data\'\n"; } else { - print "\n #curl -X $parts[2] -k \'https://127.0.0.1/xcatws$parts[3]$postfix\'\n"; + print "\n curl -X $parts[2] -k \'https://127.0.0.1/xcatws$parts[3]$postfix\'\n"; } if ($parts[4]) { From 9c7d9847ffd9efbc9e21cd95e507642c51d6eb25 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 9 Apr 2018 23:13:01 -0400 Subject: [PATCH 133/161] clean up word typo --- xCAT-server/xCAT-wsapi/xcatws.cgi | 64 +++++++++++++++---------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 2dad37a46..099a905bd 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -42,7 +42,7 @@ use IO::Socket::SSL; my %usagemsg = ( objreturn => "Json format: An object which includes multiple \' : {att:value, attr:value ...}\' pairs.", objchparam => "Json format: An object which includes multiple \'att:value\' pairs.", - non_getreturn => "No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}." + non_getreturn => "No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}." ); # ver(1.0): Use array type instread of string split by '|' or ',' @@ -72,16 +72,16 @@ my %URIdef = ( desc => "[URI:/nodes/{noderange}] - The node resource", matcher => '^/nodes/[^/]*$', GET => { - desc => "Get all the attibutes for the node {noderange}.", + desc => "Get all the attributes for the node {noderange}.", desc1 => "The keyword ALLRESOURCES can be used as {noderange} which means to get node attributes for all the nodes.", usage => "||$usagemsg{objreturn}|", - example => "|Get all the attibutes for node \'node1\'.|GET|/nodes/node1|{\n \"node1\":{\n \"profile\":\"compute\",\n \"netboot\":\"xnba\",\n \"arch\":\"x86_64\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}|", + example => "|Get all the attributes for node \'node1\'.|GET|/nodes/node1|{\n \"node1\":{\n \"profile\":\"compute\",\n \"netboot\":\"xnba\",\n \"arch\":\"x86_64\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, }, PUT => { - desc => "Change the attibutes for the node {noderange}.", + desc => "Change the attributes for the node {noderange}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "chdef", @@ -139,12 +139,12 @@ my %URIdef = ( }, }, nodels => { - desc => "[URI:/nodes/{noderange}/nodels}] - Lists the nodes", + desc => "[URI:/nodes/{noderange}/nodels}] - Lists the nodes, noderange cannot start with /", matcher => '^/nodes/[^/]*/nodels$', GET => { desc => "Lists the nodes.", - usage => "||An object which includes multiple entries like: : nodels|", - example => "|Get the running status for node node1|GET|/nodes/node1/nodels|", + usage => "||Json format: An array of node names.|", + example => "|Get the node names from xCAT database.|GET|/nodes/node[1-3]/nodels|[\n \"node1\",\n \"node2\",\n \"node3\",\n]|", cmd => "nodels", fhandler => \&actionhdl, outhdler => \&nodelsout, @@ -363,7 +363,7 @@ my %URIdef = ( desc => "[URI:/nodes/{noderange}/vitals] - The vitals resources for the node {noderange}", matcher => '^/nodes/[^/]*/vitals$', GET => { - desc => "Get all the vitals attibutes.", + desc => "Get all the vitals attributes.", usage => "||$usagemsg{objreturn}|", example => "|Get all the vitails attributes for the node1.|GET|/nodes/node1/vitals|{\n \"node1\":{\n \"SysBrd Fault\":\"0\",\n \"CPUs\":\"0\",\n \"Fan 4A Tach\":\"3330 RPM\",\n \"Drive 15\":\"0\",\n \"SysBrd Vol Fault\":\"0\",\n \"nvDIMM Flash\":\"0\",\n \"Progress\":\"0\"\n ...\n }\n}|", cmd => "rvitals", @@ -376,7 +376,7 @@ my %URIdef = ( desc => "[URI:/nodes/{noderange}/vitals/{temp|voltage|wattage|fanspeed|power|leds...}] - The specific vital attributes for the node {noderange}", matcher => '^/nodes/[^/]*/vitals/\S+$', GET => { - desc => "Get the specific vitals attibutes.", + desc => "Get the specific vitals attributes.", usage => "||$usagemsg{objreturn}|", example => "|Get the \'fanspeed\' vitals attribute.|GET|/nodes/node1/vitals/fanspeed|{\n \"node1\":{\n \"Fan 1A Tach\":\"3219 RPM\",\n \"Fan 4B Tach\":\"2688 RPM\",\n \"Fan 3B Tach\":\"2560 RPM\",\n \"Fan 4A Tach\":\"3330 RPM\",\n \"Fan 2A Tach\":\"3293 RPM\",\n \"Fan 1B Tach\":\"2592 RPM\",\n \"Fan 3A Tach\":\"3182 RPM\",\n \"Fan 2B Tach\":\"2592 RPM\"\n }\n}|", cmd => "rvitals", @@ -388,7 +388,7 @@ my %URIdef = ( desc => "[URI:/nodes/{noderange}/inventory] - The inventory attributes for the node {noderange}", matcher => '^/nodes/[^/]*/inventory$', GET => { - desc => "Get all the inventory attibutes.", + desc => "Get all the inventory attributes.", usage => "||$usagemsg{objreturn}|", example => "|Get all the inventory attributes for node1.|GET|/nodes/node1/inventory|{\n \"node1\":{\n \"DIMM 21 \":\"8GB PC3-12800 (1600 MT/s) ECC RDIMM\",\n \"DIMM 1 Manufacturer\":\"Hyundai Electronics\",\n \"Power Supply 2 Board FRU Number\":\"94Y8105\",\n \"DIMM 9 Model\":\"HMT31GR7EFR4C-PB\",\n \"DIMM 8 Manufacture Location\":\"01\",\n \"DIMM 13 Manufacturer\":\"Hyundai Electronics\",\n \"DASD Backplane 4\":\"Not Present\",\n ...\n }\n}|", cmd => "rinv", @@ -400,7 +400,7 @@ my %URIdef = ( desc => "[URI:/nodes/{noderange}/inventory/{pci|model...}] - The specific inventory attributes for the node {noderange}", matcher => '^/nodes/[^/]*/inventory/\S+$', GET => { - desc => "Get the specific inventory attibutes.", + desc => "Get the specific inventory attributes.", usage => "||$usagemsg{objreturn}|", example => "|Get the \'model\' inventory attribute for node1.|GET|/nodes/node1/inventory/model|{\n \"node1\":{\n \"System Description\":\"System x3650 M4\",\n \"System Model/MTM\":\"7915C2A\"\n }\n}|", cmd => "rinv", @@ -644,15 +644,15 @@ my %URIdef = ( desc => "[URI:/groups/{groupname}] - The group resource", matcher => '^/groups/[^/]*$', GET => { - desc => "Get all the attibutes for the group {groupname}.", + desc => "Get all the attributes for the group {groupname}.", usage => "||$usagemsg{objreturn}|", - example => "|Get all the attibutes for group \'all\'.|GET|/groups/all|{\n \"all\":{\n \"members\":\"zxnode2,nodexxx,node1,node4\"\n }\n}|", + example => "|Get all the attributes for group \'all\'.|GET|/groups/all|{\n \"all\":{\n \"members\":\"zxnode2,nodexxx,node1,node4\"\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, }, PUT => { - desc => "Change the attibutes for the group {groupname}.", + desc => "Change the attributes for the group {groupname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", cmd => "chdef", @@ -842,16 +842,16 @@ my %URIdef = ( desc => "[URI:/networks/{netname}] - The network resource", matcher => '^\/networks\/[^\/]*$', GET => { - desc => "Get all the attibutes for the network {netname}.", + desc => "Get all the attributes for the network {netname}.", desc1 => "The keyword ALLRESOURCES can be used as {netname} which means to get network attributes for all the networks.", usage => "||$usagemsg{objreturn}|", - example => "|Get all the attibutes for network \'network1\'.|GET|/networks/network1|{\n \"network1\":{\n \"gateway\":\"\",\n \"mask\":\"255.255.255.0\",\n \"mgtifname\":\"eth2\",\n \"net\":\"10.0.0.0\",\n \"tftpserver\":\"10.0.0.119\",\n ...\n }\n}|", + example => "|Get all the attributes for network \'network1\'.|GET|/networks/network1|{\n \"network1\":{\n \"gateway\":\"\",\n \"mask\":\"255.255.255.0\",\n \"mgtifname\":\"eth2\",\n \"net\":\"10.0.0.0\",\n \"tftpserver\":\"10.0.0.119\",\n ...\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, }, PUT => { - desc => "Change the attibutes for the network {netname}.", + desc => "Change the attributes for the network {netname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", example => "|Change the attributes mgtifname=eth0 and net=10.1.0.0.|PUT|/networks/network1 {\"mgtifname\":\"eth0\",\"net\":\"10.1.0.0\"}||", cmd => "chdef", @@ -931,7 +931,7 @@ my %URIdef = ( desc => "[URI:/osimages/{imgname}] - The osimage resource", matcher => '^\/osimages\/[^\/]*$', GET => { - desc => "Get all the attibutes for the osimage {imgname}.", + desc => "Get all the attributes for the osimage {imgname}.", desc1 => "The keyword ALLRESOURCES can be used as {imgname} which means to get image attributes for all the osimages.", usage => "||$usagemsg{objreturn}|", example => "|Get the attributes for the specified osimage.|GET|/osimages/sles11.2-x86_64-install-compute|{\n \"sles11.2-x86_64-install-compute\":{\n \"provmethod\":\"install\",\n \"profile\":\"compute\",\n \"template\":\"/opt/xcat/share/xcat/install/sles/compute.sles11.tmpl\",\n \"pkglist\":\"/opt/xcat/share/xcat/install/sles/compute.sles11.pkglist\",\n \"osvers\":\"sles11.2\",\n \"osarch\":\"x86_64\",\n \"osname\":\"Linux\",\n \"imagetype\":\"linux\",\n \"otherpkgdir\":\"/install/post/otherpkgs/sles11.2/x86_64\",\n \"osdistroname\":\"sles11.2-x86_64\",\n \"pkgdir\":\"/install/sles11.2/x86_64\"\n }\n}|", @@ -949,7 +949,7 @@ my %URIdef = ( outhdler => \&noout, }, PUT => { - desc => "Change the attibutes for the osimage {imgname}.", + desc => "Change the attributes for the osimage {imgname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,attr2:v2...}|$usagemsg{non_getreturn}|", example => "|Change the 'osvers' and 'osarch' attributes for the osiamge.|PUT|/osimages/sles11.2-ppc64-install-compute/ {\"osvers\":\"sles11.3\",\"osarch\":\"x86_64\"}||", cmd => "chdef", @@ -980,7 +980,7 @@ my %URIdef = ( # TD, the implementation may need to be change. PUT_backup => { - desc => "Change the attibutes for the osimage {imgname}.", + desc => "Change the attributes for the osimage {imgname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,attr2:v2...}|$usagemsg{non_getreturn}|", example => "|Change the 'osvers' and 'osarch' attributes for the osiamge.|PUT|/osimages/sles11.2-ppc64-install-compute/attrs/osvers;osarch {\"osvers\":\"sles11.3\",\"osarch\":\"x86_64\"}||", cmd => "chdef", @@ -1032,7 +1032,7 @@ my %URIdef = ( desc => "[URI:/policy/{policy_priority}] - The policy resource", matcher => '^\/policy\/[^\/]*$', GET => { - desc => "Get all the attibutes for a policy {policy_priority}.", + desc => "Get all the attributes for a policy {policy_priority}.", desc1 => "It will display all the policy attributes for one policy resource.", desc2 => "The keyword ALLRESOURCES can be used as {policy_priority} which means to get policy attributes for all the policies.", usage => "||$usagemsg{objreturn}|", @@ -1042,7 +1042,7 @@ my %URIdef = ( outhdler => \&defout, }, PUT => { - desc => "Change the attibutes for the policy {policy_priority}.", + desc => "Change the attributes for the policy {policy_priority}.", desc1 => "It will change one or more attributes for a policy.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", example => "|Set the name attribute for policy 3.|PUT|/policy/3 {\"name\":\"root\"}||", @@ -1156,7 +1156,7 @@ my %URIdef = ( desc1 => "For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in.", matcher => '^/tables/[^/]+/nodes/[^/]+$', GET => { - desc => "Get attibutes of tables for a noderange.", + desc => "Get attributes of tables for a noderange.", usage => "||An object containing each table. Within each table object is an array of node objects containing the attributes.|", example1 => qq(|Get all the columns from table nodetype for node1 and node2.|GET|/tables/nodetype/nodes/node1,node2|{\n \"nodetype\":[\n {\n \"provmethod\":\"rhels6.4-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node1\",\n \"os\":\"rhels6.4\"\n },\n {\n \"provmethod\":\"rhels6.3-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node2\",\n \"os\":\"rhels6.3\"\n }\n ]\n}|), example2 => qq(|Get all the columns from tables nodetype and noderes for node1 and node2.|GET|/tables/nodetype,noderes/nodes/node1,node2|{\n \"noderes\":[\n {\n \"installnic\":\"mac\",\n \"netboot\":\"xnba\",\n \"name\":\"node1\",\n \"nfsserver\":\"192.168.1.15\"\n },\n {\n \"installnic\":\"mac\",\n \"netboot\":\"pxe\",\n \"name\":\"node2\",\n \"proxydhcp\":\"no\"\n }\n ],\n \"nodetype\":[\n {\n \"provmethod\":\"rhels6.4-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node1\",\n \"os\":\"rhels6.4\"\n },\n {\n \"provmethod\":\"rhels6.3-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node2\",\n \"os\":\"rhels6.3\"\n }\n ]\n}|), @@ -1164,7 +1164,7 @@ my %URIdef = ( outhdler => \&tableout, }, PUT => { - desc => "Change the node table attibutes for {noderange}.", + desc => "Change the node table attributes for {noderange}.", usage => "|A hash of table names and attribute objects. DataBody: {table1:{attr1:v1,att2:v2,...}}.|$usagemsg{non_getreturn}|", example => '|Change the nodetype.arch and noderes.netboot attributes for nodes node1,node2.|PUT|/tables/nodetype,noderes/nodes/node1,node2 {"nodetype":{"arch":"x86_64"},"noderes":{"netboot":"xnba"}}||', fhandler => \&tablenodeputhdl, @@ -1176,14 +1176,14 @@ my %URIdef = ( desc1 => "For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in.", matcher => '^/tables/[^/]+/nodes/[^/]+/[^/]+$', GET => { - desc => "Get table attibutes for a noderange.", + desc => "Get table attributes for a noderange.", usage => "||An object containing each table. Within each table object is an array of node objects containing the attributes.|", example => qq(|Get OS and ARCH attributes from nodetype table for node1 and node2.|GET|/tables/nodetype/nodes/node1,node2/os,arch|{\n \"nodetype\":[\n {\n \"arch\":\"x86_64\",\n \"name\":\"node1\",\n \"os\":\"rhels6.4\"\n },\n {\n \"arch\":\"x86_64\",\n \"name\":\"node2\",\n \"os\":\"rhels6.3\"\n }\n ]\n}|), fhandler => \&tablenodehdl, outhdler => \&tableout, }, PUT_backup => { - desc => "[URI:/tables/nodes/{noderange}] - Change the node table attibutes for the {noderange}.", + desc => "[URI:/tables/nodes/{noderange}] - Change the node table attributes for the {noderange}.", usage => "|A hash of table names and attribute objects. DataBody: {table1:{attr1:v1,att2:v2,...}}.|$usagemsg{non_getreturn}|", example => '|Change the nodehm.mgmt and noderes.netboot attributes for nodes node1-node5.|PUT|/tables/nodes/node1-node5 {"nodehm":{"mgmt":"ipmi"},"noderes":{"netboot":"xnba"}}||', fhandler => \&tablenodeputhdl, @@ -1208,14 +1208,14 @@ my %URIdef = ( desc2 => "{keys} should be the name=value pairs which are used to search table. e.g. {keys} should be [net=192.168.1.0,mask=255.255.255.0] for networks table query since the net and mask are the keys of networks table.", matcher => '^/tables/[^/]+/rows/[^/]+$', GET => { - desc => "Get attibutes for rows from non-node tables.", + desc => "Get attributes for rows from non-node tables.", usage => "||An object containing each table. Within each table object is an array of row objects containing the attributes.|", example => qq(|Get row which net=192.168.1.0,mask=255.255.255.0 from networks table.|GET|/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0|{\n \"networks\":[\n {\n \"mgtifname\":\"eth0\",\n \"netname\":\"192_168_1_0-255_255_255_0\",\n \"tftpserver\":\"192.168.1.15\",\n \"gateway\":\"192.168.1.100\",\n \"staticrangeincrement\":\"1\",\n \"net\":\"192.168.1.0\",\n \"mask\":\"255.255.255.0\"\n }\n ]\n}|), fhandler => \&tablerowhdl, outhdler => \&tableout, }, PUT => { - desc => "Change the non-node table attibutes for the row that matches the {keys}.", + desc => "Change the non-node table attributes for the row that matches the {keys}.", usage => "|A hash of attribute names and values. DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", example => '|Create a route row in the routes table.|PUT|/tables/routes/rows/routename=privnet {"net":"10.0.1.0","mask":"255.255.255.0","gateway":"10.0.1.254","ifname":"eth1"}||', fhandler => \&tablerowputhdl, @@ -1234,7 +1234,7 @@ my %URIdef = ( desc1 => "Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, polciy, etc.", matcher => '^/tables/[^/]+/rows/[^/]+/[^/]+$', GET => { - desc => "Get specific attibutes for rows from non-node tables.", + desc => "Get specific attributes for rows from non-node tables.", usage => "||An object containing each table. Within each table object is an array of row objects containing the attributes.|", example => qq(|Get attributes mgtifname and tftpserver which net=192.168.1.0,mask=255.255.255.0 from networks table.|GET|/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0/mgtifname,tftpserver|{\n \"networks\":[\n {\n \"mgtifname\":\"eth0\",\n \"tftpserver\":\"192.168.1.15\"\n }\n ]\n}|), fhandler => \&tablerowhdl, @@ -1291,7 +1291,7 @@ my %URIdef = ( GET => { desc => "Show attributes of a node template.", usage => "||$usagemsg{objreturn}|", - example => "|GET all the attibutes of node template \'x86_64kvmguest-template\'.|GET|/templates/node {\"options\":{\"--template\":\"x86_64kvmguest-template\"}} |{\n \"arch\":{\n \"x86_64\":\"compute\",\n \"bmc\":\"MANDATORY:The hostname or ip address of the BMC adapater\",\n \bmcpassword\":\"MANDATORY:the password of the BMC\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}", + example => "|GET all the attributes of node template \'x86_64kvmguest-template\'.|GET|/templates/node {\"options\":{\"--template\":\"x86_64kvmguest-template\"}} |{\n \"arch\":{\n \"x86_64\":\"compute\",\n \"bmc\":\"MANDATORY:The hostname or ip address of the BMC adapater\",\n \bmcpassword\":\"MANDATORY:the password of the BMC\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, @@ -2894,7 +2894,7 @@ sub tablenodeputhdl { my $params = shift; # from the %URIdef: - # desc => "[URI:/tables/nodes/{noderange}] - Change the table attibutes for the {noderange}.", + # desc => "[URI:/tables/nodes/{noderange}] - Change the table attributes for the {noderange}.", # usage => "|An array of table objects. Each table object contains the table name and an object of attribute values. DataBody: {table1:{attr1:v1,att2:v2,...}}.|$usagemsg{non_getreturn}|", # example => '|Change the nodehm.mgmt and noderes.netboot attributes for nodes node1-node5.|PUT|/tables/nodes/node1-node5 {"nodehm":{"mgmt":"ipmi"},"noderes":{"netboot":"xnba"}}||', @@ -2961,7 +2961,7 @@ sub tablerowputhdl { my $params = shift; # from %URIdef: - # desc => "[URI:/tables/{table}/rows/{keys}] - Change the non-node table attibutes for the row that matches the {keys}.", + # desc => "[URI:/tables/{table}/rows/{keys}] - Change the non-node table attributes for the row that matches the {keys}.", # usage => "|A hash of attribute names and values. DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", # example => '|Creat a route row in the routes table.|PUT|/tables/routes/rows/routename=privnet {"net":"10.0.1.0","mask":"255.255.255.0","gateway":"10.0.1.254","ifname":"eth1"}||', From ba32210e9bac9a6e5681ba19b7933d7e587bfd95 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 10 Apr 2018 02:54:48 -0400 Subject: [PATCH 134/161] modified depending on comments --- .../lib/python/agent/hwctl/executor/openbmc_bmcconfig.py | 8 ++++---- xCAT-server/lib/xcat/plugins/openbmc.pm | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 1da131af4..4ae5f1eff 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -388,10 +388,10 @@ rmdir \"/tmp/$userid\" \n") return self.callback.error(e.message, node) except SelfClientException: if e.code == 404: - return self.callback.error('404 Not Found - Requested endpoint does not exists and may \ + return self.callback.error('404 Not Found - Requested endpoint does not exist or may \ indicate function is not supported on this OpenBMC firmware.', node) if e.code == 403: - return self.callback.error('403 Forbidden - Requested endpoint does not exists and may \ + return self.callback.error('403 Forbidden - Requested endpoint does not exist or may \ indicate function is not yet supported by OpenBMC firmware.', node) return self.callback.error(e.message, node) @@ -409,10 +409,10 @@ rmdir \"/tmp/$userid\" \n") return self.callback.error(e.message, node) except SelfClientException: if e.code == 404: - return self.callback.error('404 Not Found - Requested endpoint does not exists and may \ + return self.callback.error('404 Not Found - Requested endpoint does not exist or may \ indicate function is not supported on this OpenBMC firmware.', node) if e.code == 403: - return self.callback.error('403 Forbidden - Requested endpoint does not exists and may \ + return self.callback.error('403 Forbidden - Requested endpoint does not exist or may \ indicate function is not yet supported by OpenBMC firmware.', node) return self.callback.error(e.message, node) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index da29a7120..d5671b12b 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -2423,7 +2423,7 @@ sub deal_with_response { my $log_id = (split ('/', $cur_url))[5]; $error = "Invalid ID=$log_id provided to be resolved. [$::RESPONSE_FORBIDDEN]"; } else{ - $error = "$::RESPONSE_FORBIDDEN - Requested endpoint does not exists and may indicate function is not yet supported by OpenBMC firmware."; + $error = "$::RESPONSE_FORBIDDEN - Requested endpoint does not exist or may indicate function is not yet supported by OpenBMC firmware."; } # Handle 404 } elsif ($response->status_line eq $::RESPONSE_NOT_FOUND) { @@ -2434,7 +2434,7 @@ sub deal_with_response { $error = "Invalid ID provided to delete. Use the -l option to view valid firmware IDs."; } elsif (($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") || ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_ATTR_RESPONSE")) { - $error = "$::RESPONSE_NOT_FOUND - Requested endpoint does not exists and may indicate function is not supported on this OpenBMC firmware."; + $error = "$::RESPONSE_NOT_FOUND - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware."; } else { $error = "[" . $response->code . "] " . $response_info->{'data'}->{'description'}; } From dc483c80cf8f0c94d430661b9637bea3cd8c3441 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Tue, 10 Apr 2018 04:20:47 -0400 Subject: [PATCH 135/161] add rbeacon test cases --- xCAT-test/autotest/testcase/rbeacon/cases0 | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 xCAT-test/autotest/testcase/rbeacon/cases0 diff --git a/xCAT-test/autotest/testcase/rbeacon/cases0 b/xCAT-test/autotest/testcase/rbeacon/cases0 new file mode 100644 index 000000000..5adcc8dfe --- /dev/null +++ b/xCAT-test/autotest/testcase/rbeacon/cases0 @@ -0,0 +1,59 @@ +start:rbeacon_null +description: this case is to test rbeacon usage +cmd:rbeacon +check:rc==0 +check:output=~Usage +end + +start:rbeacon_stat +description: this case is to test rbeacon CN stat +cmd:rbeacon $$CN stat +check:rc==0 +check:output=~$$CN\s*:\s*Front:Off Rear:Off|Front:On Rear:On|Front:Off Rear:On|Front:On Rear:Off +end + +start:rbeacon_on_off +description: this case is to test rbeacon CN on/off +cmd:rbeacon $$CN stat |tee /tmp/rbeaconstat +check:rc==0 +cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN on; fi +check:rc==0 +check:output=~$$CN\s*:\s*on +cmd:rbeacon $$CN stat +check:output=~$$CN\s*:\s*Front:Blink Rear:Blink +cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN off; fi +check:rc==0 +check:output=~$$CN\s*:\s*off +end + +start:rbeacon_help +description: this case is to test rbeacon -h and --help output +cmd:rbeacon -h +check:rc==0 +check:output=~Usage +check:output =~OpenPOWER \(OpenBMC\) specific: +cmd:rbeacon --help +check:rc==0 +check:output=~Usage +check:output =~OpenPOWER \(OpenBMC\) specific: +end + +start:rbeacon_version +description: this case is to test rbeacon -v and --version output +cmd:rbeacon -v +check:rc==0 +check:output=~Version +check:output =~git commit +cmd:rbeacon --version +check:rc==0 +check:output=~~Version +check:output =~git commit +end + +start:rbeacon_false +description: this case is to test rbeacon could process false input +cmd:rbeacon $$CN abc +check:rc!=0 +check:output=~$$CN\s*:\s*Error:\s*Only \'on\', \'off\' or \'stat\' is supported +end + From 17793bc3640ea635a4e66c0753824f6530aff5c1 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Tue, 10 Apr 2018 16:36:00 +0800 Subject: [PATCH 136/161] delete password from log for runsqlcmd (#5075) --- xCAT-server/sbin/runsqlcmd | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-server/sbin/runsqlcmd b/xCAT-server/sbin/runsqlcmd index 4247a4e4d..7b9137f24 100755 --- a/xCAT-server/sbin/runsqlcmd +++ b/xCAT-server/sbin/runsqlcmd @@ -356,6 +356,7 @@ sub runpgsqlcmd if ($? > 0) # error { $rc = $? >> 8; + $cmd = "PGPASSWORD=xxxxxx $psql -d $dbname -h $hostname -U $admin -f $file "; xCAT::MsgUtils->message("SE", "The command $cmd had errors. Return=$rc"); } From fdb3ccb3cee9b265982382e94f468099b3854cad Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 10 Apr 2018 14:18:54 -0400 Subject: [PATCH 137/161] REST API doc fixes and Python example --- .../restapi_resource/restapi_reference.rst | 2 +- .../restapi/restapi_usage/restapi_usage.rst | 19 ++-- xCAT-server/xCAT-wsapi/xcatws-test.py | 96 +++++++++++++++++++ xCAT-server/xCAT-wsapi/xcatws.cgi | 2 +- 4 files changed, 111 insertions(+), 8 deletions(-) create mode 100755 xCAT-server/xCAT-wsapi/xcatws-test.py diff --git a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst index d8b74d00d..b641252be 100644 --- a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst +++ b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst @@ -15,7 +15,7 @@ POST - Create a token. **Example:** -Aquire a token for user 'root'. :: +Acquire a token for user 'root'. :: curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}' diff --git a/docs/source/advanced/restapi/restapi_usage/restapi_usage.rst b/docs/source/advanced/restapi/restapi_usage/restapi_usage.rst index 301a0a770..09c65095c 100644 --- a/docs/source/advanced/restapi/restapi_usage/restapi_usage.rst +++ b/docs/source/advanced/restapi/restapi_usage/restapi_usage.rst @@ -37,14 +37,14 @@ where: Example: :: - curl -X GET --cacert /root/ca-cert.pem 'https:///xcatws/nodes?userName=root&userPW=cluster' + curl -X GET -k 'https:///xcatws/nodes?userName=root&userPW=cluster' Access Token ------------ xCAT also supports the use the Access Token to replace the using of username+password in every access. Before accessing any resource, you need get a token with your account (username+password) :: - # curl -X POST --cacert /root/ca-cert.pem \ + # curl -X POST -k \ 'https:///xcatws/tokens?pretty=1' -H Content-Type:application/json --data \ '{"userName":"root","userPW":"cluster"}' { @@ -56,7 +56,7 @@ xCAT also supports the use the Access Token to replace the using of username+pas Then in the subsequent REST API access, the token can be used to replace the user account (username+password) :: - curl -X GET --cacert /root/ca-cert.pem -H X-Auth-Token:5cabd675-bc2e-4318-b1d6-831fd1f32f97 'https:///xcatws/? + curl -X GET -k -H X-Auth-Token:5cabd675-bc2e-4318-b1d6-831fd1f32f97 'https:///xcatws/? The validity of token is 24 hours. If an old token has expired, you will get a 'Authentication failure' error. Then you need reacquire a token with your account. @@ -183,10 +183,17 @@ Testing the API Normally you will make REST API calls from your code. You can use any language that has REST API bindings (most modern languages do). +An Example of How to Use xCAT REST API from Python +-------------------------------------------------- + +Refer to the file `/opt/xcat/ws/xcatws-test.py `_: :: + + ./xcatws-test.py --user wsuser -password cluster_rest --xcatmn + An Example of How to Use xCAT REST API from PERL ------------------------------------------------ -Refer to the file /opt/xcat/ws/xcatws-test.pl: :: +Refer to the file `/opt/xcat/ws/xcatws-test.pl `_: :: ./xcatws-test.pl -m GET -u "https://127.0.0.1/xcatws/nodes?userName=root&userPW=cluster" @@ -202,9 +209,9 @@ It can be used as an example script to access and control xCAT resources. From t ./xcatws-test.sh -u root -p cluster -h -t ./xcatws-test.sh -u root -p cluster -h -c -t -But for exploration and experimentation, you can make API calls from your browser or using the **curl** command. +But for exploration and experimentation, you can make API calls from your browser or by using the **curl** command. -To make an API call from your browser, uses the desired URL from this document. To simplify the test step, all the examples for the resources uses 'curl -k' to use insecure http connection and use the 'username+password' to authenticate the user. :: +To make an API call from your browser, use the desired URL from this document. To simplify the test step, all the examples for the resources use 'curl -k' for unsecure http connection and use the 'username+password' to authenticate the user. :: curl -X GET -k 'https://myserver/xcatws/nodes?userName=xxx&userPW=xxx&pretty=1' diff --git a/xCAT-server/xCAT-wsapi/xcatws-test.py b/xCAT-server/xCAT-wsapi/xcatws-test.py new file mode 100755 index 000000000..7fa06322a --- /dev/null +++ b/xCAT-server/xCAT-wsapi/xcatws-test.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +"""Usage: + xcatws_test.py [--xcatmn=] [--user=] [--password=] +""" +import requests +import json +import sys + +XCATMN = "127.0.0.1" +username = "wsuser" +password = "cluster_rest" +# +# Gather user inputs if any, otherwise defaults above are used +# +try: + from docopt import docopt, DocoptExit + arguments = docopt(__doc__) + if arguments['--xcatmn']: + XCATMN = arguments['--xcatmn'] + if arguments['--user']: + username = arguments['--user'] + if arguments['--password']: + password = arguments['--password'] +except ImportError: + print "WARNING: docopt is not installed, will continue with hard coded defaults..." +except DocoptExit as e: + # Invalid arguments + print e + sys.exit(1) + +REST_ENDPOINT = "https://" + XCATMN + "/xcatws" +create_node = REST_ENDPOINT + "/nodes/" +get_all_nodes = REST_ENDPOINT + "/nodes/" +get_token = REST_ENDPOINT + "/tokens" + +# +# Create a test node object +# +testnode_name = "rest_api_node" +testnode_group = "all" +testnode_mgt = "ipmi" +testnode_data = {'groups': testnode_group,'mgt': testnode_mgt} +try: + new_node = requests.post(create_node + testnode_name + "?userName=" + username + "&userPW=" + password, verify=False, headers={'Content-Type': 'application/json'}, data=json.dumps(testnode_data)) + + if new_node.content: + # Display node creation error + print "Failed to create new node " + testnode_name + print new_node.content + sys.exit(1) + else: + print "New node definition created for " + testnode_name + ".\n" +except requests.exceptions.HTTPError as e: + print ("Http Error:",e) + sys.exit(1) +except requests.exceptions.ConnectionError as e: + print "Error connecting to xCAT management node " + XCATMN + print e + sys.exit(1) +except requests.exceptions.Timeout as e: + print "Timeout connecting to xCAT management node " + XCATMN + print e + sys.exit(1) +except requests.exceptions.RequestException as e: + print "Unexpected error connecting to xCAT management node " + XCATMN + print e + sys.exit(1) +except AttributeError as e: + print "AttributeError caught, you may need to update the Perl libraries." + print e + sys.exit(1) +except Exception as e: + print "Unexpected error." + print e + sys.exit(1) + +# +# 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) + +# Display returned data +print "List of all nodes extracted with userid and password:" +print all_nodes.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']}) + +# Display returned data +print "List of all nodes extracted with authentication token:" +print all_nodes.content + +sys.exit(0) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 099a905bd..84bd7c184 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -1251,7 +1251,7 @@ my %URIdef = ( POST => { desc => "Create a token.", usage => "||An array of all the global configuration list.|", - example => "|Aquire a token for user \'root\'.|POST|/tokens {\"userName\":\"root\",\"userPW\":\"cluster\"}|{\n \"token\":{\n \"id\":\"a6e89b59-2b23-429a-b3fe-d16807dd19eb\",\n \"expire\":\"2014-3-8 14:55:0\"\n }\n}|", + example => "|Acquire a token for user \'root\'.|POST|/tokens {\"userName\":\"root\",\"userPW\":\"cluster\"}|{\n \"token\":{\n \"id\":\"a6e89b59-2b23-429a-b3fe-d16807dd19eb\",\n \"expire\":\"2014-3-8 14:55:0\"\n }\n}|", fhandler => \&nonobjhdl, outhdler => \&tokenout, }, From f3a681d1f1e7aeed353de896e73513c3485c5707 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 10 Apr 2018 14:38:36 -0400 Subject: [PATCH 138/161] Man page change for rvitals --- docs/source/guides/admin-guides/references/man1/rvitals.1.rst | 2 +- xCAT-client/pods/man1/rvitals.1.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index f67fe481d..862f224ae 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -67,7 +67,7 @@ OpenPOWER (OpenBMC) specific: ============================= -\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | altitude | all**\ ] +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | altitude | all**\ ] [\ **-V**\ | \ **-**\ **-verbose**\ ] diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index e588434f3..4286f74c2 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -32,7 +32,7 @@ B I [B|B|B|B|B|B I [B|B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B|B] [B<-V>| B<--verbose>] =head1 B From bd6718999b12808b57b2d339e9e0127c45d2d70a Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 10 Apr 2018 21:55:04 -0400 Subject: [PATCH 139/161] modify return code of rspconfig hostname error --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index d5671b12b..f576e20a5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -983,7 +983,7 @@ sub process_request { if ($next_status{LOGIN_RESPONSE} eq "RSPCONFIG_SET_HOSTNAME_REQUEST" and $status_info{RSPCONFIG_SET_HOSTNAME_REQUEST}{data} =~ /^\*$/) { if ($node_info{$node}{bmc} =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { my $info_msg = "Invalid OpenBMC Hostname $node_info{$node}{bmc}, can't set to OpenBMC"; - xCAT::SvrUtils::sendmsg($info_msg, $callback, $node); + xCAT::SvrUtils::sendmsg([1, $info_msg], $callback, $node); $wait_node_num--; next; } From 4d567525367427fae18ad5272fc61b206103bc4f Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 10 Apr 2018 22:29:31 -0400 Subject: [PATCH 140/161] change test case of rspconfit to satisfy the latest code --- xCAT-test/autotest/testcase/rspconfig/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index 1054e48fa..97494f030 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -256,7 +256,7 @@ hcp:openbmc cmd:lsdef $$CN -i bmc -c check:rc == 0 cmd:rspconfig $$CN hostname=* -check:rc == 0 +check:rc != 0 check:output =~ Invalid OpenBMC Hostname cmd:ssh __GETNODEATTR(f6u03,bmc)__ "hostname" end From 462af566a2c3a4b1d9cd777dfd74423e7e24b57c Mon Sep 17 00:00:00 2001 From: ertaozh Date: Tue, 10 Apr 2018 23:07:39 -0400 Subject: [PATCH 141/161] Update doc about ondiscover and bmcvlantag --- .../discovery/mtms/discovery_using_defined.rst | 11 +++++++++++ .../ppc64le/discovery/mtms/discovery_using_dhcp.rst | 6 ++++++ .../ppc64le/discovery/seq_discovery.rst | 12 ++++++++++++ .../ppc64le/discovery/switch_discovery.rst | 13 +++++++++++++ 4 files changed, 42 insertions(+) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst index 1eb2d3d68..672e584ed 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst @@ -101,6 +101,12 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi chdef cn01 chain="runcmd=bmcsetup" +#. **[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. + + For example, configure console and copy SSH key for **OpenBMC** :: + + chdef cn01 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + #. Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: chdef cn01 -p chain="osimage=" @@ -113,6 +119,11 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi chdef cn01 bmc=50.0.101.1 + **[Optional]** If more configuration planed to be done on BMC, the following command is also needed. :: + + chdef cn01 bmcvlantag= # tag VLAN ID for BMC + chdef cn01 bmcusername= + chdef cn01 bmcpassword= #. Add the compute node IP information to ``/etc/hosts``: :: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst index b5e083ef7..e33ac0939 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst @@ -85,6 +85,12 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to chdef cn01 chain="runcmd=bmcsetup" +#. **[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. + + For example, configure console and copy SSH key for **OpenBMC** :: + + chdef cn01 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + #. Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: chdef cn01 -p chain="osimage=" diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst index 7ec0f41cf..5751d9c0e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst @@ -18,10 +18,22 @@ Predefine a group of nodes with desired IP address for host and IP address for F nodeadd cn1 groups=powerLE,all chdef cn1 mgt=ipmi cons=ipmi ip=10.0.101.1 bmc=50.0.101.1 netboot=petitboot installnic=mac primarynic=mac +**[Optional]** If more configuration planed to be done on BMC, the following command is also needed. :: + + chdef cn1 bmcvlantag= # tag VLAN ID for BMC + chdef cn1 bmcusername= + chdef cn1 bmcpassword= + In order to do BMC configuration during the discovery process, set ``runcmd=bmcsetup``. :: chdef cn1 chain="runcmd=bmcsetup" +**[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. + + For example, configure console and copy SSH key for **OpenBMC** :: + + chdef cn1 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: chdef cn1 -p chain="osimage=" diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst index cb5c2d9f4..206a48306 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst @@ -54,10 +54,23 @@ After switches are defined, the server node can be predefined with the following chdef cn1 mgt=ipmi cons=ipmi ip=10.0.101.1 bmc=50.0.101.1 netboot=petitboot installnic=mac primarynic=mac chdef cn1 switch=switch1 switchport=0 + +**[Optional]** If more configuration planed to be done on BMC, the following command is also needed. :: + + chdef cn1 bmcvlantag= # tag VLAN ID for BMC + chdef cn1 bmcusername= + chdef cn1 bmcpassword= + In order to do BMC configuration during the discovery process, set ``runcmd=bmcsetup``. :: chdef cn1 chain="runcmd=bmcsetup" +**[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. + + For example, configure console and copy SSH key for **OpenBMC** :: + + chdef cn01 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: chdef cn1 -p chain="osimage=" From fe249bfb70106e0db310db05b8dee9728369199c Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 11 Apr 2018 02:03:56 -0400 Subject: [PATCH 142/161] Print out error msg for xcatprobe switch_macmap command if switch passwordless is not enabled (#5064) * Print out error msg for xcatprobe switch_mac command if switch passwordless is not enabled. * Modified msg only if in the collect_mac_info case --- perl-xCAT/xCAT/MacMap.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index 2a1931397..1c8668411 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -356,7 +356,7 @@ sub dump_mac_info { $ret{$switch}->{ErrorStr} = $self->{macinfo}->{$switch}->{ErrorStr}; # To show the error message that the username/password related error is for SNMP only - if ($ret{$switch}->{ErrorStr} =~ /user\s*name|password/i) { + if ($ret{$switch}->{ErrorStr} =~ /user\s*name|password$/i) { $ret{$switch}->{ErrorStr} .= " through SNMP"; } } else { @@ -729,6 +729,11 @@ sub refresh_switch { my @res=xCAT::Utils->runcmd("ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no $switch 'bridge fdb show|grep -i -v permanent|tr A-Z a-z 2>/dev/null' 2>/dev/null",-1); if ($::RUNCMD_RC) { xCAT::MsgUtils->message("S", "Failed to get mac table with ssh to $switch, fall back to snmp! To obtain mac table with ssh, please make sure the passwordless root ssh to $switch is available"); + if ($self->{collect_mac_info}) { + my $errmsg = "Failed to get MAC table from $switch. Make sure passwordless SSH to the switch is enabled."; + $self->{macinfo}->{$switch}->{ErrorStr} = $errmsg; + return; + } }else{ foreach (@res){ if($_ =~ m/^([0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}) dev swp([0-9]+) vlan ([0-9]+) .*/){ From fc4bbd33fe0c2800b3e06f9eebdef76cec3dc12e Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Wed, 11 Apr 2018 14:19:35 +0800 Subject: [PATCH 143/161] Fix the issue for stateless node in debug mode, /dev/log is not available (#5086) (#4929) - use imjournal to make rsyslogd work well with journald --- .../netboot/rh/dracut_033/patch/syslog/module-setup.sh | 2 +- .../netboot/rh/dracut_033/patch/syslog/rsyslogd-start.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/module-setup.sh b/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/module-setup.sh index 386a3a40b..ba8ed94cf 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/module-setup.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/module-setup.sh @@ -16,7 +16,7 @@ install() { local _installs if type -P rsyslogd >/dev/null; then _installs="rsyslogd" - inst_libdir_file rsyslog/lmnet.so rsyslog/imklog.so rsyslog/imuxsock.so + inst_libdir_file rsyslog/lmnet.so rsyslog/imklog.so rsyslog/imuxsock.so rsyslog/imjournal.so elif type -P syslogd >/dev/null; then _installs="syslogd" elif type -P syslog-ng >/dev/null; then diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/rsyslogd-start.sh b/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/rsyslogd-start.sh index 9589af436..b0a3e6a94 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/rsyslogd-start.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/patch/syslog/rsyslogd-start.sh @@ -21,7 +21,12 @@ rsyslog_config() { # echo "${filter} @${server}" # done - + # In dracut 33, default rsyslogd configuration does not use journald. Then when + # rsyslog in debug mode, it causes `/dev/log` is not available after switch_root (#4929) + echo "\$ModLoad imjournal" + echo "\$OmitLocalLogging on" + echo "\$IMJournalStateFile imjournal.state" + if [ -n "$filters" ];then confline="${filters}"; else From 17ce243cf6c28e78b1b7e5fe1c392de6fe398fad Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 11 Apr 2018 04:20:29 -0400 Subject: [PATCH 144/161] fix typo error of rspconfig powersupplyredundancy --- xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index a33714129..0401928b3 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -198,7 +198,7 @@ RSPCONFIG_APIS = { 'get_data': [], 'display_name': "BMC PowerSupplyRedundancy", 'attr_values': { - 'disabled': ["Disables"], + 'disabled': ["Disabled"], 'enabled': ["Enabled"], }, }, From ee772d59a0eb639e45661ee2db5336fcbd0375bb Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 11 Apr 2018 04:46:13 -0400 Subject: [PATCH 145/161] fix issue args pass for rflash activate --- .../lib/python/agent/hwctl/executor/openbmc_flash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py index ffaa051a1..e24a70031 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py @@ -98,7 +98,7 @@ class OpenBMCFlashTask(ParallelNodesCommand): os.makedirs(XCAT_LOG_RFLASH_DIR) if activate_arg.endswith('.tar'): - version = self._get_firmware_version() + version = self._get_firmware_version(self.firmware_file) self.firmware.update(version) self.callback.info('Attempting to upload %s, please wait...' % self.firmware_file) else: From b3ce180cffdc407ec4e4d0f7428c1fc5333115ec Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 11 Apr 2018 05:54:33 -0400 Subject: [PATCH 146/161] fix linux_diskless_kdump --- .../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 +- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 5 +++-- 7 files changed, 10 insertions(+), 9 deletions(-) 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 f2019566a..6fde471d5 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -47,7 +47,7 @@ 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 900 +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 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 3a1d12b57..37f3d0d0f 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 @@ -50,7 +50,7 @@ cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ne check:rc==0 check:output=~Provision node\(s\)\: $$CN -cmd:sleep 900 +cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep failed >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 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 920c1d563..d846fca5a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -53,7 +53,7 @@ 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 900 +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 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 7cc906537..de1331b54 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -59,7 +59,7 @@ 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 900 +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 @@ -97,7 +97,7 @@ 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 900 +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 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 65ac3cf86..802491f64 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 @@ -79,7 +79,7 @@ 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 900 +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 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 fd7d84f4e..c61e15ac2 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 @@ -73,7 +73,7 @@ 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 900 +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 diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 5437d5f32..8e64f5479 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -35,7 +35,8 @@ check:rc==0 cmd:if [ ! -d /kdumpdir ]; then mkdir -p /kdumpdir && chmod 777 /kdumpdir; fi cmd:if [ ! -f /etc/exports ] ;then touch /etc/exports;else cp /etc/exports /etc/exports.bak;fi -cmd:echo -e "/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports && exportfs /etc/exports fi; +cmd:cat /etc/exports|grep kdumpdir; if [ "$?" -ne "0" ]; then echo "/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi +cmd:cd /etc; export exports;cd -;service nfs restart cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/kdumpdir check:rc==0 @@ -55,7 +56,7 @@ cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ne check:rc==0 check:output=~Provision node\(s\)\: $$CN -cmd:sleep 900 +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 From b0091144b5c16c3a0f68419b0d4717d78c943472 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 11 Apr 2018 06:05:47 -0400 Subject: [PATCH 147/161] enhance linux_diskless_kdump and deduce sleep time --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 8e64f5479..930c6fb13 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -70,8 +70,8 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "echo 1 > /proc/sys/kernel/sysrq" -cmd:xdsh $$CN "echo c > /proc/sysrq-trigger" -cmd:sleep 600 +cmd:xdsh $$CN "echo c > /proc/sysrq-trigger" -t 30 +cmd:sleep 300 cmd:vmcorefile=`find /kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi check:output=~not empty From 78975b6825c54fd10454b1a7fb0db415fa30b01e Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 11 Apr 2018 06:26:35 -0400 Subject: [PATCH 148/161] polished --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 930c6fb13..100eb235d 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -69,8 +69,7 @@ cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d -cmd:xdsh $$CN "echo 1 > /proc/sys/kernel/sysrq" -cmd:xdsh $$CN "echo c > /proc/sysrq-trigger" -t 30 +cmd:xdsh $$CN "setsid 'echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger'" cmd:sleep 300 cmd:vmcorefile=`find /kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi From 7ffa4f451c7c24fad94efce9c030cca2f3ff6bdd Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 11 Apr 2018 16:46:22 -0400 Subject: [PATCH 149/161] Password change for xCAT REST API documentation update --- docs/source/advanced/restapi/restapi_setup/restapi_setup.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst b/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst index 84e15230f..b7e6454d7 100644 --- a/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst +++ b/docs/source/advanced/restapi/restapi_setup/restapi_setup.rst @@ -154,3 +154,5 @@ You should see some output that includes your list of nodes. If errors returned, check `/var/log/httpd/ssl_error_log` on xCAT MN. +``Note:`` if passwords need to be changed in the future, make sure to update the xCAT passwd table. xCAT REST API uses passwords stored in that table to authenticate users. + From 9cd9017e4bb7962220c0b7f968aad198e2555aee Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 12 Apr 2018 02:42:06 -0400 Subject: [PATCH 150/161] modify output format of rvitals leds --- .../agent/hwctl/executor/openbmc_sensor.py | 31 +++++++++--------- xCAT-server/lib/xcat/plugins/openbmc.pm | 32 ++++++++++++------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py index 7abd4c31d..12ccefaa7 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py @@ -34,27 +34,26 @@ class OpenBMCSensorTask(ParallelNodesCommand): def _get_beacon_info(self, beacon_dict, display_type='full'): + led_label = 'LEDs' info_list = [] # display_type == 'full' for detailed output for 'rvitals leds' command # display_type == 'compact' for compact output for 'rbeacon stat' command if display_type == 'compact': - info_list.append('Front:%s Rear:%s' % (beacon_dict.get('front_id'), beacon_dict.get('rear_id', 'N/A'))) + info_list.append('Front:%s Rear:%s' % (beacon_dict.get('front_id'), beacon_dict.get('rear_id', 'N/A'))) return info_list - info_list.append('Front . . . . . : Power:%s Fault:%s Identify:%s' % - (beacon_dict.get('front_power', 'N/A'), - beacon_dict.get('front_fault', 'N/A'), - beacon_dict.get('front_id', 'N/A'))) - if (beacon_dict.get('fan0', 'N/A') == 'Off' and beacon_dict.get('fan1', 'N/A') == 'Off' and - beacon_dict.get('fan2', 'N/A') == 'Off' and beacon_dict.get('fan3', 'N/A') == 'Off'): - info_list.append('Front Fans . . : No LEDs On') - else: - info_list.append('Front Fans . . : fan0:%s fan1:%s fan2:%s fan3:%s' % - (beacon_dict.get('fan0', 'N/A'), beacon_dict.get('fan1', 'N/A'), - beacon_dict.get('fan2', 'N/A'), beacon_dict.get('fan3', 'N/A'))) - info_list.append('Rear . . . . . : Power:%s Fault:%s Identify:%s' % - (beacon_dict.get('rear_power', 'N/A'), - beacon_dict.get('rear_fault', 'N/A'), - beacon_dict.get('rear_id', 'N/A'))) + + for i in range(4): + info_list.append('%s Fan%s: %s' % (led_label, i, beacon_dict.get('fan' + str(i), 'N/A'))) + + led_types = ('Fault', 'Identify', 'Power') + for i in ('Front', 'Rear'): + for led_type in led_types: + tmp_type = led_type.lower() + if led_type == 'Identify': + tmp_type = 'id' + key_type = i.lower() + '_' + tmp_type + info_list.append('%s %s %s: %s' % (led_label, i, led_type, beacon_dict.get(key_type, 'N/A'))) + return info_list diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f576e20a5..5a1723ef7 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1863,6 +1863,10 @@ sub parse_command_status { $next_status{LOGIN_RESPONSE} = "RVITALS_REQUEST"; $next_status{RVITALS_REQUEST} = "RVITALS_RESPONSE"; $status_info{RVITALS_RESPONSE}{argv} = "$subcommand"; + if ($subcommand eq "all") { + $next_status{RVITALS_RESPONSE} = "RVITALS_LEDS_REQUEST"; + $next_status{RVITALS_LEDS_REQUEST} = "RVITALS_LEDS_RESPONSE"; + } } } @@ -4150,17 +4154,23 @@ sub rvitals_response { push (@sorted_output, $content_info); } else { # Full output for "rvitals leds" command - $content_info = "Front . . . . . : Power:$leds{front_power} Fault:$leds{front_fault} Identify:$leds{front_id}"; - push (@sorted_output, $content_info); - $content_info = "Rear . . . . . : Power:$leds{rear_power} Fault:$leds{rear_fault} Identify:$leds{rear_id}"; - push (@sorted_output, $content_info); - # Fans - if ($leds{fan0} =~ "Off" and $leds{fan1} =~ "Off" and $leds{fan2} eq "Off" and $leds{fan3} eq "Off") { - $content_info = "Front Fans . . : No LEDs On"; - } else { - $content_info = "Front Fans . . : fan0:$leds{fan0} fan1:$leds{fan1} fan2:$leds{fan2} fan3:$leds{fan3}"; - } - push (@sorted_output, $content_info); + my @front_rear = ("Front", "Rear"); + my @led_types = ("Power", "Fault", "Identify"); + foreach my $i (@front_rear) { + foreach my $led_type (@led_types) { + my $tmp_type = lc($led_type); + $tmp_type = "id" if ($led_type eq "Identify"); + my $key_type = lc($i) . "_" . $tmp_type; + $content_info = "LEDs $i $led_type: $leds{$key_type}"; + push (@sorted_output, $content_info); + } + } + # Fans + for (my $i = 0; $i < 4; $i++) { + my $tmp_key = "fan" . $i; + $content_info = "LEDs Fan$i: $leds{$tmp_key}"; + push (@sorted_output, $content_info); + } } } From 3703091150f1c6a9867499a9c7b6d75d2885474a Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 12 Apr 2018 04:49:03 -0400 Subject: [PATCH 151/161] update according to comments --- xCAT-test/autotest/testcase/rbeacon/cases0 | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/xCAT-test/autotest/testcase/rbeacon/cases0 b/xCAT-test/autotest/testcase/rbeacon/cases0 index 5adcc8dfe..bf0343c72 100644 --- a/xCAT-test/autotest/testcase/rbeacon/cases0 +++ b/xCAT-test/autotest/testcase/rbeacon/cases0 @@ -1,5 +1,7 @@ start:rbeacon_null description: this case is to test rbeacon usage +os:Linux +hcp:openbmc cmd:rbeacon check:rc==0 check:output=~Usage @@ -7,27 +9,17 @@ end start:rbeacon_stat description: this case is to test rbeacon CN stat +os:Linux +hcp:openbmc cmd:rbeacon $$CN stat check:rc==0 check:output=~$$CN\s*:\s*Front:Off Rear:Off|Front:On Rear:On|Front:Off Rear:On|Front:On Rear:Off end -start:rbeacon_on_off -description: this case is to test rbeacon CN on/off -cmd:rbeacon $$CN stat |tee /tmp/rbeaconstat -check:rc==0 -cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN on; fi -check:rc==0 -check:output=~$$CN\s*:\s*on -cmd:rbeacon $$CN stat -check:output=~$$CN\s*:\s*Front:Blink Rear:Blink -cmd:if grep "Front:Off Rear:Off" /tmp/rbeaconstat;then rbeacon $$CN off; fi -check:rc==0 -check:output=~$$CN\s*:\s*off -end - start:rbeacon_help description: this case is to test rbeacon -h and --help output +os:Linux +hcp:openbmc cmd:rbeacon -h check:rc==0 check:output=~Usage @@ -40,6 +32,8 @@ end start:rbeacon_version description: this case is to test rbeacon -v and --version output +os:Linux +hcp:openbmc cmd:rbeacon -v check:rc==0 check:output=~Version @@ -52,6 +46,8 @@ end start:rbeacon_false description: this case is to test rbeacon could process false input +os:Linux +hcp:openbmc cmd:rbeacon $$CN abc check:rc!=0 check:output=~$$CN\s*:\s*Error:\s*Only \'on\', \'off\' or \'stat\' is supported From dbe555769769e8f11efaf912cbe60ec747f2abe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Thu, 12 Apr 2018 17:19:28 +0800 Subject: [PATCH 152/161] Change CUDA 9.2 installation document and example setup script for POWER 9 (#5074) * Change cuda installation document for POWER 9 * Update the example script for CUDA setup on POWER 9 * Change CUDA installation document, ask user to use postscripts instead of postbootscripts * Tweak the nvidia_patch.conf * Redo initrd image for both diskless and diskfull compute node * Fix typo --- .../advanced/gpu/nvidia/osimage/rhels.rst | 24 ++++++------ xCAT/postscripts/cuda_power9_setup | 37 +++++++++++++++++++ 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst index 77dee5f3f..a810fddee 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst @@ -189,24 +189,24 @@ 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 postbootscrtips list. :: - chdef p9compute -p postbootscripts=cuda_power9_setup + chdef p9compute -p postscripts=cuda_power9_setup -Disless osimage -^^^^^^^^^^^^^^^ +Diskless osimage +^^^^^^^^^^^^^^^^ -For diskless deployment, the script need to add to the postinstall script of the osimage. And it should be run in the chroot environment. Please refer the following commands as an example. +For diskless deployment, the script need to add to the postinstall script of the osimage. And it should be run in the chroot environment. Please refer the following commands as an example. :: - mkdir -p /install/custom/netboot - cp /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + mkdir -p /install/custom/netboot/rh + cp /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall /install/custom/netboot/rh/cudafull.rhels7.ppc64le.postinstall - cat >>/install/custom/netboot/rh/cudafull.rhels7.ppc64le.postinstall <-EOF + cat >>/install/custom/netboot/rh/cudafull.rhels7.ppc64le.postinstall <<-EOF - cp /install/postscripts/cuda_power9_setup /install/netboot/rhels7.5/ppc64le/compute/rootimg/tmp/cuda_power9_setup" - chroot /install/netboot/rhels7.5/ppc64le/compute/rootimg" /tmp/cuda_power9_setup + cp /install/postscripts/cuda_power9_setup \$installroot/tmp/cuda_power9_setup + chroot \$installroot /tmp/cuda_power9_setup - rm -f /install/netboot/rhels7.5/ppc64le/compute/rootimg/tmp/cuda_power9_setup + rm -f \$installroot/tmp/cuda_power9_setup EOF - chdef -t osimage rhels7.5-ppc64le-netboot-cudafull postinstall=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + chdef -t osimage rhels7.5-ppc64le-netboot-cudafull postinstall=/install/custom/netboot/rh/cudafull.rhels7.ppc64le.postinstall diff --git a/xCAT/postscripts/cuda_power9_setup b/xCAT/postscripts/cuda_power9_setup index d2120f465..caf0cddb5 100755 --- a/xCAT/postscripts/cuda_power9_setup +++ b/xCAT/postscripts/cuda_power9_setup @@ -40,3 +40,40 @@ chmod 0644 /usr/lib/systemd/system/nvidia-persistenced.service systemctl enable nvidia-persistenced rm -f /lib/udev/rules.d/40-redhat.rules + +# +# Extra steps for passing parameters to kernel module nvidia +# +mkdir -p /usr/lib/dracut/modules.d/95nvidia +cat >/usr/lib/dracut/modules.d/95nvidia/module-setup.sh <\$initdir/etc/modprobe.d/nvidia.conf +} +EOF + +chmod 0755 /usr/lib/dracut/modules.d/95nvidia/module-setup.sh +echo 'add_dracutmodules+=" nvidia "' >/etc/dracut.conf.d/nvidia_patch.conf + +# Patch for the diskfull environment, or in case kernel module nvidia need to be reloaded +echo 'options nvidia NVreg_RegistryDwords="RMNumaOnlining=0x1;RMNvLinkSpeedControl=0x9;PeerMappingOverride=1"' >/etc/modprobe.d/nvidia.conf + +# Redo the initrd image +kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" +mkinitrd -v -f "/boot/initramfs-${kernel_version}.img" "${kernel_version}" From 4f8b769ba31c32203d1500792e158a371781a91a Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 12 Apr 2018 05:52:22 -0400 Subject: [PATCH 153/161] update document to add powersupplyredundancy for ondiscover --- .../ppc64le/discovery/mtms/discovery_using_defined.rst | 6 ++++-- .../ppc64le/discovery/mtms/discovery_using_dhcp.rst | 6 ++++-- .../manage_clusters/ppc64le/discovery/seq_discovery.rst | 6 ++++-- .../manage_clusters/ppc64le/discovery/switch_discovery.rst | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst index 672e584ed..26042970c 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst @@ -103,9 +103,11 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi #. **[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. - For example, configure console and copy SSH key for **OpenBMC** :: + For example, configure console, copy SSH key for **OpenBMC**, then disable ``powersupplyredundancy`` :: - chdef cn01 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + chdef cn01 -p chain="ondiscover=makegocons|rspconfig:sshcfg|rspconfig:powersupplyredundancy=disabled" + + **Note**: ``|`` is used to split commands, and ``:`` is used to split command with its option. #. Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst index e33ac0939..17a7843c9 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst @@ -87,9 +87,11 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to #. **[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. - For example, configure console and copy SSH key for **OpenBMC** :: + For example, configure console, copy SSH key for **OpenBMC**, then disable ``powersupplyredundancy`` :: - chdef cn01 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + chdef cn01 -p chain="ondiscover=makegocons|rspconfig:sshcfg|rspconfig:powersupplyredundancy=disabled" + + **Note**: ``|`` is used to split commands, and ``:`` is used to split command with its option. #. Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst index 5751d9c0e..aea009420 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/seq_discovery.rst @@ -30,9 +30,11 @@ In order to do BMC configuration during the discovery process, set ``runcmd=bmcs **[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. - For example, configure console and copy SSH key for **OpenBMC** :: + For example, configure console, copy SSH key for **OpenBMC**, then disable ``powersupplyredundancy`` :: - chdef cn1 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + chdef cn01 -p chain="ondiscover=makegocons|rspconfig:sshcfg|rspconfig:powersupplyredundancy=disabled" + + **Note**: ``|`` is used to split commands, and ``:`` is used to split command with its option. Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst index 206a48306..ffa679488 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/switch_discovery.rst @@ -67,9 +67,11 @@ In order to do BMC configuration during the discovery process, set ``runcmd=bmcs **[Optional]** More operation plan to do after hardware disocvery is done, ``ondiscover`` option can be used. - For example, configure console and copy SSH key for **OpenBMC** :: + For example, configure console, copy SSH key for **OpenBMC**, then disable ``powersupplyredundancy`` :: - chdef cn01 -p chain=ondiscover="makegocons|rspconfig:sshcfg" + chdef cn01 -p chain="ondiscover=makegocons|rspconfig:sshcfg|rspconfig:powersupplyredundancy=disabled" + + **Note**: ``|`` is used to split commands, and ``:`` is used to split command with its option. Set the target `osimage` into the chain table to automatically provision the operating system after the node discovery is complete. :: From 2c9bdf848056306dc9dd6b3cd6a2970b9efdfa53 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 12 Apr 2018 23:15:26 -0400 Subject: [PATCH 154/161] Properly fix updatenode syncfiles (#5013) * Fix xdcp username on updatenode -F xdcp was not using the username and trusted facility, fix updatenode usage. * Remove security risk of forceroot Any user can specificy 'forceroot'. Remove this and rely upon the other method to properly use the 'trusted' role. --- xCAT-server/lib/xcat/plugins/updatenode.pm | 1 + xCAT-server/lib/xcat/plugins/xdsh.pm | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index c0dfb4081..8b4559179 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -1833,6 +1833,7 @@ sub updatenodesyncfiles { command => ["xdcp"], node => $syncfile_node{$synclist}, + username => $request->{username}, arg => $args, env => $env }, diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 2a2c98fd5..3378e512a 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -639,7 +639,6 @@ sub process_servicenodes_xdcp $addreq->{'_xcatdest'} = $::mnname; $addreq->{node} = \@sn; $addreq->{noderange} = \@sn; - $addreq->{forceroot}->[0] = 1; # check input request for --nodestatus my $args = $req->{arg}; # argument @@ -1216,9 +1215,6 @@ sub process_request $ENV{DSH_FROM_USERID} = $request->{username}->[0]; } } - if ($request->{forceroot}) { - $ENV{DSH_FROM_USERID} = 'root'; - } if ($command eq "xdsh") { xdsh($nodes, $args, $callback, $command, $request->{noderange}->[0]); From 7e9fd95111a07d8de61cb0a7593c925ba5b918b0 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 12 Apr 2018 23:17:55 -0400 Subject: [PATCH 155/161] fix typo error for rspconfig powersupplyredundancy --- .../agent/hwctl/executor/openbmc_bmcconfig.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 4ae5f1eff..cd108fb42 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -386,13 +386,13 @@ rmdir \"/tmp/$userid\" \n") obmc.set_apis_values(key, value) except SelfServerException as e: return self.callback.error(e.message, node) - except SelfClientException: + except SelfClientException as e: if e.code == 404: - return self.callback.error('404 Not Found - Requested endpoint does not exist or may \ - indicate function is not supported on this OpenBMC firmware.', node) + return self.callback.error('404 Not Found - Requested endpoint does not exist or may ' \ + 'indicate function is not supported on this OpenBMC firmware.', node) if e.code == 403: - return self.callback.error('403 Forbidden - Requested endpoint does not exist or may \ - indicate function is not yet supported by OpenBMC firmware.', node) + return self.callback.error('403 Forbidden - Requested endpoint does not exist or may ' \ + 'indicate function is not yet supported by OpenBMC firmware.', node) return self.callback.error(e.message, node) self.callback.info("%s: BMC Setting %s..." % (node, openbmc.RSPCONFIG_APIS[key]['display_name'])) @@ -407,13 +407,13 @@ rmdir \"/tmp/$userid\" \n") except SelfServerException as e: return self.callback.error(e.message, node) - except SelfClientException: + except SelfClientException as e: if e.code == 404: - return self.callback.error('404 Not Found - Requested endpoint does not exist or may \ - indicate function is not supported on this OpenBMC firmware.', node) + return self.callback.error('404 Not Found - Requested endpoint does not exist or may ' \ + 'indicate function is not supported on this OpenBMC firmware.', node) if e.code == 403: - return self.callback.error('403 Forbidden - Requested endpoint does not exist or may \ - indicate function is not yet supported by OpenBMC firmware.', node) + return self.callback.error('403 Forbidden - Requested endpoint does not exist or may ' \ + 'indicate function is not yet supported by OpenBMC firmware.', node) return self.callback.error(e.message, node) if isinstance(value, dict): From 4b1709e59d81a198736ea6c23a969a8c3c4308e0 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 13 Apr 2018 16:58:42 +0800 Subject: [PATCH 156/161] When xdcp files to CN and CN is controlled by a SN, xcat will push (#5102) files to SN first (site.SNsyncfiledir). This should be run as admin for normal user as they cannot touch that directory. --- xCAT-server/lib/xcat/plugins/xdsh.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 3378e512a..50ae19bb3 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -645,6 +645,12 @@ sub process_servicenodes_xdcp if (grep(/^--nodestatus$/, @$args)) { push(@{ $addreq->{arg} }, "--nodestatus"); # return nodestatus } + + if (defined($req->{username}) && ($req->{username}->[0] ne "root")) { + # Using `root` when sync temporary files to `site.SNsyncfiledir` (default: /var/xcat/syncfiles) + push(@{ $addreq->{arg} }, "-l"); + push(@{ $addreq->{arg} }, "root"); + } push(@{ $addreq->{arg} }, "-v"); push(@{ $addreq->{arg} }, "-s"); push(@{ $addreq->{arg} }, "-F"); From b239bfafd9d4bfcfa40a1ffb9dfd9b8b5279d87a Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 13 Apr 2018 05:10:53 -0400 Subject: [PATCH 157/161] update a light status --- xCAT-test/autotest/testcase/rbeacon/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rbeacon/cases0 b/xCAT-test/autotest/testcase/rbeacon/cases0 index bf0343c72..b202d46bc 100644 --- a/xCAT-test/autotest/testcase/rbeacon/cases0 +++ b/xCAT-test/autotest/testcase/rbeacon/cases0 @@ -13,7 +13,7 @@ os:Linux hcp:openbmc cmd:rbeacon $$CN stat check:rc==0 -check:output=~$$CN\s*:\s*Front:Off Rear:Off|Front:On Rear:On|Front:Off Rear:On|Front:On Rear:Off +check:output=~$$CN\s*:\s*Front:Off Rear:Off|Front:On Rear:On|Front:Off Rear:On|Front:On Rear:Off|Front:Blink Rear:Blink end start:rbeacon_help From e9c1a907860fa8fb83a6c05079b32313b469e8aa Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 13 Apr 2018 16:12:47 -0400 Subject: [PATCH 158/161] Adding new options overrides for nvidia --- xCAT/postscripts/cuda_power9_setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/cuda_power9_setup b/xCAT/postscripts/cuda_power9_setup index caf0cddb5..14bef7151 100755 --- a/xCAT/postscripts/cuda_power9_setup +++ b/xCAT/postscripts/cuda_power9_setup @@ -64,7 +64,7 @@ installkernel() { install() { [ -d \$initdir/etc/modprobe.d/ ] || mkdir \$initdir/etc/modprobe.d - echo 'options nvidia NVreg_RegistryDwords="RMNumaOnlining=0x1;RMNvLinkSpeedControl=0x9;PeerMappingOverride=1"' >\$initdir/etc/modprobe.d/nvidia.conf + echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >\$initdir/etc/modprobe.d/nvidia.conf } EOF @@ -72,7 +72,7 @@ chmod 0755 /usr/lib/dracut/modules.d/95nvidia/module-setup.sh echo 'add_dracutmodules+=" nvidia "' >/etc/dracut.conf.d/nvidia_patch.conf # Patch for the diskfull environment, or in case kernel module nvidia need to be reloaded -echo 'options nvidia NVreg_RegistryDwords="RMNumaOnlining=0x1;RMNvLinkSpeedControl=0x9;PeerMappingOverride=1"' >/etc/modprobe.d/nvidia.conf +echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >/etc/modprobe.d/nvidia.conf # Redo the initrd image kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" From a1ac8535262d60356e6754018ca34eb321e95fd1 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 16 Apr 2018 03:12:28 -0400 Subject: [PATCH 159/161] fix kdump test case --- xCAT-test/autotest/testcase/kdump/linux_diskless_kdump | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 100eb235d..01dde2833 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -22,7 +22,7 @@ cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc check:rc==0 cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;cp $pkglistfile $pkglistfile.bak -cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\n" >> $pkglistfile;fi +cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\nat\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile;fi check:rc==0 cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;cp $exlistfile $exlistfile.bak @@ -46,7 +46,6 @@ check:rc==0 cmd:chdef -t node $$CN -p postscripts=enablekdump check:rc==0 - cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute @@ -69,7 +68,10 @@ cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d -cmd:xdsh $$CN "setsid 'echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger'" +cmd:xdsh $$CN "echo 'echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger' > /tmp/kdump.trigger" +cmd:xdsh $$CN "chmod 755 /tmp/kdump.trigger" +cmd:xdsh $$CN "service atd start" +cmd:xdsh $$CN "at now +1 minutes <<< /tmp/kdump.trigger" cmd:sleep 300 cmd:vmcorefile=`find /kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi @@ -83,4 +85,5 @@ cmd:if [ -f /etc/exports.bak ] ;then mv -f /etc/exports.bak /etc/exports; fi cmd:rm -rf /kdumpdir cmd:cat /tmp/node.stanza | chdef -z;rm -rf /tmp/node.stanza cmd:cat /tmp/osimage.stanza | chdef -z;rm -rf /tmp/osimage.stanza +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi end From 4110c7ea20ca202cce30f5bc3079e6eb8f044f61 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 16 Apr 2018 05:10:35 -0400 Subject: [PATCH 160/161] Update release information for 2.14 release --- docs/source/conf.py | 2 +- docs/source/overview/xcat2_release.rst | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1a45ed914..312deac0d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,7 +59,7 @@ author = u'IBM Corporation' # The short X.Y version. version = '2' # The full version, including alpha/beta/rc tags. -release = '2.13.11' +release = '2.14' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 0b64db14c..837edc12f 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -7,6 +7,22 @@ The following table is a summary of the new operating system (OS), hardware, and * **SLES** - Suse Linux Enterprise Server * **UBT** - Ubuntu +xCAT 2.14.x +----------- + ++---------------------------------+---------------+-------------+----------------------------------+ +|xCAT |New OS |New |New Feature | +|Version | |Hardware | | ++=================================+===============+=============+==================================+ +|| xCAT 2.14 |- RHEL 7.5 | |- OpenBMC support in python: | +|| 2018/4/20 | | | | +|| | | | rspconfig,reventlog | +| `2.14 Release Notes `_ | | | | ++---------------------------------+---------------+-------------+----------------------------------+ + + xCAT 2.13.x ----------- From 8c159330c2bedace4bb101945823ba51d9cbdc25 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Sun, 15 Apr 2018 23:10:38 -0400 Subject: [PATCH 161/161] Add the mlnxofedinstall default parameters xcat recommended into mlnx diskless installation document --- .../networks/infiniband/mlnxofed_ib_install_v2_diskless.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst index 3af2cb177..06b1064d7 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst @@ -28,10 +28,10 @@ Diskless Installation *Note: The $1 is a argument that is passed to the the postinstall script at runtime.* - **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: + **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support --without-32bit --without-fw-update --force`` arguments to the Mellanox installation script to build the kernel modules based on the version you are using. :: /install/postscripts/mlnxofed_ib_install \ - -p /install// -m --add-kernel-support -end- \ + -p /install// -m --add-kernel-support --without-32bit --without-fw-update --force -end- \ -i $1 -n genimage #. Generate the diskless image