diff --git a/xCAT-test/autotest/testcase/xcat-inventory/cases.environment b/xCAT-test/autotest/testcase/xcat-inventory/cases.environment index ab7b69d2a..a05f6a706 100644 --- a/xCAT-test/autotest/testcase/xcat-inventory/cases.environment +++ b/xCAT-test/autotest/testcase/xcat-inventory/cases.environment @@ -7,7 +7,7 @@ check:rc==0 cmd:makedns -n check:rc==0 -cmd:sleep 20 +#cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -16,11 +16,17 @@ 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 +#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: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=~Inventory import successfully! check:rc==0 @@ -84,11 +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=~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 @@ -98,6 +116,12 @@ 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=~Inventory import successfully! check:rc==0 @@ -105,7 +129,7 @@ cmd:lsdef -t osimage -o test.environments.osimage -z >> /tmp/export/test.environ check:rc==0 cmd:diff -y /tmp/export/test.environments.osimage.json.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.json --format json +cmd:xcat-inventory export -t osimage -o test.environments.osimage -f /tmp/export/test.environments.osimage.json check:rc==0 cmd:diff -y /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.update.json /tmp/export/test.environments.osimage.json --ignore-blank-lines -I "^#" check:rc==0 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 86faff377..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 @@ -4,18 +4,18 @@ test.environments.osimage: objtype=osimage 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 5e7680b40..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,14 +2,14 @@ "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", + "OSMAJOR", "test_environment_variables" ] }, @@ -19,7 +19,7 @@ "genimgoptions": { "permission": "755", "postinstall": [ - "/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall", + "POSTINSTALL", "{{GITREPO}}/postinstall/test1.postinstall" ], "rootimgdir": "/install/custom/{{OBJNAME}}" @@ -35,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" ] @@ -50,4 +50,4 @@ }, "schema_version": "1.0" } -#Version 2.14.4 (git commit 722709b61e63feb7f6d3ee787afa8113eefbe27e, built Wed Sep 26 06:17:57 EDT 2018) \ No newline at end of file +#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 ced0777ea..65a19b703 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,20 @@ 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 + - 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/{{OBJNAME}} imagetype: linux @@ -26,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 b6649accf..38a1d0b28 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,20 +1,20 @@ 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 deprecated: comments: - - rhels7.5 + - OSMAJOR - test_environment_variables genimgoptions: permission: '755' postinstall: - - /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall + - POSTINSTALL - {{GITREPO}}/postinstall/test1.postinstall rootimgdir: /install/custom/{{OBJNAME}} imagetype: linux @@ -24,10 +24,10 @@ osimage: - {{GITREPO}}/otherpkglist/test1.otherpkglist - {{GITREPO}}/otherpkglist/test2.otherpkglist, pkgdir: - - /install/rhels7.5/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