Test Design of xcat inventory osimage environment variables - xcat2/xcat-core GitHub Wiki
Introduction
This document provides an overview of test environment variables in osimage definition files. This test plan is intended for the use of xCAT FVT team.
The test is against xCAT version 2.14.2. The build of xCAT will be picked up from the xcat.org
The xcat inventory osimage design is under https://github.com/xcat2/xcat-inventory/pull/45
Affected attributes
The follow attributes in xcat osimage inventory file might include other files by #INCLUDE:xxxxx# :
package_selection. pkglist
package_selection. otherpkglist
filestosync
genimgoptions.postinstall
According to the attributes in osimage inventory file. The attributes in osimage definition could be tested
pkglist
otherpkglist
synclists
postinstall
Test steps
- create a yaml file
cat test.osimage.yaml
osimage:
test.osimage:
basic_attributes:
arch: ppc64le
distribution: rhels7.5
osdistro: rhels7.5-ppc64le
osname: Linux
filestosync: {{GITREPO}}/synclist
deprecated:
comments: rhels7.5,ist,cida-396.27,mofed-3-2.2.2.5
genimgoptions:
permission: '755'
postinstall: {{GITREPO}}/postinstall/test1.postinstall,{{GITREPO}}/postinstall/test2.postinstall
rootimgdir: /install/custom/test.osimage
imagetype: linux
package_selection:
otherpkgdir: {{SWDIR}}/otherpkgdir/
otherpkglist: {{GITREPO}}/otherpkglist/test1.otherpkglist,{{GITREPO}}/otherpkglist/test2.otherpkglist,
pkgdir: {{SWDIR}}/pkgdir/
pkglist: {{GITREPO}}/pkglist/test1.pkglist,{{GITREPO}}/pkglist/test2.pkglist
provision_mode: netboot
role: compute
schema_version: '1.0'
- under /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/, create a directory to hold all the files for GITREPO and SWDIR
environment/:
total 8
drwxr-xr-x 6 root root 4096 Jun 12 03:31 gitrepo/
drwxr-xr-x 4 root root 4096 Jun 12 03:39 swdir/
environment/gitrepo:
total 16
drwxr-xr-x 2 root root 4096 Jun 12 03:31 otherpkglist/
drwxr-xr-x 2 root root 4096 Jun 12 03:32 pkglist/
drwxr-xr-x 2 root root 4096 Jun 12 03:29 postinstall/
drwxr-xr-x 2 root root 4096 Jun 12 03:30 syncfiles/
environment/gitrepo/otherpkglist:
total 0
-rw-r--r-- 1 root root 0 Jun 12 03:31 test1.otherpkglist
-rw-r--r-- 1 root root 0 Jun 12 03:30 test2.otherpkglist
environment/gitrepo/pkglist:
total 0
-rw-r--r-- 1 root root 0 Jun 12 03:32 test1.pkglist
-rw-r--r-- 1 root root 0 Jun 12 03:32 test2.pkglist
environment/gitrepo/postinstall:
total 0
-rw-r--r-- 1 root root 0 Jun 12 03:29 test1.postinstall
-rw-r--r-- 1 root root 0 Jun 12 03:29 test2.postinstall
environment/gitrepo/syncfiles:
total 0
-rw-r--r-- 1 root root 0 Jun 12 03:13 synclist
environment/swdir:
total 8
drwxr-xr-x 2 root root 4096 Jun 12 03:39 otherpkgdir/
drwxr-xr-x 2 root root 4096 Jun 12 03:39 pkgdir/
environment/swdir/otherpkgdir:
total 0
environment/swdir/pkgdir:
total 0
-
create correct files for synclist, otherpkglist, pkglist and postinstall
-
Place the packages under correct directory under ohterpkgdir, pkgdir
-
export environment variables.
[root@c910f03c05k21 rhels]# export GITREPO="/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo"
[root@c910f03c05k21 rhels]# export SWDIR="/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir"
- run xcat-inventory command
xcat-inventory import -f test.osimage.yaml
-
run provision against the imported osimage
-
Check if the provision succeeded.
-
Check if all the packages are installed and postinstall script is run.