Skip to content

Test Design of xcat inventory regular expression

tingtli edited this page Sep 21, 2018 · 2 revisions

Introduction

This document provides an overview of test xcat-inventory export and import could process regex in database. This test plan is intended for the use of xCAT FVT team.

The test is against xCAT version 2.14.4. The build of xCAT will be picked up from the xcat.org

The xcat inventory regex design is under https://github.com/xcat2/xcat-inventory/pull/74

Affected tables

The following table will be used in the test

#node,nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases,nicextraparams,nicdevices,nicsadapter,comments,disable
"testnodes","|(.)(..)n(..)|ib0!(ipadd(10,41,0,100,dim2idx(a2idx($1),36,$2,18,$3),2,1))|","ib0!ib",,"ib0!Infiniband",,"ib0!ipoib",,,,,,

Test steps

  1. create a new nics table with regex in it.
#node,nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases,nicextraparams,nicdevices,nicsadapter,comments,disable
"testnodes","|(.)(..)n(..)|ib0!(ipadd(10,41,0,100,dim2idx(a2idx($1),36,$2,18,$3),2,1))|","ib0!ib",,"ib0!Infiniband",,"ib0!ipoib",,,,,,

2.execute xcat-inventory export with correct options

[root@c910f03c01p13 ~]# xcat-inventory export  -t node -o testnodes -f /tmp/export/nics.yaml --format yaml
The inventory data has been dumped to /tmp/export/nics.yaml
  1. check if inventory data is correct in /tmp/export/nics.yaml
[root@c910f03c01p13 ~]# cat /tmp/export/nics.yaml
node:
  testnodes:
    device_type: server
    network_info:
      nics:
        ib0:
          hostnamesuffixes:
          - ib
          ips: '|(.)(..)n(..)|ib0!(ipadd(10,41,0,100,dim2idx(a2idx($1),36,$2,18,$3),2,1))|'
          networks:
          - ipoib
          type:
          - Infiniband
    obj_type: group
    role: compute
schema_version: '1.0'

#Version 2.14.3 (git commit 7b7d9ab67589afec1ba58cd5138154290c529c0e, built Tue 
  1. execute xcat-inventory with correct options
[root@c910f03c01p13 ~]# xcat-inventory export  -t node -o testnodes -f /tmp/export/nics.json --format json
The inventory data has been dumped to /tmp/export/nics.json

  1. check /tmp/export/nics.json is correct
[root@c910f03c01p13 ~]# cat /tmp/export/nics.json
{
    "node": {
        "testnodes": {
            "device_type": "server",
            "network_info": {
                "nics": {
                    "ib0": {
                        "hostnamesuffixes": [
                            "ib"
                        ],
                        "ips": "|(.)(..)n(..)|ib0!(ipadd(10,41,0,100,dim2idx(a2idx($1),36,$2,18,$3),2,1))|",
                        "networks": [
                            "ipoib"
                        ],
                        "type": [
                            "Infiniband"
                        ]
                    }
                }
            },
            "obj_type": "group",
            "role": "compute"
        }
    },
    "schema_version": "1.0"
}
#Version 2.14.3 (git commit 7b7d9ab67589afec1ba58cd5138154290c529c0e, built Tue Aug 21 07:16:00 EDT 2018)
  1. remove nics table and to run import options
[root@c910f03c01p13 ~]# tabdump nics
#node,nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases,nicextraparams,nicdevices,nicsadapter,comments,disable

  1. run xcat-inventory import with correct options
[root@c910f03c01p13 ~]# xcat-inventory import  -t node -o testnodes -f /tmp/export/nics.json
loading inventory date in "/tmp/export/nics.json"
start to import "node" type objects
 preprocessing "node" type objects
 writting "node" type objects
Inventory import successfully!
  1. Check nics table is correctly imported
[root@c910f03c01p13 ~]# tabdump nics
#node,nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases,nicextraparams,nicdevices,nicsadapter,comments,disable
"testnodes","|(.)(..)n(..)|ib0!(ipadd(10,41,0,100,dim2idx(a2idx($1),36,$2,18,$3),2,1))|","ib0!ib",,"ib0!Infiniband",,"ib0!ipoib",,,,,,

  1. Remove nics table
[root@c910f03c01p13 ~]# xcat-inventory import  -t node -o testnodes -f /tmp/export/nics.yaml
loading inventory date in "/tmp/export/nics.yaml"
start to import "node" type objects
 preprocessing "node" type objects
 writting "node" type objects
Inventory import successfully!
  1. run xcat-inventory import with correct options
[root@c910f03c01p13 ~]# xcat-inventory import  -t node -o testnodes -f /tmp/export/nics.json
loading inventory date in "/tmp/export/nics.json"
start to import "node" type objects
 preprocessing "node" type objects
 writting "node" type objects
Inventory import successfully!
  1. Check nics table is correctly imported
[root@c910f03c01p13 ~]# tabdump nics
#node,nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases,nicextraparams,nicdevices,nicsadapter,comments,disable
"testnodes","|(.)(..)n(..)|ib0!(ipadd(10,41,0,100,dim2idx(a2idx($1),36,$2,18,$3),2,1))|","ib0!ib",,"ib0!Infiniband",,"ib0!ipoib",,,,,,

News

History

  • Oct 22, 2010: xCAT 2.5 released.
  • Apr 30, 2010: xCAT 2.4 is released.
  • Oct 31, 2009: xCAT 2.3 released. xCAT's 10 year anniversary!
  • Apr 16, 2009: xCAT 2.2 released.
  • Oct 31, 2008: xCAT 2.1 released.
  • Sep 12, 2008: Support for xCAT 2 can now be purchased!
  • June 9, 2008: xCAT breaths life into (at the time) the fastest supercomputer on the planet
  • May 30, 2008: xCAT 2.0 for Linux officially released!
  • Oct 31, 2007: IBM open sources xCAT 2.0 to allow collaboration among all of the xCAT users.
  • Oct 31, 1999: xCAT 1.0 is born!
    xCAT started out as a project in IBM developed by Egan Ford. It was quickly adopted by customers and IBM manufacturing sites to rapidly deploy clusters.
Clone this wiki locally