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 | |
| 91 | oft_config.py: The system configuration file |
| 92 | controller.py: The controller representation |
| 93 | dataplane.py: The dataplane representation |
| 94 | action_list.py: Action list class |
| 95 | netutils.py: e.g., set promisc on sockets |
| 96 | ofutils.py: Utilities related to OpenFlow messages |
| 97 | |
| 98 | |
| 99 | |
| 100 | Other Info |
| 101 | ++++++++++ |
| 102 | |
| 103 | * Build doc with |
| 104 | + cd <oftest>/tools/munger |
| 105 | + make doc |
| 106 | Places the results in <oftest>/doc/html |
| 107 | |
| 108 | * Run lint on sources |
| 109 | + cd <oftest>/tools/munger |
| 110 | + make lint |
| 111 | Places results in <oftest>/lint/*.log |
| 112 | The file controller.log currently has some errors indicated |
| 113 | |
| 114 | |
| 115 | To Do |
| 116 | +++++ |
| 117 | |
| 118 | * See the Regression Test component on trac: |
| 119 | http://www.openflowswitch.org/bugs/openflow |
| 120 | http://www.openflowswitch.org/bugs/openflow/query?component=Regression+test+suite |
| 121 | |
Dan Talayco | c474796 | 2010-02-19 12:29:17 -0800 | [diff] [blame] | 122 | * Make the framework work with OF versions other than 1.0? |
| 123 | |