2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2024-11-21 17:11:52 +00:00
5 Test Design of xcat inventory osimage phase2
tingtli edited this page 2018-06-08 15:28:01 +08:00

Introduction

This document provides an overview of test for export/import the files included (##INCLUDE##) in osimage customized files in osimage definition. 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-core/wiki/the-mini-design-of-xcat-inventory-export-and-import-for-osimage

Affected attributes

The follow attributes in xcat osimage inventory file might include other files by #INCLUDE:xxxxx# :

package_selection. pkglist
package_selection. otherpkglist
template
diskpartitionspec
filestosync
genimgoptions.postinstall
genimgoptions. exlist

According to the attributes in osimage inventory file. The attributes in osimage definition could be tested

   pkglist
   otherpkglist
   template
   partitionfile
   synclists   
   postinstall
   exlist

Test scenarios

The test case will cover following test scenarios for ##INCLUDE## usage in files

  1. A normal file which has one #INCLUDE in the file, the included file is a normal file which has no INCLUDE in the file.

  2. A normal file which has several #INCLUDE in the file, the included files are normal file which has no INCLUDE in the files.

  3. A normal file which has one #INCLUDE in the file, the included file is a normal file which has one INCLUDE in the file, the second included file has one INCLUDE in the file. The last file has no INCLUDE in the file.

  4. A normal file which has one #INCLUDE in the file, the included file is a normal file which has one INCLUDE in the file, the second included file has one INCLUDE in the file. The last INCLUDE includes the first file.

  5. A normal file which has one INCLUDE in the file. The included file is specified by absolute path.

  6. A normal file which has one INCLUDE in the file. The included file is specified by relative path.

  7. A normal file which has one INCLUDE int the file. The included file is under /opt/xcat/share/xcat/install.

customized osimage definition

For test case usage, We save an osimage definition stanza file under /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates. The details are as follows.

[root@boston02 test_osimage]# pwd
/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/imagedata/test_osimage
[root@boston02 test_osimage]# cat test_osimage.stanza
# <xCAT data object stanza file>

test_osimage:
    objtype=osimage
    exlist=/tmp/imagedata/test_osimage/exlist
    imagetype=linux
    otherpkglist=/tmp/imagedata/test_osimage/otherpkglist
    partitionfile=/tmp/imagedata/test_osimage/partitionfile
    pkglist=/tmp/imagedata/test_osimage/pkglist
    postinstall=/tmp/imagedata/test_osimage/postinstall
    provmethod=install
    synclists=/tmp/imagedata/test_osimage/synclists
    template=/tmp/imagedata/test_osimage/template.tmpl

Test case

Test steps:

  1. Define a customized osimage defintion.
[root@boston02 test_osimage]# lsdef -t osimage -o test_osimage
Object name: test_osimage
    exlist=/tmp/imagedata/test_osimage/exlist
    imagetype=linux
    otherpkglist=/tmp/imagedata/test_osimage/otherpkglist
    partitionfile=/tmp/imagedata/test_osimage/partitionfile
    pkglist=/tmp/imagedata/test_osimage/pkglist
    postinstall=/tmp/imagedata/test_osimage/postinstall
    provmethod=install
    synclists=/tmp/imagedata/test_osimage/synclists
    template=/tmp/imagedata/test_osimage/template.tmpl
  1. Run "xcat-inventory export -t osimage -o test_osimage -d /opt/inventory/site/"

  2. Check if the exported files and included files are exported.

  3. Run "rmdef -t osimage -o test_osimage"

  4. Run "xcat-inventory import -t osimage -o test_osimage -d /opt/inventory/site/"

  5. Check if the files are imported.