Dan Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 1 | OpenFlow Testing Framework |
| 2 | February, 2010 |
| 3 | |
| 4 | Warning |
| 5 | +++++++ |
| 6 | |
| 7 | This is still experimental and it requires root privilege to |
| 8 | control the dataplane ports. As a consequence, there are |
| 9 | some serious risks to the machine on which this is running. |
| 10 | Use caution. |
| 11 | |
| 12 | Quick 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 Talayco | c474796 | 2010-02-19 12:29:17 -0800 | [diff] [blame] | 23 | |
| 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 28 | * 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 Talayco | 673e085 | 2010-03-06 23:09:23 -0800 | [diff] [blame] | 33 | * make install |
| 34 | This runs setuptools on the generated source. It requires |
| 35 | that setuptools be installed and the user have sudo rights. |
Dan Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 36 | |
| 37 | 4. Edit configuration |
Dan Talayco | 673e085 | 2010-03-06 23:09:23 -0800 | [diff] [blame] | 38 | 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 41 | |
| 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 Talayco | 673e085 | 2010-03-06 23:09:23 -0800 | [diff] [blame] | 46 | 6. Run oft |
| 47 | See Warning above; requires sudo to control the dataplane |
Dan Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 48 | * cd <oftest>/tests |
Dan Talayco | 673e085 | 2010-03-06 23:09:23 -0800 | [diff] [blame] | 49 | * sudo ./oft --help |
Dan Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 50 | |
| 51 | Overview |
| 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 81 | 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 Talayco | 60a8d7a | 2010-03-03 15:20:59 -0800 | [diff] [blame] | 86 | oft_assert.py: Test framework level assertion |
Dan Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 87 | |
Dan Talayco | 60a8d7a | 2010-03-03 15:20:59 -0800 | [diff] [blame] | 88 | 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 90 | |
| 91 | |
| 92 | Other 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 | |
| 107 | To Do |
| 108 | +++++ |
| 109 | |
Dan Talayco | 60a8d7a | 2010-03-03 15:20:59 -0800 | [diff] [blame] | 110 | * 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 112 | * 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 Talayco | c474796 | 2010-02-19 12:29:17 -0800 | [diff] [blame] | 116 | * Make the framework work with OF versions other than 1.0? |
| 117 | |