Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 1 | Data Plane Testing |
| 2 | ****************** |
| 3 | |
| 4 | OFTest Overview |
Charles Chan | 8d63fa0 | 2019-09-17 13:25:44 -0700 | [diff] [blame] | 5 | =============== |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 6 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 7 | The oftest framework consists of a test server connected to a target switch |
| 8 | through an OpenFlow channel and directly to the data plane ports of the OF |
| 9 | switch. |
| 10 | |
| 11 | After programming the switch, oftest inserts packets in the data plane and |
| 12 | verifies if the output is as expected. |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 13 | |
| 14 | .. image:: ../images/testing-oftest.png |
| 15 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 16 | We recommend using a server connected to a management network, a switch |
| 17 | connected to the same management network, and then a **minimum of 2 ports |
| 18 | directly connected between the server and the switch**. |
| 19 | |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 20 | A few tests will fail if you have less than 3 ports. |
| 21 | |
Charles Chan | 8d63fa0 | 2019-09-17 13:25:44 -0700 | [diff] [blame] | 22 | OFTest Setup |
| 23 | ============ |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 24 | |
Jon Hall | 98006ff | 2021-06-23 13:48:14 -0700 | [diff] [blame^] | 25 | To install OFTEST on Ubuntu, type the following: |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 26 | |
| 27 | .. code-block:: console |
| 28 | |
Charles Chan | 8299f07 | 2019-09-23 11:32:26 -0700 | [diff] [blame] | 29 | $ sudo apt-get install python python-pip python-dev python-lxml libffi-dev libssl-dev -y |
| 30 | $ sudo pip install cryptography |
| 31 | $ sudo pip install ncclient |
| 32 | $ sudo pip install scapy pycrypto |
| 33 | $ sudo apt-get install python-ecdsa git |
| 34 | $ git clone https://gerrit.opencord.org/fabric-oftest |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 35 | |
| 36 | Now let's configure the switch and point it to the test server. |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 37 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 38 | It can be done in the same way as connecting the switch to any controller. |
| 39 | |
| 40 | See `Connect Switch to Controller |
| 41 | <../installation.html#connect-switch-to-controller>`_ for more details. |
| 42 | |
| 43 | Assuming that you plugged the ports ``12`` and ``24`` of the switch to |
| 44 | interfaces ``eth1`` and ``eth2`` of the server, respectively, then the |
| 45 | following command can tell you if everything is working. |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 46 | |
| 47 | .. code-block:: console |
| 48 | |
Charles Chan | 8299f07 | 2019-09-23 11:32:26 -0700 | [diff] [blame] | 49 | $ cd oftest |
| 50 | $ sudo ./oft -V1.3 --test-dir=ofdpa flows.PacketInArp -i 12@eth1 -i 24@eth2 |
| 51 | WARNING: No route found for IPv6 destination :: (no default route?) |
| 52 | flows.PacketInArp ... ok |
| 53 | ---------------------------------------------------------------------- |
| 54 | Ran 1 test in 4.044s |
| 55 | OK |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 56 | |
| 57 | Run Tests |
Charles Chan | 8d63fa0 | 2019-09-17 13:25:44 -0700 | [diff] [blame] | 58 | ========= |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 59 | |
| 60 | The command below should give you the following result: |
| 61 | |
| 62 | .. code-block:: console |
| 63 | |
Charles Chan | 8299f07 | 2019-09-23 11:32:26 -0700 | [diff] [blame] | 64 | $ sudo ./oft -V1.3 --test-dir=ofdpa flows -i 12@eth1 -i 24@eth2 |
| 65 | flows.ArpNL2 ... FAIL |
| 66 | flows.L2FloodQinQ ... ok |
| 67 | flows.L2FloodTagged ... ok |
| 68 | flows.L2FloodTaggedUnknownSrc ... ok |
| 69 | flows.L2UnicastTagged ... ok |
| 70 | flows.L3McastToL2 ... FAIL |
| 71 | flows.L3McastToL3 ... FAIL |
| 72 | flows.L3McastToVPN ... FAIL |
| 73 | flows.L3UcastTagged ... ok |
| 74 | flows.L3VPNMPLS ... ok |
| 75 | flows.L3VPN_32 ... FAIL |
| 76 | flows.MPLSBUG ... ok |
| 77 | flows.MplsTermination ... FAIL |
| 78 | flows.Mtu1500 ... ok |
| 79 | flows.Mtu4000 ... ERROR |
| 80 | flows.PacketInArp ... ok |
| 81 | flows.PacketInSrcMacMiss ... FAIL |
| 82 | flows.PacketInUDP ... ok |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 83 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 84 | For example, in this case, all the multicast failed because we don't have three |
| 85 | ports, the test L3VPN failed as well, and that is a bug of the current build. |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 86 | The **PacketInSrcMac** Miss failed because Mac learning is not enabled. |
| 87 | |
| 88 | .. note:: |
Charles Chan | 8299f07 | 2019-09-23 11:32:26 -0700 | [diff] [blame] | 89 | Expected test results can be found in https://github.com/opencord/fabric-oftest/blob/master/README.md |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 90 | |
| 91 | .. tip:: |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 92 | OFTest can't successfully delete all groups using an OF message, because of |
| 93 | that some tests interfere with others. |
Charles Chan | cc71f62 | 2019-09-17 11:27:56 -0700 | [diff] [blame] | 94 | |
Zack Williams | d63d35b | 2020-06-23 14:12:46 -0700 | [diff] [blame] | 95 | If the results seem suspicious, **erase the flow tables and group tables** |
| 96 | and run the test alone. |