2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2024-11-23 18:10:14 +00:00
3 Test Design of xcat inventory osimage environment variables
tingtli edited this page 2018-06-14 09:33:31 +08:00

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

  1. 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'
  1. 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

  1. create correct files for synclist, otherpkglist, pkglist and postinstall

  2. Place the packages under correct directory under ohterpkgdir, pkgdir

  3. 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"
  1. run xcat-inventory command
 xcat-inventory import -f test.osimage.yaml
  1. run provision against the imported osimage

  2. Check if the provision succeeded.

  3. Check if all the packages are installed and postinstall script is run.