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 |
| 23 | * cd <oftest>/tools/munger |
| 24 | * make |
| 25 | This places files in <oftest>/src/python/oftest/src |
| 26 | |
| 27 | 3. Install with setup (currently not required) |
| 28 | * TBD |
| 29 | |
| 30 | 4. Edit configuration |
| 31 | Edit <oftest>/src/python/oftest/oft_config.py. The only |
| 32 | important variables right now are: |
| 33 | |
| 34 | # The platform targetted; currently ignored outside this file |
| 35 | platform = <string> |
| 36 | |
| 37 | # The association of OF port number to interface name |
| 38 | interface_ofport_map = { |
| 39 | <of_port_number> : <os_interface_name>, |
| 40 | ... |
| 41 | } |
| 42 | controller_port = <port number on which to listen> |
| 43 | controller_host = <ip address on which to listen> |
| 44 | debug_level_default = <desired debug level> |
| 45 | |
| 46 | 5. Start the switch to test |
| 47 | The switch must be running and actively attempting to |
| 48 | connect to the controller at the host/port specified above. |
| 49 | |
| 50 | 6. Run basic.py |
| 51 | See Warning above |
| 52 | * cd <oftest>/tests |
| 53 | * sudo python basic.py |
| 54 | |
| 55 | |
| 56 | Overview |
| 57 | ++++++++ |
| 58 | |
| 59 | The directory structure is currently: |
| 60 | |
| 61 | <oftest> |
| 62 | ` |
| 63 | |-- doc |
| 64 | |-- src |
| 65 | | `-- python |
| 66 | | `-- oftest |
| 67 | |-- tests |
| 68 | `-- tools |
| 69 | |-- munger |
| 70 | `-- pylibopenflow |
| 71 | |
| 72 | The tools directory is what processes the OpenFlow header |
| 73 | files to produce Python classes representing OpenFlow messages. |
| 74 | The results are placed in src/python/oftest and currently |
| 75 | include: |
| 76 | |
| 77 | message.py: The main API providing OF message classes |
| 78 | error.py: Subclasses for error messages |
| 79 | action.py: Subclasses for action specification |
| 80 | cstruct.py: Direct representation of C structures in Python |
| 81 | class_maps.py: Addition info about C structures |
| 82 | |
| 83 | In addition, the following Python files are present in |
| 84 | src/python/oftest: |
| 85 | |
| 86 | oft_config.py: The system configuration file |
| 87 | controller.py: The controller representation |
| 88 | dataplane.py: The dataplane representation |
| 89 | action_list.py: Action list class |
| 90 | netutils.py: e.g., set promisc on sockets |
| 91 | ofutils.py: Utilities related to OpenFlow messages |
| 92 | |
| 93 | |
| 94 | |
| 95 | Other Info |
| 96 | ++++++++++ |
| 97 | |
| 98 | * Build doc with |
| 99 | + cd <oftest>/tools/munger |
| 100 | + make doc |
| 101 | Places the results in <oftest>/doc/html |
| 102 | |
| 103 | * Run lint on sources |
| 104 | + cd <oftest>/tools/munger |
| 105 | + make lint |
| 106 | Places results in <oftest>/lint/*.log |
| 107 | The file controller.log currently has some errors indicated |
| 108 | |
| 109 | |
| 110 | To Do |
| 111 | +++++ |
| 112 | |
| 113 | * See the Regression Test component on trac: |
| 114 | http://www.openflowswitch.org/bugs/openflow |
| 115 | http://www.openflowswitch.org/bugs/openflow/query?component=Regression+test+suite |
| 116 | |