Test Setup

Before scheduling any jobs please validate the physical testbed to make sure all links are connected and are operationally UP, also we need a clean configuration file with valid interface settings (breakout, speed, FEC, admin status, etc.), no IP interfaces, no BGP instances, and no QoS. The scripts use this clean configuration file to restore the DUT to its default configuration as part of the clean-up process.

The cleanup configuration file should be at /etc/sonic/clean_config.json. The clean configuration file follows the config_db.json format. It must include the port-related settings for lane mapping, speed, and admin status.

How to create a clean config file

  • For every DUT in the testbed, backup the default config(if needed)

cd /etc/sonic/
cp config_db.json config_db.json.bak
  • Start with the default configuration after a fresh installation of SONiC

#reset to factory default
sudo rm /etc/sonic/config_db.json
sudo config-setup factory
sudo reboot
  • Edit config_db.json and remove the following configuration blocks and save the file

sudo vi config_db.json
"INTERFACE": {...}
"LOOPBACK_INTERFACE": {...}
"BGP_NEIGHBOR": {...}
"VLAN": {...}
"VLAN_MEMBER": {...}
"PORTCHANNEL": {...}
"PORTCHANNEL_MEMBER": {...}
  • configure the below list manually through config_db.json or SONiC CLI:

    • The management IP address for eth0

    • Default route or GW for management

    • Port breakout (if any)

    • Port speed, FEC, Auto-negotiation on links connected to DUT & Ixia

    • Ensure links between DUTs and links to Ixia are UP

    • Note down the L1 port settings (FEC, Auto-negotiation, etc.) on the Ixia side. We need these for Ixia parameters in the testbed file.

    • When all links are UP and function correctly save the config to config_db.json

Sample port configuration block
"Ethernet72": {
            "admin_status": "down",
            "alias": "Eth10(Port10)",
            "index": "10",
            "lanes": "33,34,35,36",
            "mtu": "9100",
	    "fec": "rs",
            "parent_port": "Ethernet72",
            "speed": "100000"
        },

The user should build the clean_config.json using either the text editor or SONiC CLI, but not both.

sudo config load config_db.json
sudo config save -y
  • Clone the /etc/sonic/config_db.json to /etc/sonic/clean_config.json

cd /etc/sonic/
cp config_db.json clean_config.json

ZTP Setup

In order to execute ZTP test cases, set up the DHCP container and ZTP files on the HTTP server.

Update ZTP parameters in testbed file:

  • Set ZTP Server URL (HTTP)

ZTP_PARAMS = {"ZTP_HTTP_SRV_ADDR": "<IP-Address>", "ZTP_HTTP_SRV_PORT": "<HTTP>", "ZTP_FOLDER": "/home/oper/reports/ztp",
              "DHCP_CONTAINER": "ztp_dhcp"}

#Example -
#ZTP_PARAMS = {"ZTP_HTTP_SRV_ADDR": "10.4.5.177", "ZTP_HTTP_SRV_PORT": "8090", "ZTP_FOLDER": "/home/oper/reports/ztp",
#              "DHCP_CONTAINER": "ztp_dhcp"}
  • Copy two SONiC images to ~/reports/ztp folder for ZTP image upgrade test cases.

    • Current SONiC image loaded on DUT (ZTP_DUT_IMAGE)

    • Another different version of SONiC image to be loaded by test scripts (ZTP_DIFF_DUT_IMAGE)

ZTP_PARAMS = {"ZTP_HTTP_SRV_ADDR": "10.4.5.177", "ZTP_HTTP_SRV_PORT": "8090", "ZTP_FOLDER": "/home/oper/reports/ztp",
              "DHCP_CONTAINER": "ztp_dhcp"}

NET_SERVICES_CONTAINER_NAME = "net_services"
  • Update DHCP configuration file /home/oper/reports/ztp/dhcpd.conf with the proper DHCP range and IP address of the HTTP server serving the ZTP file for SONiC.

# This is a very basic subnet declaration.
subnet 10.4.4.0 netmask 255.255.254.0 {
  range 10.4.5.65 10.4.5.96;
  option routers 10.4.4.1;
}

class "sonic" {
  match if substring(option host-name, 0, 5) = "sonic";
  # sonic ZTP Script
  option bootfile-name "http://<FTAS VM IP address>:8090/ztp/ztp.json";
}
  • Bring up the ztp_dhcpd container

docker run -d -v /home/oper/reports/ztp/dhcpd.conf:/etc/dhcp/dhcpd.conf --net=host --name=ztp_dhcpd --restart unless-stopped ztp_dhcp:v1 eth0

NTP Setup

Set "NTP_SERVER" parameter to FTAS VM IP as below

NTP_SRVS = ["<NTP server IP1>", "<NTP server IP2>"]

#NTP_SRVS = ["192.168.0.37", "8.8.8.8"]

Chaos Test Setup

TestBed File

Build the Chaos testbed file using "~/testbeds/ftas_chaos_topo.py"

Disable all cleanup options

Chaos test suite loads a base configuration to all DUTs and Ixia for all of its test scripts. So please ensure the following variables are set to False in the testbed file.

CLEANUP_BY_REBOOT = False
CLEANUP_BY_CFG_RELOAD = False

Clean up DUTs Configuration Manually

Please make sure DUTs have a clean or default configuration before the Chaos test run.

Remove the test statistics report file

Chaos suite generates a statistics report file at ~/reports/report.txt to track its execution status and metric data for all test scripts. So please make sure to remove this file before running the Chaos test to avoid Ixia library errors

cd ~/reports/
rm report.txt 

Last updated