blob: 1d8307e573a5e3808e1418d4cecb64f2b19efb02 [file] [log] [blame]
Charles Chancc71f622019-09-17 11:27:56 -07001Data Plane Testing
2******************
3
4OFTest Overview
Charles Chan8d63fa02019-09-17 13:25:44 -07005===============
Charles Chancc71f622019-09-17 11:27:56 -07006
7The 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.
8After 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
12We 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**.
13A few tests will fail if you have less than 3 ports.
14
Charles Chan8d63fa02019-09-17 13:25:44 -070015OFTest Setup
16============
Charles Chancc71f622019-09-17 11:27:56 -070017
18To 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
29Now let's configure the switch and point it to the test server.
30It can be done in the same way as connecting the switch to any controller.
31See `Connect Switch to Controller <../installation.html#connect-switch-to-controller>`_ for more details.
32
33Assuming 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
45Run Tests
Charles Chan8d63fa02019-09-17 13:25:44 -070046=========
Charles Chancc71f622019-09-17 11:27:56 -070047
48The 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
72For 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.
73The **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