diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.environment b/xCAT-test/autotest/testcase/xcat-inventory/cases.environment index 6e25e315a..2c057ec18 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.environment +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.environment @@ -21,8 +21,13 @@ 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:osarch=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osarch|awk -F'=' '{print $2}');sed -i "s/OSARCH/$osarch/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml +cmd:osvers=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSVERS/$osvers/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml +cmd:pkgdir=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkgdir|awk -F'=' '{print $2}');sed -i "s!PKGDIR!$pkgdir!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml +cmd:pkglist=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkglist|awk -F'=' '{print $2}');sed -i "s!PKGLIST!$pkglist!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml +cmd:postinstall=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w postinstall|awk -F'=' '{print $2}');sed -i "s!POSTINSTALL!$postinstall!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml +cmd:osmajor=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSMAJOR/$osmajor/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml cmd:xcat-inventory import -f /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml -e GITREPO=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo -e SWDIR=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir -check:output=~Importing object: test.environments.osimage check:output=~Inventory import successfully! check:rc==0 cmd:lsdef -t osimage -o test.environments.osimage @@ -85,12 +90,23 @@ label:others,xcat_inventory cmd:lsdef -t osimage -o test.environments.osimage >/dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t osimage -o test.environments.osimage -z >/tmp/test.environments.osimage_image.stanza ;rmdef -t osimage -o test.environments.osimage;fi check:rc==0 cmd:dir="/tmp/export";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi; mkdir -p $dir +cmd:osarch=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osarch|awk -F'=' '{print $2}');sed -i "s/OSARCH/$osarch/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml +cmd:osvers=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSVERS/$osvers/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml +cmd:pkgdir=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkgdir|awk -F'=' '{print $2}');sed -i "s!PKGDIR!$pkgdir!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml +cmd:pkglist=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkglist|awk -F'=' '{print $2}');sed -i "s!PKGLIST!$pkglist!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml +cmd:postinstall=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w postinstall|awk -F'=' '{print $2}');sed -i "s!POSTINSTALL!$postinstall!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml +cmd:osmajor=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSMAJOR/$osmajor/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml cmd:xcat-inventory import -f /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml -e GITREPO=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo -e SWDIR=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir -check:output=~Importing object: test.environments.osimage check:output=~Inventory import successfully! check:rc==0 cmd:lsdef -t osimage -o test.environments.osimage -z >> /tmp/export/test.environments.osimage.yaml.stanza check:rc==0 +cmd:osarch=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osarch|awk -F'=' '{print $2}');sed -i "s/OSARCH/$osarch/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza +cmd:osvers=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSVERS/$osvers/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza +cmd:pkgdir=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkgdir|awk -F'=' '{print $2}');sed -i "s!PKGDIR!$pkgdir!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza +cmd:pkglist=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkglist|awk -F'=' '{print $2}');sed -i "s!PKGLIST!$pkglist!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza +cmd:postinstall=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w postinstall|awk -F'=' '{print $2}');sed -i "s!POSTINSTALL!$postinstall!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza +cmd:osmajor=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSMAJOR/$osmajor/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza cmd:diff -y /tmp/export/test.environments.osimage.yaml.stanza /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza check:rc==0 cmd:xcat-inventory export -t osimage -o test.environments.osimage -f /tmp/export/test.environments.osimage.yaml --format yaml @@ -100,8 +116,13 @@ cmd:diff -y /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templat check:rc==0 cmd:rmdef -t osimage -o test.environments.osimage check:rc==0 +cmd:osarch=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osarch|awk -F'=' '{print $2}');sed -i "s/OSARCH/$osarch/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json +cmd:osvers=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSVERS/$osvers/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json +cmd:pkgdir=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkgdir|awk -F'=' '{print $2}');sed -i "s!PKGDIR!$pkgdir!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json +cmd:pkglist=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w pkglist|awk -F'=' '{print $2}');sed -i "s!PKGLIST!$pkglist!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json +cmd:postinstall=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep -w postinstall|awk -F'=' '{print $2}');sed -i "s!POSTINSTALL!$postinstall!g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json +cmd:osmajor=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep osvers|awk -F'=' '{print $2}');sed -i "s/OSMAJOR/$osmajor/g" /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json cmd:xcat-inventory import -f /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json -e GITREPO=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo -e SWDIR=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir -check:output=~Importing object: test.environments.osimage check:output=~Inventory import successfully! check:rc==0 cmd:lsdef -t osimage -o test.environments.osimage -z >> /tmp/export/test.environments.osimage.json.stanza diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.include b/xCAT-test/autotest/testcase/xcat-inventory/cases.include index e1c85460f..6c12aff9f 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.include +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.include @@ -28,7 +28,6 @@ check:rc==0 cmd:rm -rf /tmp/imagedata/test_osimage cmd:xcat-inventory import -t osimage -d /tmp/imagedata/export check:rc==0 -check:output=~Importing object: test_osimage check:output=~Inventory import successfully! check:output=~The object test_osimage has been imported cmd:lsdef -t osimage -o test_osimage diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/change_name.sh b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/change_name.sh new file mode 100644 index 000000000..b37eb278f --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/change_name.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +file1=$1 +file2=$2 +tmp_diff_file=$3 +rm -rf $tmp_diff_file +echo "copy /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/diff/diff.result to $tmp_diff_file and modify compare file name in $tmp_diff_file" +cp /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/diff/diff.result $tmp_diff_file +echo "copy command exit code $?" +sed -i "s|#FILE1#|$file1|g" $tmp_diff_file +echo "sed command exit code $?" +sed -i "s|#FILE2#|$file2|g" $tmp_diff_file +echo "sed command exit code $?" diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff.result b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff.result new file mode 100644 index 000000000..a4a54c114 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff.result @@ -0,0 +1,87 @@ + +====================BEGIN===================== + + +--- #FILE1# ++++ #FILE2# +{ + "node": { + "node1": { + "obj_info": { +- "groups": "ipmi" ++ "groups": "all" + }, + "engines": { + "hardware_mgt_engine": { +- "engine_type": "ipmi" + "engine_info": { +- "bmcusername": "ADMIN" + }, ++ "engine_type": "openbmc" + } + } + }, +- "node3": { +- "obj_info": { +- "groups": "openbmc" +- }, +- "role": "compute", +- "device_type": "server", +- "engines": { +- "hardware_mgt_engine": { +- "engine_info": { +- "bmc": "10.1.1.2", +- "bmcusername": "ADMIN" +- }, +- "engine_type": "openbmc" +- } +- }, +- "obj_type": "node" +- } + "node2": { + "network_info": { + "primarynic": { + "mac": [ +- "42:73:0a:03:11:0a!*NOIP*", ++ "42:6e:0a:03:11:0b" + ] + } + } + } + }, + "osimage": { + "rhels7.5-alternate-ppc64le-install-compute": { + "package_selection": { + "pkgdir": [ ++ "/install/rhels7.5-alternate/ppc64le/test" + ], + "otherpkgdir": [ +- "/install/post/otherpkgs/rhels7.5-alternate/ppc64le", ++ "/install/post/otherpkgs/rhels7.5-alternate/ppc64" + ] + } + } + }, + "site": { + "clustersite": { +- "xcatdebugmode": "1", +- "domain": "test.com", +- "master": "10.1.1.2", +- "forwarders": "10.0.0.1" ++ "xcatdebugmode": "0", ++ "domain": "cluster.com", ++ "master": "10.1.1.1" + } + }, + "network": { + "10_0_0_0-255_0_0_0": { + "basic_attr": { +- "mgtifname": "eth1" ++ "mgtifname": "eth0" + } + } + } +} + +====================END===================== + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff_files.result b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff_files.result new file mode 100644 index 000000000..a4a54c114 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff_files.result @@ -0,0 +1,87 @@ + +====================BEGIN===================== + + +--- #FILE1# ++++ #FILE2# +{ + "node": { + "node1": { + "obj_info": { +- "groups": "ipmi" ++ "groups": "all" + }, + "engines": { + "hardware_mgt_engine": { +- "engine_type": "ipmi" + "engine_info": { +- "bmcusername": "ADMIN" + }, ++ "engine_type": "openbmc" + } + } + }, +- "node3": { +- "obj_info": { +- "groups": "openbmc" +- }, +- "role": "compute", +- "device_type": "server", +- "engines": { +- "hardware_mgt_engine": { +- "engine_info": { +- "bmc": "10.1.1.2", +- "bmcusername": "ADMIN" +- }, +- "engine_type": "openbmc" +- } +- }, +- "obj_type": "node" +- } + "node2": { + "network_info": { + "primarynic": { + "mac": [ +- "42:73:0a:03:11:0a!*NOIP*", ++ "42:6e:0a:03:11:0b" + ] + } + } + } + }, + "osimage": { + "rhels7.5-alternate-ppc64le-install-compute": { + "package_selection": { + "pkgdir": [ ++ "/install/rhels7.5-alternate/ppc64le/test" + ], + "otherpkgdir": [ +- "/install/post/otherpkgs/rhels7.5-alternate/ppc64le", ++ "/install/post/otherpkgs/rhels7.5-alternate/ppc64" + ] + } + } + }, + "site": { + "clustersite": { +- "xcatdebugmode": "1", +- "domain": "test.com", +- "master": "10.1.1.2", +- "forwarders": "10.0.0.1" ++ "xcatdebugmode": "0", ++ "domain": "cluster.com", ++ "master": "10.1.1.1" + } + }, + "network": { + "10_0_0_0-255_0_0_0": { + "basic_attr": { +- "mgtifname": "eth1" ++ "mgtifname": "eth0" + } + } + } +} + +====================END===================== + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff_source.result b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff_source.result new file mode 100644 index 000000000..45f78d822 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/diff_source.result @@ -0,0 +1,70 @@ + +====================BEGIN===================== + + +--- xCAT DB ++++ /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/diff/xcat-inventory_diff_file2.json +{ + "node": { + "node1": { + "obj_info": { +- "groups": "ipmi" ++ "groups": "all" + }, + "engines": { + "hardware_mgt_engine": { +- "engine_type": "ipmi" + "engine_info": { +- "bmcusername": "ADMIN" + }, ++ "engine_type": "openbmc" + } + } + }, + "node2": { + "network_info": { + "primarynic": { + "mac": [ +- "42:73:0a:03:11:0a!*NOIP*", ++ "42:6e:0a:03:11:0b" + ] + } + } + } + }, + "osimage": { + "rhels7.5-alternate-ppc64le-install-compute": { + "package_selection": { + "pkgdir": [ ++ "/install/rhels7.5-alternate/ppc64le/test" + ], + "otherpkgdir": [ +- "/install/post/otherpkgs/rhels7.5-alternate/ppc64le", ++ "/install/post/otherpkgs/rhels7.5-alternate/ppc64" + ] + } + } + }, + "site": { + "clustersite": { +- "xcatdebugmode": "1", +- "domain": "test.com", +- "master": "10.1.1.2", +- "forwarders": "10.0.0.1" ++ "xcatdebugmode": "0", ++ "domain": "cluster.com", ++ "master": "10.1.1.1" + } + }, + "network": { + "10_0_0_0-255_0_0_0": { + "basic_attr": { +- "mgtifname": "eth1" ++ "mgtifname": "eth0" + } + } + } +} + +====================END===================== + diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/xcat-inventory_diff_file1.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/xcat-inventory_diff_file1.json new file mode 100644 index 000000000..a77ff9b95 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/xcat-inventory_diff_file1.json @@ -0,0 +1,191 @@ +{ + "network": { + "10_0_0_0-255_0_0_0": { + "basic_attr": { + "gateway": "", + "mask": "255.0.0.0", + "mgtifname": "eth1", + "mtu": "1500", + "net": "10.0.0.0" + }, + "service": { + "tftpserver": "" + } + } + }, + "node": { + "node1": { + "device_type": "server", + "engines": { + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.1.1.1", + "bmcusername": "ADMIN", + }, + "engine_type": "ipmi" + } + }, + "obj_info": { + "groups": "ipmi" + }, + "obj_type": "node", + "role": "compute" + }, + "node2": { + "device_info": { + "arch": "ppc64le", + "uuid": "7d6ca5da-9485-11e8-821f-426e0a03110a" + }, + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "consoleenabled": "1", + "serialport": "0", + "serialspeed": "115200" + } + }, + "hardware_mgt_engine": { + "engine_info": { + "id": "10", + "vmcpus": "2", + "vmhost": "node_host", + "vmmemory": "6144", + "vmnics": "brenP3p9s0f0,brenP3p9s0f1", + "vmstorage": "phy:/dev/mapper/vdiskvg01-vdisk01n10" + }, + "engine_type": "kvm" + }, + "netboot_engine": { + "engine_info": { + "osimage": "rhels7.5-ppc64le-install-compute" + }, + "engine_type": "grub2" + } + }, + "network_info": { + "primarynic": { + "mac": [ + "42:6e:0a:03:11:0a", + "42:73:0a:03:11:0a!*NOIP*" + ] + } + }, + "obj_info": { + "groups": "all" + }, + "obj_type": "node", + "role": "compute" + }, + "node3": { + "device_type": "server", + "engines": { + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.1.1.2", + "bmcusername": "ADMIN", + }, + "engine_type": "openbmc" + } + }, + "obj_info": { + "groups": "openbmc" + }, + "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.5-alternate-ppc64le-install-compute": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "rhels7.5-alternate", + "osdistro": "rhels7.5-alternate-ppc64le", + "osname": "Linux" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": [ + "/install/post/otherpkgs/rhels7.5-alternate/ppc64le" + ], + "pkgdir": [ + "/install/rhels7.5-alternate/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" + }, + }, + "schema_version": "latest", + "site": { + "clustersite": { + "SNsyncfiledir": "/var/xcat/syncfiles", + "auditnosyslog": "0", + "auditskipcmds": "ALL", + "blademaxp": "64", + "cleanupxcatpost": "no", + "consoleondemand": "no", + "databaseloc": "/var/lib", + "db2installloc": "/mntdb2", + "dhcplease": "43200", + "dnshandler": "ddns", + "domain": "test.com", + "enableASMI": "no", + "forwarders": "10.0.0.1", + "fsptimeout": "0", + "installdir": "/install", + "ipmimaxp": "64", + "ipmiretries": "3", + "ipmitimeout": "2", + "master": "10.1.1.2", + "maxssh": "8", + "nameservers": "10.1.1.1", + "nodesyncfiledir": "/var/xcat/node/syncfiles", + "powerinterval": "0", + "ppcmaxp": "64", + "ppcretry": "3", + "ppctimeout": "0", + "sharedtftp": "1", + "sshbetweennodes": "ALLGROUPS", + "syspowerinterval": "0", + "tftpdir": "/tftpboot", + "timezone": "US/Eastern", + "useNmapfromMN": "no", + "vsftp": "n", + "xcatconfdir": "/etc/xcat", + "xcatdebugmode": "1", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatsslversion": "TLSv1" + } + } +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/xcat-inventory_diff_file2.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/xcat-inventory_diff_file2.json new file mode 100644 index 000000000..a3f7b243e --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/diff/xcat-inventory_diff_file2.json @@ -0,0 +1,173 @@ +{ + "network": { + "10_0_0_0-255_0_0_0": { + "basic_attr": { + "gateway": "", + "mask": "255.0.0.0", + "mgtifname": "eth0", + "mtu": "1500", + "net": "10.0.0.0" + }, + "service": { + "tftpserver": "" + } + } + }, + "node": { + "node1": { + "device_type": "server", + "engines": { + "hardware_mgt_engine": { + "engine_info": { + "bmc": "10.1.1.1", + }, + "engine_type": "openbmc" + } + }, + "obj_info": { + "groups": "all" + }, + "obj_type": "node", + "role": "compute" + }, + "node2": { + "device_info": { + "arch": "ppc64le", + "uuid": "7d6ca5da-9485-11e8-821f-426e0a03110a" + }, + "device_type": "server", + "engines": { + "console_engine": { + "engine_info": { + "consoleenabled": "1", + "serialport": "0", + "serialspeed": "115200" + } + }, + "hardware_mgt_engine": { + "engine_info": { + "id": "10", + "vmcpus": "2", + "vmhost": "node_host", + "vmmemory": "6144", + "vmnics": "brenP3p9s0f0,brenP3p9s0f1", + "vmstorage": "phy:/dev/mapper/vdiskvg01-vdisk01n10" + }, + "engine_type": "kvm" + }, + "netboot_engine": { + "engine_info": { + "osimage": "rhels7.5-ppc64le-install-compute" + }, + "engine_type": "grub2" + } + }, + "network_info": { + "primarynic": { + "mac": [ + "42:6e:0a:03:11:0a", + "42:6e:0a:03:11:0b" + ] + } + }, + "obj_info": { + "groups": "all" + }, + "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.5-alternate-ppc64le-install-compute": { + "basic_attributes": { + "arch": "ppc64le", + "distribution": "rhels7.5-alternate", + "osdistro": "rhels7.5-alternate-ppc64le", + "osname": "Linux" + }, + "imagetype": "linux", + "package_selection": { + "otherpkgdir": [ + "/install/post/otherpkgs/rhels7.5-alternate/ppc64" + ], + "pkgdir": [ + "/install/rhels7.5-alternate/ppc64le", + "/install/rhels7.5-alternate/ppc64le/test" + ], + "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" + }, + }, + "schema_version": "latest", + "site": { + "clustersite": { + "SNsyncfiledir": "/var/xcat/syncfiles", + "auditnosyslog": "0", + "auditskipcmds": "ALL", + "blademaxp": "64", + "cleanupxcatpost": "no", + "consoleondemand": "no", + "databaseloc": "/var/lib", + "db2installloc": "/mntdb2", + "dhcplease": "43200", + "dnshandler": "ddns", + "domain": "cluster.com", + "enableASMI": "no", + "fsptimeout": "0", + "installdir": "/install", + "ipmimaxp": "64", + "ipmiretries": "3", + "ipmitimeout": "2", + "master": "10.1.1.1", + "maxssh": "8", + "nameservers": "10.1.1.1", + "nodesyncfiledir": "/var/xcat/node/syncfiles", + "powerinterval": "0", + "ppcmaxp": "64", + "ppcretry": "3", + "ppctimeout": "0", + "sharedtftp": "1", + "sshbetweennodes": "ALLGROUPS", + "syspowerinterval": "0", + "tftpdir": "/tftpboot", + "timezone": "US/Eastern", + "useNmapfromMN": "no", + "vsftp": "n", + "xcatconfdir": "/etc/xcat", + "xcatdebugmode": "0", + "xcatdport": "3001", + "xcatiport": "3002", + "xcatsslversion": "TLSv1" + } + } +} diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza index 903363536..79166e511 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.stanza @@ -2,20 +2,20 @@ test.environments.osimage: objtype=osimage - environvar=GITREPO=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo,SWDIR=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir + environvar=GITREPO=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo,OBJNAME=test.environments.osimage,SWDIR=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir imagetype=linux - osarch=ppc64le - osdistroname=rhels7.5-alternate-ppc64le + osarch=OSARCH + osdistroname=OSVERS-OSARCH osname=Linux - osvers=rhels7.5-alternate + osvers=OSVERS otherpkgdir=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir/otherpkgdir/ otherpkglist=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/otherpkglist/test1.otherpkglist,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/otherpkglist/test2.otherpkglist, permission=755 - pkgdir=/install/rhels7.5-alternate/ppc64le,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir/pkgdir/ - pkglist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/pkglist/test1.pkglist,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/pkglist/test2.pkglist - postinstall=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/postinstall/test1.postinstall + pkgdir=PKGDIR,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir/pkgdir/ + pkglist=PKGLIST,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/pkglist/test1.pkglist,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/pkglist/test2.pkglist + postinstall=POSTINSTALL,/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/postinstall/test1.postinstall profile=compute provmethod=netboot rootimgdir=/install/custom/test.environments.osimage synclists=/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo/syncfiles/synclist - usercomment=rhels7.5,test_environment_variables + usercomment=OSMAJOR,test_environment_variables diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json index 68752808b..2dad18b47 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json @@ -2,13 +2,16 @@ "osimage": { "test.environments.osimage": { "basic_attributes": { - "arch": "ppc64le", - "distribution": "rhels7.5-alternate", - "osdistro": "rhels7.5-alternate-ppc64le", + "arch": "OSARCH", + "distribution": "OSVERS", + "osdistro": "OSARCH-OSVERS", "osname": "Linux" }, "deprecated": { - "comments": "rhels7.5,test_environment_variables" + "comments": [ + "OSMAJOR", + "test_environment_variables" + ] }, "filestosync": [ "{{GITREPO}}/syncfiles/synclist" @@ -16,10 +19,10 @@ "genimgoptions": { "permission": "755", "postinstall": [ - "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall", + "POSTINSTALL", "{{GITREPO}}/postinstall/test1.postinstall" ], - "rootimgdir": "/install/custom/test.environments.osimage" + "rootimgdir": "/install/custom/{{OBJNAME}}" }, "imagetype": "linux", "package_selection": { @@ -32,11 +35,11 @@ "" ], "pkgdir": [ - "/install/rhels7.5-alternate/ppc64le", + "PKGDIR", "{{SWDIR}}/pkgdir/" ], "pkglist": [ - "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist", + "PKGLIST", "{{GITREPO}}/pkglist/test1.pkglist", "{{GITREPO}}/pkglist/test2.pkglist" ] @@ -47,4 +50,4 @@ }, "schema_version": "1.0" } -#Version 2.14.2 (git commit 09f0772835afdc0f962c9e7fe8cef862e9505ad7, built Tue Jun 19 01:58:56 EDT 2018) +#Version 2.14.4 (git commit 722709b61e63feb7f6d3ee787afa8113eefbe27e, built Wed Sep 26 06:17:57 EDT 2018) diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml index c4f10968e..6ace48a22 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.yaml @@ -1,20 +1,22 @@ osimage: test.environments.osimage: basic_attributes: - arch: ppc64le - distribution: rhels7.5-alternate - osdistro: rhels7.5-alternate-ppc64le + arch: OSARCH + distribution: OSVERS + osdistro: OSVERS-OSARCH osname: Linux deprecated: - comments: rhels7.5,test_environment_variables + comments: + - OSMAJOR + - test_environment_variables filestosync: - '{{GITREPO}}/syncfiles/synclist' genimgoptions: permission: '755' postinstall: - - /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + - POSTINSTALL - '{{GITREPO}}/postinstall/test1.postinstall' - rootimgdir: /install/custom/test.environments.osimage + rootimgdir: /install/custom/{{OBJNAME}} imagetype: linux package_selection: otherpkgdir: @@ -24,10 +26,10 @@ osimage: - '{{GITREPO}}/otherpkglist/test2.otherpkglist' - '' pkgdir: - - /install/rhels7.5-alternate/ppc64le + - PKGDIR - '{{SWDIR}}/pkgdir/' pkglist: - - /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist + - PKGLIST - '{{GITREPO}}/pkglist/test1.pkglist' - '{{GITREPO}}/pkglist/test2.pkglist' provision_mode: netboot diff --git a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml index 82143abc4..adb23f662 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml +++ b/xCAT-test/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml @@ -1,23 +1,35 @@ osimage: test.environments.osimage: basic_attributes: - arch: ppc64le - distribution: rhels7.5 - osdistro: rhels7.5-ppc64le + arch: OSARCH + distribution: OSMAJOR + osdistro: OSVERS-OSARCH osname: Linux - filestosync: {{GITREPO}}/syncfiles/synclist + filestosync: + - {{GITREPO}}/syncfiles/synclist deprecated: - comments: rhels7.5,test_environment_variables + comments: + - OSMAJOR + - test_environment_variables genimgoptions: permission: '755' - postinstall: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall,{{GITREPO}}/postinstall/test1.postinstall - rootimgdir: /install/custom/test.environments.osimage + postinstall: + - POSTINSTALL + - {{GITREPO}}/postinstall/test1.postinstall + rootimgdir: /install/custom/{{OBJNAME}} imagetype: linux package_selection: otherpkgdir: {{SWDIR}}/otherpkgdir/ - otherpkglist: {{GITREPO}}/otherpkglist/test1.otherpkglist,{{GITREPO}}/otherpkglist/test2.otherpkglist, - pkgdir: /install/rhels7.5/ppc64le,{{SWDIR}}/pkgdir/ - pkglist: /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist,{{GITREPO}}/pkglist/test1.pkglist,{{GITREPO}}/pkglist/test2.pkglist + otherpkglist: + - {{GITREPO}}/otherpkglist/test1.otherpkglist + - {{GITREPO}}/otherpkglist/test2.otherpkglist, + pkgdir: + - PKGDIR + - {{SWDIR}}/pkgdir/ + pkglist: + - PKGLIST + - {{GITREPO}}/pkglist/test1.pkglist + - {{GITREPO}}/pkglist/test2.pkglist provision_mode: netboot role: compute schema_version: '1.0'