Full Mesh 4 DUTs Topology
All test scripts except Chaos can be run with full mesh 4 DUTs topology
Use the following sample script and steps to create your own testbed file.
Copy # DUTs Parameters #
SPINE01_Ports = {"s2_p1": "<Ethernet0>", "s2_p1_speed": 100000,
"s2_p2": "<Ethernet8>", "s2_p2_speed": 100000,
"l1_p1": "<Ethernet16>", "l1_p1_speed": 100000,
"l1_p2": "<Ethernet24>", "l1_p2_speed": 100000,
"l2_p1": "<Ethernet32>", "l2_p1_speed": 100000,
"l2_p2": "<Ethernet40>", "l2_p2_speed": 100000,
"ixia_p1": "<Ethernet232>",
"ixia_p2": "<Ethernet240>",
"ixia_p3": "<Ethernet248>",
"port_mtu": 9100
}
SPINE01 = {"IP": "<SPINE1 IP>", 'SSH_PORT': 22, "CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": SPINE01_Ports,
"ssh_user": "<admin>", "ssh_passwd": "<Innovium123>",
"Timeout": 30, "name": "<string to identify the device>",
"backup_cfg_file": "clean_config.json"}
Replace anything in "<...>
" with your DUTs - DUT connections, Management IP address, Login credentials, Link Speed etc.
The "name" parameter is very important. Provide a string to identify the respective for this parameter. This name is displayed in logs for easy identification of devices.
Refer to the topology diagram to find the link variables and update their values
All testbed files can be found in the folder "~/testbeds/"
Testbed file variables
There are two variables to control the cleanup after each test run in the testbed file.
They are CLEANUP_BY_REBOOT
and CLEANUP_BY_CFG_RELOAD
:
CLEANUP_
BY_REBOOT = True
, The script will restore the switch's configuration from the /etc/sonic/clean_config.json file and then reboot the switch. This takes more execution time and DUTs always have a clean and proper configuration for the next test scripts.
CLEANUP_BY_CFG_RELOAD = True
, The script will restore the switch's configuration from the /etc/sonic/clean_config.json file and then issue the sudo config load
command to load the clean config file. This method takes less time to have a clean configuration on switches but may not work correctly sometimes
If both CLEANUP_
BY_REBOOT
and CLEANUP_BY_
CFG_RELOAD
are set to False
, The scripts use the SONiC CLI procedure to un-configure whatever was configured on the switches by the scripts.
Ideally, all three parameters should be set to False
.
Apart from these following variables are specified in the testbed file.
CFG_RELOAD_BY_REBOOT = True
, The scripts reboot the devices wherever the config reload command is supposed to be used. This is for the cases when the config reload
command is failing on the DUT due to some reason.
NTP_SERVER = <FTAS VM IP>
,FTAS VM serves as NTP server
INTF_UP_WAIT_TIME = 30
, specifies the time the script should wait after starting up an interface to check the interface status.
SYSLOG_SRVS = {"Servers": ["FTAS VM IP", "10.4.5.6"], "Log_Folder": "/var/log/sonic_logs"}
, first list member should be set to the FTAS VM IP
Configuring Ixia Variables
For UHD Chassis:
Copy IXIA_Ports = {"s1_p1": "<port_no>", "s1_p2": "<port_no>", "s1_p3": "<port_no>",
"media": "fiber", "speed": "100G",
"port_configs": {
"<localuhd>/<8>": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
Specify the port connected to the DUT like this: "s1_p1": "8"
, where the port number 8
is connected to Spine01_Port01
for Ixia traffic.
For example, Ixia port 8 can be configured like this: "localuhd/8"
, where localuhd
refers to the Ixia chassis and 8
is the UHD port number.
For Novus Chassis:
Copy IXIA_Ports = {"s1_p1": "<card_no>;<Port_no>", "s1_p2": "<card_no>;<Port_no>", "s1_p3": "<card_no>;<Port_no>",
"media": "fiber", "speed": "100G",
"port_configs": {
"<chassis_ip>;<card_no>;<Port_no>": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
Specify the port connected to the DUT like this: "s1_p1": "1;8"
, where the port number 8
on Ixia card 1
is connected to Spine01_Port01
for Ixia traffic.
For example, Ixia port 1;8 can be configured like this: "<chassis_ip>;<card_no>;<Port_no>"
, where <chassis_ip>
refers to the Ixia chassis IP and 1;8
is the port with the card number.
Ixia port format varies and depends on the Ixia Chassis type
Control Ixia traffic rate globally
For the testbeds where links between DUTs have less bandwidth than Ixia ports traffic tests may fail due to traffic drops on the least bandwidth links (i.e. DUTs may be connected with 1G ports and the Ixia link maybe 100G).
To avoid this situation a global parameter for the ixia traffic rate "global_traffic_rate"
in percentage could be used to enforce traffic rate in all tests.
When the global_traffic_rate
parameter is defined as a sub-parameter in the "Ixia_Ports"
all traffic streams in all test scripts would override their own rate value with global_traffic_rate
value configured.
When global_traffic_rate
is not defined all traffic streams in all test scripts would use their own static values for the traffic rate.
Copy # Ixia Parameters #
IXIA_Ports = {"s1_p1": "8", "s1_p2": "9", "s1_p3": "10",
"s2_p1": "11", "s2_p2": "12",
"l1_p1": "8", "l1_p2": "9", "l1_p3": "10",
"l2_p1": "11", "l2_p2": "12",
"media": "fiber", "speed": "100G", "global_traffic_rate": 25,
...
Here the "global_traffic_rate": 25
referrers to 25% speed for all Ixia ports
Copy """
Description: Testbed information
"""
from genlibs import params
from genlibs import const
gParams = params.GLOBAL_PARAMS
pParams = params.PLATFORM_PARAMS
# =================================================
ALL_DUTS = ['SPINE01', 'SPINE02', 'LEAF01', 'LEAF02']
# =================================================
CLEANUP_BY_REBOOT = False
CLEANUP_BY_CFG_RELOAD = False
CFG_RELOAD_BY_REBOOT = False
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"
NTP_SRVS = ["<NTP server IP1>", "<NTP server IP2>"]
SYSLOG_SRVS = {"Servers": ["<SYSLOG server IP1>", "<SYSLOG server IP2>"], 'Log_Folder': "/var/log/sonic_logs"}
TACACS_SRVS = [{"address": "<IP address1>", "secret_key": "T@c@csSonic123"},
{"address": "<IP address2>", "secret_key": "T@c@csSonic123"}]
TACACS_USERS = {"admin_user": "tacadmin", "admin_passwd": "sadmin@123",
"oper_user": "tacuser", "oper_passwd": "suser@123"}
# Ixia Parameters #
IXIA_Ports = {"s1_p1": "8", "s1_p2": "9", "s1_p3": "10",
"s2_p1": "11", "s2_p2": "12",
"l1_p1": "13", "l1_p2": "14",
"l2_p1": "15", "l2_p2": "16",
"media": "fiber", "speed": "100G",
"port_configs": {
"localuhd/8": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/9": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/10": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/11": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/12": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/13": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/14": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/15": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/16": {"speed": "100G", "auto_negotiation": False, "rs_fec": True}
}}
IXIA = {"IP": "<Ixia IP>", "username": "<ix username>", "password": "<Ixia passwd>", "ports": IXIA_Ports}
# DUTs Parameters #
SPINE01_Ports = {"s2_p1": "Ethernet0", "s2_p1_speed": 100000,
"s2_p2": "Ethernet8", "s2_p2_speed": 100000,
"l1_p1": "Ethernet16", "l1_p1_speed": 100000,
"l1_p2": "Ethernet24", "l1_p2_speed": 100000,
"l2_p1": "Ethernet32", "l2_p1_speed": 100000,
"l2_p2": "Ethernet40", "l2_p2_speed": 100000,
"ixia_p1": "Ethernet232",
"ixia_p2": "Ethernet240",
"ixia_p3": "Ethernet248",
"port_mtu": 9100
}
SPINE01 = {"IP": "<SPINE1 IP>", 'SSH_PORT': 22, "CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": SPINE01_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Spine1",
"backup_cfg_file": "clean_config.json"}
SPINE02_Ports = {"s1_p1": "Ethernet0", "s1_p1_speed": 100000,
"s1_p2": "Ethernet8", "s1_p2_speed": 100000,
"l1_p1": "Ethernet16", "l1_p1_speed": 100000,
"l1_p2": "Ethernet24", "l1_p2_speed": 100000,
"l2_p1": "Ethernet32", "l2_p1_speed": 100000,
"l2_p2": "Ethernet40", "l2_p2_speed": 100000,
"ixia_p1": "Ethernet240",
"ixia_p2": "Ethernet248",
"port_mtu": 9100
}
SPINE02 = {"IP": "<SPINE2 IP>", 'SSH_PORT': 22, "CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": SPINE02_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Spine2",
"backup_cfg_file": "clean_config.json"}
LEAF01_Ports = {"l2_p1": "Ethernet32", "l2_p1_speed": 100000,
"l2_p2": "Ethernet40", "l2_p2_speed": 100000,
"s1_p1": "Ethernet32", "s1_p1_speed": 100000,
"s1_p2": "Ethernet40", "s1_p2_speed": 100000,
"s2_p1": "Ethernet32", "s2_p1_speed": 100000,
"s2_p2": "Ethernet40", "s2_p1_speed": 100000,
"ixia_p1": "Ethernet240",
"ixia_p2": "Ethernet248",
"port_mtu": 9100
}
LEAF01 = {"IP": "<LEAF1 IP>", 'SSH_PORT': 22, "CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": LEAF01_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Leaf1",
"backup_cfg_file": "clean_config.json"}
LEAF02_Ports = {"l1_p1": "Ethernet32", "l1_p1_speed": 100000,
"l1_p2": "Ethernet40", "l1_p2_speed": 100000,
"s1_p1": "Ethernet32", "s1_p1_speed": 100000,
"s1_p2": "Ethernet40", "s1_p2_speed": 100000,
"s2_p1": "Ethernet32", "s2_p1_speed": 100000,
"s2_p2": "Ethernet40", "s2_p2_speed": 100000,
"ixia_p1": "Ethernet240",
"ixia_p2": "Ethernet248",
"port_mtu": 9100
}
LEAF02 = {"IP": "<LEAF2 IP>", 'SSH_PORT': 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": LEAF02_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Leaf2",
"backup_cfg_file": "clean_config.json"}
2 DUTs Topology
If you don't have 4 DUTs topology and want to run scripts that require only 2 DUTs, You can use ftas_2duts_topo.py
testbed parameter file
There are two physical DUTs in the topology but the script might pick the name Spine and Leaf interchangeably. So in the testbed file, we should define parameters for both but they point to the same physical Spine and Leaf DUTs.
Copy """
Description: Testbed information
"""
from genlibs import params
from genlibs import const
gParams = params.GLOBAL_PARAMS
pParams = params.PLATFORM_PARAMS
# =================================================
ALL_DUTS = ['SPINE01', 'SPINE02']
# =================================================
CLEANUP_BY_REBOOT = True
CLEANUP_BY_CFG_RELOAD = False
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"
NTP_SRVS = ["<NTP server IP1>", "<NTP server IP2>"]
SYSLOG_SRVS = {"Servers": ["<SYSLOG server IP1>", "<SYSLOG server IP2>"], 'Log_Folder': "/var/log/sonic_logs"}
TACACS_SRVS = [{"address": "<IP address1>", "secret_key": "T@c@csSonic123"},
{"address": "<IP address2>", "secret_key": "T@c@csSonic123"}]
TACACS_USERS = {"admin_user": "tacadmin", "admin_passwd": "sadmin@123",
"oper_user": "tacuser", "oper_passwd": "suser@123"}
# Ixia Parameters #
IXIA_Ports = {"s1_p1": "8", "s1_p2": "9", "s1_p3": "10",
"s2_p1": "11", "s2_p2": "12",
"l1_p1": "8", "l1_p2": "9", "l1_p3": "10",
"l2_p1": "11", "l2_p2": "12",
"media": "fiber", "speed": "100G",
"port_configs": {
"localuhd/8": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/9": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/10": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/11": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/12": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
}}
IXIA = {"IP": "<Ixia IP>", "username": "<ix username>", "password": "<Ixia passwd>", "ports": IXIA_Ports}
# DUTs Parameters #
SPINE01_Ports = {"s2_p1": "Ethernet0", "s2_p1_speed": 100000,
"s2_p2": "Ethernet8", "s2_p2_speed": 100000,
"ixia_p1": "Ethernet232",
"ixia_p2": "Ethernet240",
"ixia_p3": "Ethernet248"}
SPINE01 = {"IP": "<SPINE1 IP>", 'SSH_PORT': 22, "CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": SPINE01_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Spine1",
"backup_cfg_file": "clean_config.json"}
SPINE02_Ports = {"s1_p1": "Ethernet0", "s1_p1_speed": 100000,
"s1_p2": "Ethernet8", "s1_p2_speed": 100000,
"ixia_p1": "Ethernet240",
"ixia_p2": "Ethernet248"}
SPINE02 = {"IP": "<SPINE2 IP>", 'SSH_PORT': 22, "CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": SPINE02_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Spine2",
"backup_cfg_file": "clean_config.json"}
LEAF01_Ports = {"l2_p1": "Ethernet32", "l2_p1_speed": 100000,
"l2_p2": "Ethernet40", "l2_p2_speed": 100000,
"ixia_p1": "Ethernet240",
"ixia_p2": "Ethernet248"}
LEAF01 = {"IP": "<SPINE1 IP>", 'SSH_PORT': 22, "CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": LEAF01_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Leaf1",
"backup_cfg_file": "clean_config.json"}
LEAF02_Ports = {"l1_p1": "Ethernet32", "l1_p1_speed": 100000,
"l1_p2": "Ethernet40", "l1_p2_speed": 100000,
"ixia_p1": "Ethernet240",
"ixia_p2": "Ethernet248"}
LEAF02 = {"IP": "<SPINE2 IP>", 'SSH_PORT': 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI, "ports": LEAF02_Ports,
"ssh_user": "admin", "ssh_passwd": "Innovium123",
"Timeout": 30, "name": "Leaf2",
"backup_cfg_file": "clean_config.json"}
Full Mesh 4 DUTs Topology for Chaos
ftas_chaos_topo.py
testbed parameter file is used for Chaos test scripts only
Copy """
Description: Testbed information
"""
from genlibs import params
from genlibs import const
gParams = params.GLOBAL_PARAMS
pParams = params.PLATFORM_PARAMS
# =================================================
ALL_DUTS = ['SPINE01', 'SPINE02', 'LEAF01', 'LEAF02']
# =================================================
result_dir = "/home/oper/reports"
CLEANUP_BY_REBOOT = False
CLEANUP_BY_CFG_RELOAD = False
West_Ixia_Params = {"ports": [21], "ixmedia": "fiber", "ixspeed": "100G", "peer": "leaf1"}
East_Ixia_Params = {"ports": [22], "ixmedia": "fiber", "ixspeed": "100G", "peer": "leaf2"}
IXIA = {"IP": "10.4.4.10", "username": "aviz", "password": "aviz@123", "ixmedia": "fiber", "ixspeed": "100G"}
# Use a network with prefixlen = 24
MASTER_NETWORK = "172.16.1.0/24"
S1_Ports = [
# Links from Spine1 to Leaf1
{"s1": "Ethernet0", "l1": "Ethernet0", "speed": 100000,
"netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf1"},
# {"s1": "Ethernet4", "l1": "Ethernet4", "speed": 100000,
# "netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf1"},
# Links from Spine1 to Leaf2
{"s1": "Ethernet32", "l2": "Ethernet32", "speed": 100000,
"netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf2"}]
# {"s1": "Ethernet36", "l2": "Ethernet36", "speed": 100000,
# "netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf2"}]
S2_Ports = [
# Links from Spine1 to Leaf1
{"s2": "Ethernet32", "l1": "Ethernet32", "speed": 100000,
"netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf1"},
# {"s2": "Ethernet36", "l1": "Ethernet36", "speed": 100000,
# "netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf1"},
# Links from Spine2 to Leaf2
{"s2": "Ethernet0", "l2": "Ethernet0", "speed": 100000,
"netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf2"}]
# {"s2": "Ethernet4", "l2": "Ethernet4", "speed": 100000,
# "netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf2"}]
L1_Ixia_Ports = [
# Links from Leaf1 to Ixia
{"ixia": "21", "l1_ixia": "Ethernet60", "speed": 100000,
"netinfo": {"ixia_ip": "", "leaf_ip": ""},
"port_configs": {"localuhd/21": {"speed": "100G", "auto_negotiation": False, "rs_fec": True}}}]
L2_Ixia_Ports = [
# Links from Leaf1 to Ixia
{"ixia": "22", "l2_ixia": "Ethernet60", "speed": 100000,
"netinfo": {"ixia_ip": "", "leaf_ip": ""},
"port_configs": {"localuhd/22": {"speed": "100G", "auto_negotiation": False, "rs_fec": True}}}]
# {"ixia": "10", "l2_ixia": "Ethernet100", "speed": 1000000,
# "netinfo": {"ixia_ip": "", "leaf_ip": ""}}]
SPINE01 = {"IP": "10.4.4.65", 'SSH_PORT': 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI,
"ssh_user": "admin", "ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": S1_Ports, "name": "Spine1",
"backup_cfg_file": "clean_config.json"}
SPINE02 = {"IP": "10.4.4.67", 'SSH_PORT': 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI,
"ssh_user": "admin", "ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": S1_Ports, "name": "Spine2",
"backup_cfg_file": "clean_config.json"}
LEAF01 = {"IP": "10.4.4.66", 'SSH_PORT': 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI,
"ssh_user": "admin", "ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": S1_Ports + S2_Ports, "name": "Leaf1",
"backup_cfg_file": "clean_config.json"}
LEAF02 = {"IP": "10.4.4.68", 'SSH_PORT': 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP,
"cliWarnings": params.CLI_WARN_REGEXP,
"climode": const.CliModes.SONiC_CLI,
"ssh_user": "admin", "ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": S1_Ports + S2_Ports, "name": "Leaf2",
"backup_cfg_file": "clean_config.json"}