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
tingtli edited this page 2018-05-21 16:44:36 +08:00

Test Design of xcat inventory osimage

Introduction

This document provides an overview of test of xcat inventory osimage. This test plan is intended for the use of xCAT FVT team.

The test is against xCAT version 2.14.1. 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

Test Cases

Test case 1: export 1 specified osimage

Test steps:

  1. Define a customized osimage defintion.
  2. Run "xcat-inventory export -t osimage -o rhels7.4sp1-x86_64-netboot-compute --format yaml --path //opt/inventory/site/osimage/"
  3. Check if the yaml file and the files directory tree is created.
[root@c910f03c05k21 osimage]# xcat-inventory export -t osimage -o rhels7.4sp1-x86_64-netboot-compute --format yaml --path //opt/inventory/site/osimage/
[root@c910f03c05k21 osimage]# cat /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/definition.yaml
osimage:
  rhels7.4sp1-x86_64-netboot-compute:
    basic_attributes:
      arch: x86_64
      distribution: rhels7.4sp1
      osdistro: rhels7.4sp1-x86_64
    genimgoptions:
      exlist: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.exlist
      postinstall: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.postinstall
      rootimgdir: /install/netboot/rhels7.4sp1/x86_64/compute
    imagetype: linux
    package_selection:
      otherpkgdir: /install/post/otherpkgs/rhels7.4sp1/x86_64
      otherpkglist: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.otherpkglist
      pkgdir: /install/rhels7.4sp1/x86_64
      pkglist: /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute/compute.rhels7.x86_64.pkglist
    provision_mode: netboot
    role: compute
    scripts:
      postbootscripts: config_cuda
      postscripts: confignetwork
schema_version: '1.0'

[root@c910f03c05k21 osimage]# tree /opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute
/opt/inventory/site/osimage/rhels7.4sp1-x86_64-netboot-compute
├── config_cuda
├── confignetwork
├── definition.yaml
└── opt
    └── inventory
        └── site
            └── osimage
                └── rhels7.4sp1-x86_64-netboot-compute
                    ├── compute.rhels7.x86_64.exlist
                    ├── compute.rhels7.x86_64.otherpkglist
                    ├── compute.rhels7.x86_64.pkglist
                    └── compute.rhels7.x86_64.postinstall

5 directories, 7 files

Test case 2: export several specified osimages

Test steps:

  1. Define several customized osimage defintions.
  2. Run "xcat-inventory export -t osimage -o rhels7.4sp1-x86_64-netboot-compute,rhels7.4sp2-x86_64-netboot-compute,rhels7.4sp3-x86_64-netboot-compute --format yaml --path //opt/inventory/site/osimage/"
  3. Check if the yaml file and the files directory tree is created. Any osimage yaml file and files directories should be same with Test case 1.

Test case 3: export all osimages in xcat database

Test steps:

  1. Don't need to define customized osimage, use all osimage definition in xcat database.
  2. Run "xcat-inventory export -t osimage --format yaml --path //opt/inventory/site/osimage/"
  3. Check if the yaml file and the files directory tree is created for all osimages in xcat database. Any osimage yaml file and files directories should be same with Test case 1.

Test case 4: import 1 specified osimage

Test steps:

  1. First run Test case 1 to export the osimage
  2. Run "xcat-inventory import -t osimage -o -f
  3. Check if the osimage definition is created and all files are placed under correct directories.

Test case 5: import several specified osimage

Test steps:

  1. First run Test case 2 to export the osimages
  2. Run "xcat-inventory import -t osimage -o ,, -f
  3. Check if the osimages definitions are created and all files are placed under correct directories.

Test case 6: import all default osimage

Test steps:

  1. First run Test case 3 to export the osimages
  2. Run "xcat-inventory import -t osimage -f
  3. Check if the osimages definitions are created and all files are placed under correct directories.