A Testbed parameter file is a Python script which defines the testbed parameters as variables. Testbed files are available in the ~/testbeds folder.
//Sample TestBed file
LEAF01_Ports = {"s2_p1": "Ethernet32", "s2_p1_speed": 100000,
"s2_p2": "Ethernet36", "s2_p2_speed": 100000,
"s1_p1": "Ethernet0", "s1_p1_speed": 100000,
"s1_p2": "Ethernet4", "s1_p2_speed": 100000,
"l2_p1": "Ethernet16", "l2_p1_speed": 100000,
"l2_p2": "Ethernet20", "l2_p2_speed": 100000,
"ixia_p1": "Ethernet60", "ixia_p1_speed": 100000,
"ixia_p2": "Ethernet48", "ixia_p2_speed": 100000,
"port_mtu": 9100
}
LEAF01 = {"IP": "10.4.4.66",
"PROTO": "http", "REST_PORT": 6002, "SSH_PORT": 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP, "cliWarnings": params.CLI_WARN_REGEXP,
"ssh_user": "admin",
"ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": LEAF01_Ports, "name": "MLNX-LEAF01",
"backup_cfg_file": "clean_config.json"
}1;8

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},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},# 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,
..."""
Description: Testbed information
"""
from genlibs import params
from genlibs import const
gParams = params.GLOBAL_PARAMS
pParams = params.PLATFORM_PARAMS
# PLS. DON'T CHANGE ANYTHING FROM HERE TO TOP OF THE FILE
# =================================================
ALL_DUTS = ["LEAF01", "LEAF02", "SPINE01", "SPINE02"]
# =================================================
CLEANUP_BY_REBOOT = False
CLEANUP_BY_CFG_RELOAD = False
CFG_RELOAD_BY_REBOOT = False
CHECK_COMPATIBILITY = False
CLEANUP_BEFORE_TEST_RUN = False
NET_SERVICES_CONTAINER_NAME = "net_services"
NTP_SERVER = "10.4.5.245"
INTF_UP_WAIT_TIME = 30
REBOOT_WAIT_TIME = 300
CLI_TIMEOUT = 0
MAX_V4_ACL = 64
MAX_INGRESS_V4_ACL = 64
MAX_V6_ACL = 64
MAX_SECONDARY_SUBNET = 25
MAX_IPV4_HOST_ROUTES = 1000
MAX_IPV6_HOST_ROUTES = 1000
MAX_IPV4_PREFIX_ROUTES = 1000
MAX_IPV6_PREFIX_ROUTES = 32000
MAX_IPV4_ROUTES_PER_NEXTHOP = 256
MAX_IPV4_NEXTHOPS = 2048
TECHSUPPORT = True
TECHSUPPORT_SINCE = "hour ago"
TECHSUPPORT_TIMEOUT = 300
STRESS_AVAIL_CORES = 2 # Number of CPU cores reserved for system use; all other cores will undergo stress testing
STRESS_MEM_UTIL = 85 # Targeted percentage of total system memory to allocate for stress testing
SERVER_IP = "10.20.0.75" # IP address of the server hosting the stress-ng Docker image
SERVER_USER_ID = "oper" # User ID for SCP access to the server hosting the stress-ng Docker image
SERVER_PASSWORD = "oper@123" # Password for SCP access to securely transfer the stress-ng Docker image
SYSLOG_SRVS = {"Servers": ["10.4.5.245", "10.4.5.6"], "Log_Folder": "/var/log/sonic_logs"}
TACACS_SRVS = [{"address": "10.4.5.177", "secret_key": "T@c@csSonic123"},
{"address": "10.4.5.179", "secret_key": "T@c@csSonic123"}]
TACACS_USERS = {"admin_user": "tacadmin", "admin_passwd": "sadmin@123", "oper_user": "tacuser",
"oper_passwd": "suser@123"}
IXIA_Ports = {"l1_p1": "21", "l1_p2": "24",
"l2_p1": "22", "l2_p2": "23",
"global_traffic_rate": 80,
"media": "fiber", "speed": "100G",
"port_configs": {
"localuhd/21": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/22": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/23": {"speed": "100G", "auto_negotiation": False, "rs_fec": True},
"localuhd/24": {"speed": "100G", "auto_negotiation": False, "rs_fec": True}
}
}
IXIA = {"IP": "10.4.4.10", "username": "aviz", "password": "aviz@123", "ports": IXIA_Ports}
LOGSRV1 = {"IP": "10.1.1.11", "SSH_PORT": 22, "ssh_user": "aviz", "ssh_passwd": "IxiaAviz2020", "Timeout": 30,
"name": "Syslog1", "CLI_PROMPTS": params.LINUX_PROMPTS}
# Linux Server to host services likes: NTP, Syslog, Tac_plus, etc. avtest user is in sudo group and no password
TESTSRV1 = {"IP": "10.109.9.112", "SSH_PORT": 22, "ssh_user": "avtest", "ssh_passwd": "avtest@123", "Timeout": 30,
"name": "TestSrv1", "CLI_PROMPTS": params.LINUX_PROMPTS}
SPINE01_Ports = {"l1_p1": "Ethernet0", "l1_p1_speed": 100000,
"l1_p2": "Ethernet4", "l1_p2_speed": 100000,
"l2_p1": "Ethernet24", "l2_p1_speed": 100000,
"l2_p2": "Ethernet28", "l2_p2_speed": 100000,
"s2_p1": "Ethernet32", "s2_p1_speed": 100000,
"s2_p2": "Ethernet36", "s2_p2_speed": 100000,
"port_mtu": 9100
}
SPINE01 = {"IP": "10.4.4.65",
"PROTO": "http", "REST_PORT": 9001, "SSH_PORT": 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP, "cliWarnings": params.CLI_WARN_REGEXP,
"ssh_user": "admin",
"ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": SPINE01_Ports, "name": "MLNX-SPINE01",
"backup_cfg_file": "clean_config.json"
}
SPINE02_Ports = {"l1_p1": "Ethernet16", "l1_p1_speed": 100000,
"l1_p2": "Ethernet20", "l1_p2_speed": 100000,
"l2_p1": "Ethernet0", "l2_p1_speed": 100000,
"l2_p2": "Ethernet4", "l2_p2_speed": 100000,
"s1_p1": "Ethernet32", "s1_p1_speed": 100000,
"s1_p2": "Ethernet36", "s1_p2_speed": 100000,
"port_mtu": 9100
}
SPINE02 = {"IP": "10.4.4.67",
"PROTO": "http", "REST_PORT": 6018, "SSH_PORT": 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP, "cliWarnings": params.CLI_WARN_REGEXP,
"ssh_user": "admin",
"ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": SPINE02_Ports, "name": "MLNX-SPINE02",
"backup_cfg_file": "clean_config.json"
}
LEAF01_Ports = {"s2_p1": "Ethernet16", "s2_p1_speed": 100000,
"s2_p2": "Ethernet20", "s2_p2_speed": 100000,
"s1_p1": "Ethernet0", "s1_p1_speed": 100000,
"s1_p2": "Ethernet4", "s1_p2_speed": 100000,
"l2_p1": "Ethernet32", "l2_p1_speed": 100000,
"l2_p2": "Ethernet36", "l2_p2_speed": 100000,
# provide the breakout modes for the supp ports in the below format
# "l2_p1": "Ethernet72", "l1_p3_speed": 100000,
# "l2_p1_breakout": "1x100G[40G], 2x50G, 4x25G, 4x10G",
"ixia_p1": "Ethernet60", "ixia_p1_speed": 100000,
"ixia_p2": "Ethernet48", "ixia_p2_speed": 100000,
"port_mtu": 9100
}
LEAF01 = {"IP": "10.4.4.66",
"PROTO": "http", "REST_PORT": 6002, "SSH_PORT": 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP, "cliWarnings": params.CLI_WARN_REGEXP,
"ssh_user": "admin",
"ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": LEAF01_Ports, "name": "MLNX-LEAF01",
"backup_cfg_file": "clean_config.json"
}
LEAF02_Ports = {"s2_p1": "Ethernet0", "s2_p1_speed": 100000,
"s2_p2": "Ethernet4", "s2_p2_speed": 100000,
"s1_p1": "Ethernet24", "s1_p1_speed": 100000,
"s1_p2": "Ethernet28", "s1_p2_speed": 100000,
"l1_p1": "Ethernet32", "l1_p1_speed": 100000,
"l1_p2": "Ethernet36", "l1_p2_speed": 100000,
# provide the breakout modes for the supp ports in the below format
# "l1_p3": "Ethernet72", "l1_p3_speed": 100000,
# "l1_p3_breakout": "1x100G[40G], 2x50G, 4x25G, 4x10G",
"ixia_p1": "Ethernet60", "ixia_p1_speed": 100000,
"ixia_p2": "Ethernet48", "ixia_p2_speed": 100000,
"port_mtu": 9100
}
LEAF02 = {"IP": "10.4.4.68",
"PROTO": "http", "REST_PORT": 6002, "SSH_PORT": 22,
"CLI_PROMPTS": params.CLI_PROMPTS,
"cliErrors": params.CLI_ERROR_REGEXP, "cliWarnings": params.CLI_WARN_REGEXP,
"ssh_user": "admin",
"ssh_passwd": "YourPaSsWoRd",
"Timeout": 30, "ports": LEAF02_Ports, "name": "MLNX-LEAF02",
"backup_cfg_file": "clean_config.json"
}"""
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 = False
CLEANUP_BY_CFG_RELOAD = False
CFG_RELOAD_BY_REBOOT = False
CHECK_COMPATIBILITY = False
CLEANUP_BEFORE_TEST_RUN = False
NTP_SERVER = "10.4.5.4"
INTF_UP_WAIT_TIME = 30
REBOOT_WAIT_TIME = 120
CLI_TIMEOUT = 0
MAX_V4_ACL = 64
MAX_V6_ACL = 64
MAX_SECONDARY_SUBNET = 25
MAX_IPV4_HOST_ROUTES = 1000
MAX_IPV6_HOST_ROUTES = 1000
MAX_IPV4_PREFIX_ROUTES = 1000
MAX_IPV4_NEXTHOPS = 256
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"
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"}"""
Description: Testbed information
"""
from genlibs import params
from genlibs import const
gParams = params.GLOBAL_PARAMS
pParams = params.PLATFORM_PARAMS
# =================================================
ALL_DUTS = ['LEAF01', 'LEAF02', 'SPINE01', 'SPINE02']
# =================================================
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"}
INTF_UP_WAIT_TIME = 30
REBOOT_WAIT_TIME = 300
CLI_TIMEOUT = 0
PCH_CONFIGURATION = False # to disable the PCH configuration in chaos scripts, default is True
TECHSUPPORT = True
TECHSUPPORT_SINCE = "hour ago"
TECHSUPPORT_TIMEOUT = 120
ACCEPTABLE_DELTA = 0.5 #Threshold for acceptable packet/frame loss percentage
CPU_MEM_THRESHOLD = 5 ## Threshold for acceptable change in CPU/memory utilization percentage
# 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": "Ethernet24", "l2": "Ethernet24", "speed": 100000,
"netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf2"}]
# {"s1": "Ethernet28", "l2": "Ethernet28", "speed": 100000,
# "netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf2"}]
S2_Ports = [
# Links from Spine2 to Leaf1
{"s2": "Ethernet16", "l1": "Ethernet16", "speed": 100000,
"netinfo": {"spine_ip": "", "leaf_ip": ""}, "peer": "leaf1"},
# {"s2": "Ethernet20", "l1": "Ethernet20", "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"}

