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