]> git.proxmox.com Git - ovs.git/blob - tests/system-offloads-traffic.at
tests: Fix sparse error on test-ovn.c
[ovs.git] / tests / system-offloads-traffic.at
1 AT_BANNER([datapath offloads])
2
3 # DUMP_CLEAN_SORTED([])
4 #
5 # Normilizes output ports, recirc_id, packets and macs.
6 #
7 m4_define([DUMP_CLEAN_SORTED], [sed -e 's/used:[[0-9]].[[0-9]]*s/used:0.001s/;s/eth(src=[[a-z0-9:]]*,dst=[[a-z0-9:]]*)/eth(macs)/;s/actions:[[0-9,]]*/actions:output/;s/recirc_id(0),//' | sort])
8
9 AT_SETUP([offloads - ping between two ports - offloads disabled])
10 OVS_TRAFFIC_VSWITCHD_START()
11
12 AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
13
14 ADD_NAMESPACES(at_ns0, at_ns1)
15
16 ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
17 ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
18
19 NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
20 10 packets transmitted, 10 received, 0% packet loss, time 0ms
21 ])
22
23 AT_CHECK([ovs-appctl dpctl/dump-flows | grep "eth_type(0x0800)" | DUMP_CLEAN_SORTED], [0], [dnl
24 in_port(2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:882, used:0.001s, actions:output
25 in_port(3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:882, used:0.001s, actions:output
26 ])
27
28 AT_CHECK([ovs-appctl dpctl/dump-flows type=ovs | grep "eth_type(0x0800)" | DUMP_CLEAN_SORTED], [0], [dnl
29 in_port(2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:882, used:0.001s, actions:output
30 in_port(3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:882, used:0.001s, actions:output
31 ])
32
33 AT_CHECK([ovs-appctl dpctl/dump-flows type=offloaded], [0], [])
34
35 OVS_TRAFFIC_VSWITCHD_STOP
36 AT_CLEANUP
37
38
39 AT_SETUP([offloads - ping between two ports - offloads enabled])
40 OVS_TRAFFIC_VSWITCHD_START()
41
42 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:hw-offload=true])
43 AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
44
45 ADD_NAMESPACES(at_ns0, at_ns1)
46
47 ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
48 ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
49 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [ignore])
50
51 NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
52 10 packets transmitted, 10 received, 0% packet loss, time 0ms
53 ])
54
55 AT_CHECK([ovs-appctl dpctl/dump-flows | grep "eth_type(0x0800)" | DUMP_CLEAN_SORTED], [0], [dnl
56 in_port(2),eth(macs),eth_type(0x0800), packets:9, bytes:756, used:0.001s, actions:output
57 in_port(3),eth(macs),eth_type(0x0800), packets:9, bytes:756, used:0.001s, actions:output
58 ])
59
60 AT_CHECK([ovs-appctl dpctl/dump-flows type=ovs | grep "eth_type(0x0800)" | DUMP_CLEAN_SORTED], [0], [])
61
62 AT_CHECK([ovs-appctl dpctl/dump-flows type=offloaded | grep "eth_type(0x0800)" | DUMP_CLEAN_SORTED], [0], [dnl
63 in_port(2),eth(macs),eth_type(0x0800), packets:9, bytes:756, used:0.001s, actions:output
64 in_port(3),eth(macs),eth_type(0x0800), packets:9, bytes:756, used:0.001s, actions:output
65 ])
66
67 OVS_TRAFFIC_VSWITCHD_STOP('/.*/d')
68 AT_CLEANUP