blob: b069afb6673b1790d039f68f18f44d29751e76a1 [file] [log] [blame]
Dan Talaycof7dae842010-02-19 11:50:02 -08001OpenFlow Testing Framework
2February, 2010
3
4Warning
5+++++++
6
7This is still experimental and it requires root privilege to
8control the dataplane ports. As a consequence, there are
9some serious risks to the machine on which this is running.
10Use caution.
11
12Quick Start
13+++++++++++
14
15 1. Pre-requisites:
16 * Python 2.5 (or so)
17 * oftest checked out (called <oftest> here)
18 * scapy installed: http://www.secdev.org/projects/scapy/
19 * Doxygen and doxypy for document generation (optional)
20 * lint for source checking (optional)
21
22 2. Build the OpenFlow Python message classes
Dan Talaycoc4747962010-02-19 12:29:17 -080023
24 Important: The OF version used by the controller is based on
25 the file in <oftest>/tools/pylibopenflow/include/openflow.h
26 This is currently the 1.0 release file.
27
Dan Talaycof7dae842010-02-19 11:50:02 -080028 * cd <oftest>/tools/munger
29 * make
30 This places files in <oftest>/src/python/oftest/src
31
32 3. Install with setup (currently not required)
Dan Talayco673e0852010-03-06 23:09:23 -080033 * make install
34 This runs setuptools on the generated source. It requires
35 that setuptools be installed and the user have sudo rights.
Dan Talaycof7dae842010-02-19 11:50:02 -080036
37 4. Edit configuration
Dan Talayco673e0852010-03-06 23:09:23 -080038 Starting from remote.py as a simple example, you can add your
39 own <platform>.py file and then have it imported with
40 --platform=<platform> on the command line.
Dan Talaycof7dae842010-02-19 11:50:02 -080041
42 5. Start the switch to test
43 The switch must be running and actively attempting to
44 connect to the controller at the host/port specified above.
45
Dan Talayco673e0852010-03-06 23:09:23 -080046 6. Run oft
47 See Warning above; requires sudo to control the dataplane
Dan Talaycof7dae842010-02-19 11:50:02 -080048 * cd <oftest>/tests
Dan Talayco673e0852010-03-06 23:09:23 -080049 * sudo ./oft --help
Dan Talaycof7dae842010-02-19 11:50:02 -080050
51Overview
52++++++++
53
54 The directory structure is currently:
55
56 <oftest>
57 `
58 |-- doc
59 |-- src
60 | `-- python
61 | `-- oftest
62 |-- tests
63 `-- tools
64 |-- munger
65 `-- pylibopenflow
66
67 The tools directory is what processes the OpenFlow header
68 files to produce Python classes representing OpenFlow messages.
69 The results are placed in src/python/oftest and currently
70 include:
71
72 message.py: The main API providing OF message classes
73 error.py: Subclasses for error messages
74 action.py: Subclasses for action specification
75 cstruct.py: Direct representation of C structures in Python
76 class_maps.py: Addition info about C structures
77
78 In addition, the following Python files are present in
79 src/python/oftest:
80
Dan Talaycof7dae842010-02-19 11:50:02 -080081 controller.py: The controller representation
82 dataplane.py: The dataplane representation
83 action_list.py: Action list class
84 netutils.py: e.g., set promisc on sockets
85 ofutils.py: Utilities related to OpenFlow messages
Dan Talayco60a8d7a2010-03-03 15:20:59 -080086 oft_assert.py: Test framework level assertion
Dan Talaycof7dae842010-02-19 11:50:02 -080087
Dan Talayco60a8d7a2010-03-03 15:20:59 -080088 Tests are run from the tests directory. The file oft is the
89 top level entry point for tests. Try ./oft --help for some more.
Dan Talaycof7dae842010-02-19 11:50:02 -080090
91
92Other Info
93++++++++++
94
95 * Build doc with
96 + cd <oftest>/tools/munger
97 + make doc
98 Places the results in <oftest>/doc/html
99
100 * Run lint on sources
101 + cd <oftest>/tools/munger
102 + make lint
103 Places results in <oftest>/lint/*.log
104 The file controller.log currently has some errors indicated
105
106
107To Do
108+++++
109
Dan Talayco60a8d7a2010-03-03 15:20:59 -0800110 * Need to have an overview of the components of the test, how they
111 connect and how they are managed by the test framework.
Dan Talaycof7dae842010-02-19 11:50:02 -0800112 * See the Regression Test component on trac:
113 http://www.openflowswitch.org/bugs/openflow
114 http://www.openflowswitch.org/bugs/openflow/query?component=Regression+test+suite
115
Dan Talaycoc4747962010-02-19 12:29:17 -0800116 * Make the framework work with OF versions other than 1.0?
117