blob: 9dd9e91726461a4a9b1aa70a89abb60221180d78 [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
Zack Williamsd63d35b2020-06-23 14:12:46 -07007The oftest framework consists of a test server connected to a target switch
8through an OpenFlow channel and directly to the data plane ports of the OF
9switch.
10
11After programming the switch, oftest inserts packets in the data plane and
12verifies if the output is as expected.
Charles Chancc71f622019-09-17 11:27:56 -070013
14.. image:: ../images/testing-oftest.png
15
Zack Williamsd63d35b2020-06-23 14:12:46 -070016We recommend using a server connected to a management network, a switch
17connected to the same management network, and then a **minimum of 2 ports
18directly connected between the server and the switch**.
19
Charles Chancc71f622019-09-17 11:27:56 -070020A few tests will fail if you have less than 3 ports.
21
Charles Chan8d63fa02019-09-17 13:25:44 -070022OFTest Setup
23============
Charles Chancc71f622019-09-17 11:27:56 -070024
Jon Hall98006ff2021-06-23 13:48:14 -070025To install OFTEST on Ubuntu, type the following:
Charles Chancc71f622019-09-17 11:27:56 -070026
27.. code-block:: console
28
Charles Chan8299f072019-09-23 11:32:26 -070029 $ 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 Chancc71f622019-09-17 11:27:56 -070035
36Now let's configure the switch and point it to the test server.
Charles Chancc71f622019-09-17 11:27:56 -070037
Zack Williamsd63d35b2020-06-23 14:12:46 -070038It can be done in the same way as connecting the switch to any controller.
39
40See `Connect Switch to Controller
41<../installation.html#connect-switch-to-controller>`_ for more details.
42
43Assuming that you plugged the ports ``12`` and ``24`` of the switch to
44interfaces ``eth1`` and ``eth2`` of the server, respectively, then the
45following command can tell you if everything is working.
Charles Chancc71f622019-09-17 11:27:56 -070046
47.. code-block:: console
48
Charles Chan8299f072019-09-23 11:32:26 -070049 $ 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 Chancc71f622019-09-17 11:27:56 -070056
57Run Tests
Charles Chan8d63fa02019-09-17 13:25:44 -070058=========
Charles Chancc71f622019-09-17 11:27:56 -070059
60The command below should give you the following result:
61
62.. code-block:: console
63
Charles Chan8299f072019-09-23 11:32:26 -070064 $ 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 Chancc71f622019-09-17 11:27:56 -070083
Zack Williamsd63d35b2020-06-23 14:12:46 -070084For example, in this case, all the multicast failed because we don't have three
85ports, the test L3VPN failed as well, and that is a bug of the current build.
Charles Chancc71f622019-09-17 11:27:56 -070086The **PacketInSrcMac** Miss failed because Mac learning is not enabled.
87
88.. note::
Charles Chan8299f072019-09-23 11:32:26 -070089 Expected test results can be found in https://github.com/opencord/fabric-oftest/blob/master/README.md
Charles Chancc71f622019-09-17 11:27:56 -070090
91.. tip::
Zack Williamsd63d35b2020-06-23 14:12:46 -070092 OFTest can't successfully delete all groups using an OF message, because of
93 that some tests interfere with others.
Charles Chancc71f622019-09-17 11:27:56 -070094
Zack Williamsd63d35b2020-06-23 14:12:46 -070095 If the results seem suspicious, **erase the flow tables and group tables**
96 and run the test alone.