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) |
| 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 | |
| 61 | Overview |
| 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 91 | 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 Talayco | 60a8d7a | 2010-03-03 15:20:59 -0800 | [diff] [blame^] | 96 | oft_assert.py: Test framework level assertion |
Dan Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 97 | |
Dan Talayco | 60a8d7a | 2010-03-03 15:20:59 -0800 | [diff] [blame^] | 98 | 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 100 | |
| 101 | |
| 102 | Other 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 | |
| 117 | To Do |
| 118 | +++++ |
| 119 | |
Dan Talayco | 60a8d7a | 2010-03-03 15:20:59 -0800 | [diff] [blame^] | 120 | * 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 Talayco | f7dae84 | 2010-02-19 11:50:02 -0800 | [diff] [blame] | 122 | * 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 Talayco | c474796 | 2010-02-19 12:29:17 -0800 | [diff] [blame] | 126 | * Make the framework work with OF versions other than 1.0? |
| 127 | |