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 |
| 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 | |
| 42 | Important 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 |
Rich Lane | 6242d9f | 2013-01-06 17:35:39 -0800 | [diff] [blame] | 47 | regenerate the OpenFlow message classes. Make sure you |
| 48 | commit the generated code. |
Rich Lane | ea5060d | 2013-01-06 13:59:00 -0800 | [diff] [blame] | 49 | |
| 50 | Adding Your Own Test Cases |
| 51 | ++++++++++++++++++++++++++ |
| 52 | |
| 53 | Check the online tutorial: |
| 54 | http://openflow.org/wk/index.php/OFTestTutorial |
| 55 | |
| 56 | It's suggested to use basic.py as example code for writing new tests. |
| 57 | |
| 58 | You can: |
| 59 | |
| 60 | * Add cases to an existing file |
| 61 | * Add a new file |
| 62 | |
| 63 | If you add cases to an existing file, each case should be its own |
| 64 | class. It must inherit from unittest.TestCase or one of its |
| 65 | derivatives. Most tests will inherit from oftest.base_tests.SimpleDataPlane. |
| 66 | |
| 67 | CONVENTIONS: |
| 68 | |
| 69 | The first line of the doc string for a file and for a test class is |
| 70 | displayed in the list command. Please keep it clear and under 50 |
| 71 | characters. |
| 72 | |
| 73 | Submitting Patches |
| 74 | ++++++++++++++++++ |
| 75 | |
| 76 | Send a pull request on GitHub to floodlight/oftest. |
| 77 | |
| 78 | Other Info |
| 79 | ++++++++++ |
| 80 | |
| 81 | * Build doc with |
| 82 | + cd <oftest>/tools/munger |
| 83 | + make doc |
| 84 | Places the results in <oftest>/doc/html |
| 85 | If you have problems, check the install location doxypy.py and |
| 86 | that it is set correctly in <oftest>/doc/Doxyfile |
| 87 | |
| 88 | * Run lint on sources |
| 89 | + cd <oftest>/tools/munger |
| 90 | + make lint |
| 91 | Places results in <oftest>/lint/*.log |
| 92 | The file controller.log currently has some errors indicated |
| 93 | |
| 94 | To Do |
| 95 | +++++ |
| 96 | |
| 97 | * Need to have an overview of the components of the test, how they |
| 98 | connect and how they are managed by the test framework. |
| 99 | * See the Regression Test component on trac: |
| 100 | http://www.openflowswitch.org/bugs/openflow |
| 101 | http://www.openflowswitch.org/bugs/openflow/query?component=Regression+test+suite |
| 102 | |
| 103 | * Make the framework work with OF versions other than 1.0? |