...
You can check out OFTest with git with the following command:
Code Block | ||||
---|---|---|---|---|
| ||||
git clone git://github.com/floodlight/oftest |
...
Code Block | ||||
---|---|---|---|---|
| ||||
# git clone git://github.com/floodlight/oftest # cd oftest # make -C tools/munger Make sure the switch you want to test is running -- see (4) below for the reference switch example. # ./oft --list # sudo ./oft --test-spec=Echo # sudo ./oft --verbose --log-file="" # sudo ./oft --test-spec=<mod> --platform=remote --host=... |
Longer Start
- Pre-requisites:
- An OF switch instance to test (see 4 below)
- Root privilege on host running oft
- Switch running OpenFlow 1.0 and attempting to connect
to a controller on the machine running oft. - Python 2.5 or 2.6. You can run platforms using eth interfaces
with Python 2.4. Python 2.7 may work. - oftest checked out (called <oftest> here)
- scapy installed: http://www.secdev.org/projects/scapy/
'sudo apt-get install scapy' should work on Debian. - pypcap installed: http://code.google.com/p/pypcap/ (optional)
'sudo apt-get install python-pypcap' should work on Debian.
Tests using VLAN tags may fail without pypcap. - tcpdump installed (optional, but scapy will complain if it's
not there) - Doxygen and doxypy for document generation (optional)
- lint for source checking (optional)
- Build the OpenFlow Python message classes
Important: The OF version used by the controller is based on
the file in <oftest>/tools/pylibopenflow/include/openflow.h
This is currently the 1.0 release file.
make -C <oftest>/tools/munger
This places files in <oftest>/src/python/oftest/src. - Edit configuration if necessary
Local platforms work with veth interface pairs and default to
four ports. You can adjust this a bit with the command line
parameters port_count, base_of_port and base_if_index.
Starting from remote.py as a simple example, you can add your
own <platform>.py file and then have it imported with
--platform=<platform> on the command line. This is meant to
allow you to test remote switches attempting to connect to a
controller on a network accessible to the test host. - Start the switch to test
The switch must be running and actively attempting to
connect to a controller on the test host at the port number
used by oft (6633 by default, or specified as --port=<n> as
an argument to oft).
If you're new to the test environment and want to check its
sanity, you can do the following. This requires that
your host kernel supports virtual ethernet interfaces. This
is best done in a window separate from where you will run oft.
A. Check out openflow (preferably at the same level as oftest):
git clone git://openflowswitch.org/openflow.git
B. cd openflow; ./boot.sh; ./configure; make
C. cd ../oftest
D. Run the switch startup script:
sudo ./run_switch.py; Now you can run oft (see below).
E. Use --help to see command line switches. If you use a port
number other than the default, make sure you use the same
one for the switch as for oft.
F. Use control-C to terminate the switch daemons.
G. To clean up the virtual ethernet interfaces, use
sudo rmmod veth
New tools allow you to run an OVS instance as well. See
oftest/tools/ovs-ctl. You will need to install a version of
openvswitch. See http://openvswitch.org/. - Run oft
See Warning above; requires sudo to control the dataplane
...