blob: ff391e40617aa21b68509c6c55140138ade9601e [file] [log] [blame]
Rich Laneea5060d2013-01-06 13:59:00 -08001Overview
2++++++++
3
4 The directory structure is currently:
5
6 <oftest>
7 `
8 |-- oft
9 |-- doc
10 |-- src
11 | `-- python
12 | `-- oftest
13 |-- tests
14 | `-- test cases
15 `-- tools
16 |-- munger
17 `-- pylibopenflow
18
19 The tools directory is what processes the OpenFlow header
20 files to produce Python classes representing OpenFlow messages.
21 The results are placed in src/python/oftest and currently
22 include:
23
24 message.py: The main API providing OF message classes
25 error.py: Subclasses for error messages
26 action.py: Subclasses for action specification
27 cstruct.py: Direct representation of C structures in Python
28 class_maps.py: Addition info about C structures
29
30 In addition, the following Python files are present in
31 src/python/oftest:
32
33 controller.py: The controller representation
34 dataplane.py: The dataplane representation
35 action_list.py: Action list class
36 netutils.py: e.g., set promisc on sockets
37 ofutils.py: Utilities related to OpenFlow messages
38 oft_assert.py: Test framework level assertion
39 testutils.py: Test utilities
40 base_tests.py: Base test classes
41
42Important Notes
43+++++++++++++++
44
45 1. If you change any of the code generation scripts in
46 tools/munger/scripts you must re-run make -C tools/munger to
47 regenerate the OpenFlow message classes.
48
49Adding Your Own Test Cases
50++++++++++++++++++++++++++
51
52 Check the online tutorial:
53 http://openflow.org/wk/index.php/OFTestTutorial
54
55 It's suggested to use basic.py as example code for writing new tests.
56
57 You can:
58
59 * Add cases to an existing file
60 * Add a new file
61
62 If you add cases to an existing file, each case should be its own
63 class. It must inherit from unittest.TestCase or one of its
64 derivatives. Most tests will inherit from oftest.base_tests.SimpleDataPlane.
65
66 CONVENTIONS:
67
68 The first line of the doc string for a file and for a test class is
69 displayed in the list command. Please keep it clear and under 50
70 characters.
71
72Submitting Patches
73++++++++++++++++++
74
75 Send a pull request on GitHub to floodlight/oftest.
76
77Other Info
78++++++++++
79
80 * Build doc with
81 + cd <oftest>/tools/munger
82 + make doc
83 Places the results in <oftest>/doc/html
84 If you have problems, check the install location doxypy.py and
85 that it is set correctly in <oftest>/doc/Doxyfile
86
87 * Run lint on sources
88 + cd <oftest>/tools/munger
89 + make lint
90 Places results in <oftest>/lint/*.log
91 The file controller.log currently has some errors indicated
92
93To Do
94+++++
95
96 * Need to have an overview of the components of the test, how they
97 connect and how they are managed by the test framework.
98 * See the Regression Test component on trac:
99 http://www.openflowswitch.org/bugs/openflow
100 http://www.openflowswitch.org/bugs/openflow/query?component=Regression+test+suite
101
102 * Make the framework work with OF versions other than 1.0?