There are two set of test cases in Voltha:
For now, this document focuses on running the integration tests only.
This section provides the high level details on how to execute the Voltha integration tests when running inside a Vagrant box. They may need to be adjusted when run in a different environment.
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/docutests/build_md_test.py
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/ofagent/test_ofagent_multicontroller_failover.py
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/ofagent/test_ofagent_recovery.py
cd /cord/incubator/voltha . ./env.sh make run-as-root-tests
cd /cord/incubator/voltha . ./env.sh docker-compose -f compose/docker-compose-system-test.yml up -d nosetests -s tests/itests/voltha/test_cold_activation_sequence.py
First start the Voltha ensemble:
cd /cord/incubator/voltha . ./env.sh docker-compose -f compose/docker-compose-system-test.yml up -d
Then start PONSIM in a separate window:
sudo -s . ./env.sh ./ponsim/main.py -v -o 4
Run the test:
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/voltha/test_device_state_changes.py
During this test, the user will be prompted to start ponsim. Use these commands to run ponsim with 1 OLT and 4 ONUs. This will also enable alarm at a frequency of 5 seconds:
sudo -s . ./env.sh ./ponsim/main.py -v -o 4 -a -f 5
The user will also be prompted to enable port forwarding on ponmgmt bridge. Use these commands:
sudo -s echo 8 > /sys/class/net/ponmgmt/bridge/group_fwd_mask
Run the test:
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/voltha/test_persistence.py
cd /cord/incubator/voltha . ./env.sh docker-compose -f compose/docker-compose-system-test.yml up -d nosetests -s tests/itests/voltha/test_voltha_rest_apis.py
The test will first verify that the kafka alarm topic exists. It will then create a simulated_olt device and verify that alarms are generated by the device.
First start the Voltha ensemble:
cd /cord/incubator/voltha . ./env.sh docker-compose -f compose/docker-compose-system-test.yml up -d
Then start PONSIM in a separate window:
sudo -s . ./env.sh ./ponsim/main.py -v -o 4 -a -f 5
Enable port forwarding
sudo -s echo 8 > /sys/class/net/ponmgmt/bridge/group_fwd_mask
Run the test:
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/voltha/test_voltha_alarm_events.py
The test will first verify that the kafka alarm topic exists. It will then create two devices along with a filter against one of the devices. The test will validate that alarms are received for the unfiltered device and alarms will be suppressed for the filtered device.
First start the Voltha ensemble:
cd /cord/incubator/voltha . ./env.sh docker-compose -f compose/docker-compose-system-test.yml up -d
Then start PONSIM in a separate window:
sudo -s . ./env.sh ./ponsim/main.py -v -o 4 -a -f 5
Enable port forwarding
sudo -s echo 8 > /sys/class/net/ponmgmt/bridge/group_fwd_mask
Run the test:
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/voltha/test_voltha_alarm_filters.py
During this test, the user will be prompted to start ponsim. Use these commands to run ponsim with 1 OLT and 4 ONUs.
sudo -s . ./env.sh ./ponsim/main.py -v -o 4
The user will also be prompted to enable port forwarding on ponmgmt bridge. Use these commands:
sudo -s echo 8 > /sys/class/net/ponmgmt/bridge/group_fwd_mask
Run the test:
cd /cord/incubator/voltha . ./env.sh nosetests -s tests/itests/voltha/test_dispatcher.py
First start the Voltha ensemble:
cd /cord/incubator/voltha . ./env.sh docker-compose -f compose/docker-compose-system-test.yml up -d
Then start PONSIM in a separate window:
sudo -s cd /cord/incubator/voltha . ./env.sh ./ponsim/main.py -v
Now Run the test in the first window:
nosetests -s tests/itests/voltha/test_voltha_xpon.py