blob: d718f0a2010cb8c9fdf730b44bb9a16e47d596a9 [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)
33 * TBD
34
35 4. Edit configuration
36 Edit <oftest>/src/python/oftest/oft_config.py. The only
37 important variables right now are:
38
39 # The platform targetted; currently ignored outside this file
40 platform = <string>
41
42 # The association of OF port number to interface name
43 interface_ofport_map = {
44 <of_port_number> : <os_interface_name>,
45 ...
46 }
47 controller_port = <port number on which to listen>
48 controller_host = <ip address on which to listen>
49 debug_level_default = <desired debug level>
50
51 5. Start the switch to test
52 The switch must be running and actively attempting to
53 connect to the controller at the host/port specified above.
54
55 6. Run basic.py
56 See Warning above
57 * cd <oftest>/tests
58 * sudo python basic.py
59
60
61Overview
62++++++++
63
64 The directory structure is currently:
65
66 <oftest>
67 `
68 |-- doc
69 |-- src
70 | `-- python
71 | `-- oftest
72 |-- tests
73 `-- tools
74 |-- munger
75 `-- pylibopenflow
76
77 The tools directory is what processes the OpenFlow header
78 files to produce Python classes representing OpenFlow messages.
79 The results are placed in src/python/oftest and currently
80 include:
81
82 message.py: The main API providing OF message classes
83 error.py: Subclasses for error messages
84 action.py: Subclasses for action specification
85 cstruct.py: Direct representation of C structures in Python
86 class_maps.py: Addition info about C structures
87
88 In addition, the following Python files are present in
89 src/python/oftest:
90
Dan Talaycof7dae842010-02-19 11:50:02 -080091 controller.py: The controller representation
92 dataplane.py: The dataplane representation
93 action_list.py: Action list class
94 netutils.py: e.g., set promisc on sockets
95 ofutils.py: Utilities related to OpenFlow messages
Dan Talayco60a8d7a2010-03-03 15:20:59 -080096 oft_assert.py: Test framework level assertion
Dan Talaycof7dae842010-02-19 11:50:02 -080097
Dan Talayco60a8d7a2010-03-03 15:20:59 -080098 Tests are run from the tests directory. The file oft is the
99 top level entry point for tests. Try ./oft --help for some more.
Dan Talaycof7dae842010-02-19 11:50:02 -0800100
101
102Other Info
103++++++++++
104
105 * Build doc with
106 + cd <oftest>/tools/munger
107 + make doc
108 Places the results in <oftest>/doc/html
109
110 * Run lint on sources
111 + cd <oftest>/tools/munger
112 + make lint
113 Places results in <oftest>/lint/*.log
114 The file controller.log currently has some errors indicated
115
116
117To Do
118+++++
119
Dan Talayco60a8d7a2010-03-03 15:20:59 -0800120 * Need to have an overview of the components of the test, how they
121 connect and how they are managed by the test framework.
Dan Talaycof7dae842010-02-19 11:50:02 -0800122 * See the Regression Test component on trac:
123 http://www.openflowswitch.org/bugs/openflow
124 http://www.openflowswitch.org/bugs/openflow/query?component=Regression+test+suite
125
Dan Talaycoc4747962010-02-19 12:29:17 -0800126 * Make the framework work with OF versions other than 1.0?
127