Running telemetry tests on Marvell Senao Wistron switches with real hardware - mganugapati-auradine/sonic-buildimage GitHub Wiki
On the Linux box::::
-
export SONIC_ROOT=$(pwd)
-
git clone -b aurion_ptf_tests [email protected]:Auradine/aurion-sonic-mgmt.git
-
cd sonic-mgmt
-
python3 -m venv sonic-venv
-
source sonic-venv/bin/activate
-
The requirements file is present in the root directory of sonic-mgmt folder
-
pip install -r requirements.txt
-
Here is a sample ansible/inventory file
-
Start the ptf container 8.1 Go to sonic-mgmt folder
8.2 cd sonic-mgmt
8.3 ./start_ptf_container.sh <CONTAINER_NAME>
-
Here is a sample ansible/testbed.yaml file
9.1 You can determine your sonic_hwsku from: sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'
9.2 t0 is short for Topology 0, which is the most basic and commonly used testbed topology in SONiC.
+-------------------+ | PTF Host | | (test generator) | +-------------------+ | | | | | | v v v v v v +----------------------------------+ | SONiC DUT | | (Your Marvell switch) | +----------------------------------+
8.3 Here are the different topologies supported on SONIC.
t0 | Single ToR + Hosts | General testing (routing, ACL, telemetry) t1 | Leaf-Spine (ECMP) | Route scaling, ECMP, multi-device testing dualtor | Redundant ToRs with MUX | High availability, switchover tests t0-64, t0-116 | High-density ToR | Scaling & stress testing t1-lag, t0-lag | Same as t0/t1, with LAGs | LAG behavior, hashing ptf32, ptf64 | Just PTF container sizes | Used with above
8.4 The ptf_ip comes from docker inspect ptf | grep IPAddress
The below environmental variables should be added to the .bashrc file
- export ANSIBLE_LIBRARY=$SONIC_ROOT/ansible/library
- export ANSIBLE_MODULE_UTILS=$SONIC_ROOT/ansible/module_utils
- export ANSIBLE_CONNECTION_PLUGINS=${SONIC_ROOT}/ansible/plugins/connection
- export ANSIBLE_CONFIG=${SONIC_ROOT}/ansible.cfg
- export ANSIBLE_LIBRARY=${SONIC_ROOT}/ansible/library
- export ANSIBLE_MODULE_UTILS=${SONIC_ROOT}/ansible/module_utils
Running a single test.
rm -rf .pytest_cache tests/_cache
cd tests (This is important)
pytest --capture=tee-sys ./radv/test_radv_run.py --inventory ./../ansible/inventory.yaml --host-pattern sonic-wistron --testbed wistron-testbed --testbed_file ./../ansible/testbed.yaml --disable_loganalyzer --skip_sanity -vvvv --mark-conditions-files ./common/plugins/conditional_mark/conditions/skip_criteria.yml
For VLAN related tests.
Please run the following commands before running the test.
sudo config vlan add 1000
sudo config vlan member add 1000 Ethernet0
sudo config interface ip add Vlan1000 192.168.0.1/24
Create topology
- Start docker-sonic-mgmt container.
- Create 32 vlan interfaces on the linux-server
#!/bin/bash BASE_IF="enp23s0f0np0" for i in $(seq 0 31); do SUBIF="$BASE_IF.$i" echo "Creating $SUBIF using macvlan" sudo ip link add $SUBIF link $BASE_IF type macvlan mode bridge sudo ip link set $SUBIF up done
-
28 of these interfaces connect to PTF --> 4 of these interface connnect to VMs. -->