Rich Lane | ea5060d | 2013-01-06 13:59:00 -0800 | [diff] [blame] | 1 | Overview |
| 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 |
Rich Lane | ea5060d | 2013-01-06 13:59:00 -0800 | [diff] [blame] | 16 | `-- pylibopenflow |
| 17 | |
| 18 | The tools directory is what processes the OpenFlow header |
| 19 | files to produce Python classes representing OpenFlow messages. |
| 20 | The results are placed in src/python/oftest and currently |
| 21 | include: |
| 22 | |
| 23 | message.py: The main API providing OF message classes |
| 24 | error.py: Subclasses for error messages |
| 25 | action.py: Subclasses for action specification |
| 26 | cstruct.py: Direct representation of C structures in Python |
| 27 | class_maps.py: Addition info about C structures |
| 28 | |
| 29 | In addition, the following Python files are present in |
| 30 | src/python/oftest: |
| 31 | |
| 32 | controller.py: The controller representation |
| 33 | dataplane.py: The dataplane representation |
| 34 | action_list.py: Action list class |
| 35 | netutils.py: e.g., set promisc on sockets |
| 36 | ofutils.py: Utilities related to OpenFlow messages |
| 37 | oft_assert.py: Test framework level assertion |
| 38 | testutils.py: Test utilities |
| 39 | base_tests.py: Base test classes |
| 40 | |
Rich Lane | ea5060d | 2013-01-06 13:59:00 -0800 | [diff] [blame] | 41 | Adding Your Own Test Cases |
| 42 | ++++++++++++++++++++++++++ |
| 43 | |
| 44 | Check the online tutorial: |
| 45 | http://openflow.org/wk/index.php/OFTestTutorial |
| 46 | |
| 47 | It's suggested to use basic.py as example code for writing new tests. |
| 48 | |
| 49 | You can: |
| 50 | |
| 51 | * Add cases to an existing file |
| 52 | * Add a new file |
| 53 | |
| 54 | If you add cases to an existing file, each case should be its own |
| 55 | class. It must inherit from unittest.TestCase or one of its |
| 56 | derivatives. Most tests will inherit from oftest.base_tests.SimpleDataPlane. |
| 57 | |
| 58 | CONVENTIONS: |
| 59 | |
| 60 | The first line of the doc string for a file and for a test class is |
| 61 | displayed in the list command. Please keep it clear and under 50 |
| 62 | characters. |
| 63 | |
| 64 | Submitting Patches |
| 65 | ++++++++++++++++++ |
| 66 | |
| 67 | Send a pull request on GitHub to floodlight/oftest. |
| 68 | |
Rich Lane | ea5060d | 2013-01-06 13:59:00 -0800 | [diff] [blame] | 69 | To Do |
| 70 | +++++ |
| 71 | |
| 72 | * Need to have an overview of the components of the test, how they |
| 73 | connect and how they are managed by the test framework. |
| 74 | * See the Regression Test component on trac: |
| 75 | http://www.openflowswitch.org/bugs/openflow |
| 76 | http://www.openflowswitch.org/bugs/openflow/query?component=Regression+test+suite |
| 77 | |
| 78 | * Make the framework work with OF versions other than 1.0? |