- FloodlightTest
FloodlightTest is a test execution framework released with floodlight for developers to conduct integration tests for floodlight and any developer added extensions. FloodlightTest allows developers to:
- Instantiate one or more VM(s) with mininet
- Run floodlight on developer's host (e.g., in eclipse) or in a VM
- Run a provided set of basic integration tests
- Add new integration tests for any newly developed extensions
FloodlightTest is released for assuring the high quality of floodlight and any of its extensions. FloodlightTest encourages and helps developers to follow proper test methodologies in their design process, while it also serves as a quality standard for community contributions into the floodlight repository.
By design, Floodlight is meant to be an open source controller for OpenFlow applications and/or controller features to be built on. Over time, Floodlight will grow with the open source community's contribution into a sound and stable controller platform. OpenBench will provide the test tools and process to assure the sound growth of floodlight.
- System requirements
1. VirtualBox v4.1.14 or later (earlier versions may work but have not been tested)
2. Internet connectivity for initial installation
3. Floodlight vmdk
- Installation procedure
1. On host, obtain floodlight-vm.zip from http://floodlight.openflowhub.org/download/(http://floodlight.openflowhub.org/download/); unzip it in your favorite working directory, say ~/work
2. On host, obtain VM create/setup scripts from https://github.com/kwanggithub/floodlighttest/tree/master/scripts(https://github.com/kwanggithub/floodlighttest/tree/master/scripts) ('git clone git@github.com:kwanggithub/floodlighttest' and see floodlighttest/scripts); then either 1) rename unzipped VM folder name to default name in onetime-create-vm.sh (i.e., floodlightcontroller-test), or 2) update the folder name in onetime-create-vm.sh (i.e., floodlightcontroller-release date).
3. On host, run onetime-create-vm.sh; click "Network" tab and "OK" for all VMs (default three) in VirtualBox GUI, then start them, log in each (username: floodlight, no password), run 'ifconfig' to confirm and note down eth0 IP address
4. On host, edit onetime-setup-vm.sh and setup-bench.sh with the found VM IP addresses; run onetime-setup-vm.sh to get OpenBench from github
- Running tests
Each time you want to start running tests, you will start all VM(s) from VirtualBox GUI and do the following:
1. Update floodlight.jar (and floodlight.properties) if needed:
- If you have not changed your floodlight code (i.e., floodlight.jar is up-to-date on your test VMs), you can simply start the three VMs (one console, two testers)
- If you do need to update your floodlight.jar, a convenience script is provided. On host, confirm/update path to your floodlight source root directory in update-floodlight.sh; confirm/update VM IP addresses in update-floodlight.sh. Run update-floodlight.sh which builds (with ant), uploads, and runs latest floodlight.jar on VM(s)
2. On "console" VM, 'cd floodlighttest' and then 'source setup-python-env.sh'
3. On "console" VM, 'bm clean' which cleans up any old VM states from previous runs.
4. Open build/Makefile.workspace to confirm/edit VM IP addresses under make target 'register-vms-floodlight'
5. On "console" VM, 'bm register-vms-floodlight'
6. On "console" VM, 'bm check-vms-floodlight'; see failed-check-vms-floodlight file for failed tests, if any
7. On "console" VM, 'bm check-tests-floodlight'; see failed-check-tests file for failed tests, if any
8. On "console" VM, 'bigtest/test-dir/test.py' to run individual failed tests directly to diagnose cause of failure
- Useful tips:
1. Use terminals to ssh into VMs for longer scroll history
2. Most failures of setup or test scripts were due to incorrect/incomplete network setup. Check the following for typical network problems:- ...
- Base test suite
1. check-vms-floodlight (rename to smoke test?): purpose ...
2. check-tests-floodlight: purpose ...
- Requirements for merging floodlight extensions
Floodlight enforces strict software engineering practice for quality assurance. All modules within floodlight must be accompanied with unit tests and integration tests provided by the developer(s).
1. JUnit unit tests. Code coverage threshold, eclipse, bm check
2. OpenBench integration tests
3. Floodlight committer tests and code review
- Adding new integration tests
...
Example
...
- Adding new unit tests
...
Example
...