2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2024-12-25 12:41:45 +00:00
7 Test Design of cumulus_osimage
tingtli edited this page 2018-05-16 15:35:44 +08:00

Test Design of cumulus osimage support

Introduction

This test plan is used to run cumulus switch osimage support test. The feature realized to configure a switch and install it with specified image.The test should cover follow the functions which realized in following PR.

https://github.com/xcat2/xcat-core/pull/5122
https://github.com/xcat2/xcat-core/pull/5144

Test Steps

1.Define switch node

[root@briggs01 cumulus_mlx]# lsdef -l mid05tor26
Object name: mid05tor26
    arch=armel
    groups=switch,edge_switch
    ip=172.11.205.26
    mac=A8:2B:B5:59:A5:C0
    mgt=switch
    netboot=onie
    nodetype=switch
    os=cumulus3.5.2
    postbootscripts=otherpkgs
    postscripts=syslog,remoteshell,syncfiles
    provmethod=cumulus3.5.2-armel
    snmpauth=sha
    snmppassword=xcatpassw0rd
    snmpprivacy=DES
    snmpusername=xcatadmin
    snmpversion=3
    status=configured
    switch=mgmtsw01
    switchport=26
    switchtype=onie
    updatestatus=synced
    updatestatustime=05-06-2018 22:53:25
    usercomment=Edgecore Networks Switch

2.Run copycds for cumulus installation binary

[root@briggs01 cumulus_mlx]# copycds cumulus-linux-3.5.2-bcm-armel.bin
run copydata for data file = /mnt/xcat/iso/cumulus/cumulus_mlx/cumulus-linux-3.5.2-bcm-armel.bin
Copying media to /install/cumulus3.5.2/armel
Media copy operation successful
creating image cumulus3.5.2-armel with osarch=armel, osvers=cumulus3.5.2
setting pkgdir=/install/cumulus3.5.2/armel/cumulus-linux-3.5.2-bcm-armel.bin for image cumulus3.5.2-armel
The image cumulus3.5.2-armel is created.
[root@briggs01 cumulus_mlx]# tabdump osimage |grep cumulus
"cumulus3.5.2-armel",,,"linux","Cumulus Linux","install",,,,,"cumulus","cumulus3.5.2","armel",,,,,,,,
[root@briggs01 cumulus_mlx]# lsdef -t osimage -o cumulus3.5.2-armel
Object name: cumulus3.5.2-armel
    description=Cumulus Linux
    imagetype=linux
    osarch=armel
    osname=cumulus
    osvers=cumulus3.5.2
    pkgdir=/install/cumulus3.5.2/armel/cumulus-linux-3.5.2-bcm-armel.bin
    provmethod=install
[root@briggs01 cumulus_mlx]# ls -l /install/cumulus3.5.2/armel/cumulus-linux-3.5.2-bcm-armel.bin
-rwxr-xr-x 1 root root 180570582 May  6 22:44 /install/cumulus3.5.2/armel/cumulus-linux-3.5.2-bcm-armel.bin

3. Specify the synclist files for osimage cumulus3.5.2-armel

[root@briggs01 cumulus_mlx]# chdef -t osimage -o cumulus3.5.2-armel synclists=/tmp/synclists
1 object definitions have been created or modified.
[root@briggs01 cumulus_mlx]# cat /tmp/synclists
/etc/resolv.conf /etc/nsswitch.conf -> (mid05tor26) /tmp/
/etc/rsyslog.conf  ->  /tmp/aa
/etc/rsyslog.d/ -> /tmp/bb/
/tmp/post1 -> /tmp/

EXECUTEALWAYS:
/tmp/post1

[root@briggs01 cumulus_mlx]# cat /tmp/post1
#!/bin/sh

mv /tmp/aa /tmp/mm

4. nodeset the osimage to the switch

[root@briggs01 cumulus_mlx]# nodeset mid05tor26 osimage=cumulus3.5.2-armel
mid05tor26 has provmethod=cumulus3.5.2-armel
osimage=cumulus3.5.2-armel, pkgdir=/install/cumulus3.5.2/armel/cumulus-linux-3.5.2-bcm-armel.bin
mid05tor26: install cumulus3.5.2-armel
[root@briggs01 cumulus_mlx]# echo $?
0
[root@briggs01 cumulus_mlx]# vi /var/lib/dhcpd/dhcpd.leases
host mid05tor26 {
  dynamic;
  hardware ethernet a8:2b:b5:59:a5:c0;
  uid a8:2b:b5:59:a5:c0;
  fixed-address 172.11.205.26;
        supersede server.ddns-hostname = "mid05tor26";
        supersede host-name = "mid05tor26";
        if substring (option vendor-class-identifier, 0, 11) = "onie_vendor" {
          supersede www-server =
                                 "http://172.11.253.27/install/cumulus3.5.2/armel/cumulus-linux-3.5.2-bcm-armel.bin";
        }
}

5. reboot cumulus switch to begin installation

[root@briggs01 ~]# xdsh mid05tor26  "/usr/cumulus/bin/onie-select -i -f;reboot"
mid05tor26: Enabling ONIE install mode at next reboot...done.
mid05tor26: Reboot required to take effect.
mid05tor26: Connection to mid05tor26 closed by remote host.

6. sync files with /usr/bin/scp instead of rsync after installation.

[root@briggs01 cumulus_mlx]# updatenode mid05tor26 -F -r /usr/bin/scp
File synchronization has completed for nodes: "mid05tor26"
[root@briggs01 cumulus_mlx]# echo $?
0
[root@briggs01 cumulus_mlx]# ssh mid05tor26

Welcome to Cumulus (R) Linux (R)

For support and online technical documentation, visit
http://www.cumulusnetworks.com/support

The registered trademark Linux (R) is used pursuant to a sublicense from LMI,
the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide
basis.
root@mid05tor26:~# ls /tmp
bb		    postage
discopacket.b64sig  resolv.conf
discopacket.gz	    systemd-private-562ea39c4ad14e9c9c51c4e1a2d97201-lldpd.service-tSgHMy
discopacket.sha512  tmp9AC1i3
mm		    tmpPO7CaG
nsswitch.conf	    wget.log
post1

Reference for the autotest configuration.

We have a test case named nodeset_switch_osimage for this regression under /opt/xcat/share/xcat/tools/autotest/testcase/nodeset. To run this test case, we need a parameter named CUMULUSOS in configuration file.

[System]
MN=mid05tor12cn05
CN=mid05tor26            #It can be used in flat environment
CUMULUSOS=/cumulus-linux-3.5.2-bcm-armel.bin