]> git.proxmox.com Git - mirror_ovs.git/blame - tests/dpif-netdev.at
lib/odp-util: Skip ignored fields when parsing and formatting.
[mirror_ovs.git] / tests / dpif-netdev.at
CommitLineData
9c4044a5
JS
1AT_BANNER([dpif-netdev])
2
3# Strips out uninteresting parts of flow output, as well as parts
4# that vary from one run to another (e.g., timing and bond actions).
5m4_define([STRIP_XOUT], [[sed '
6 s/used:[0-9]*\.[0-9]*/used:0.0/
7 s/actions:.*/actions: <del>/
8 s/packets:[0-9]*/packets:0/
9 s/bytes:[0-9]*/bytes:0/
10' | sort]])
11m4_define([FILTER_FLOW_INSTALL], [[
623540e4
EJ
12grep 'flow_add' | sed '
13 s/.*flow_add: //
9c4044a5
JS
14' | sort | uniq]])
15m4_define([FILTER_FLOW_DUMP], [[
16grep 'flow_dump ' | sed '
17 s/.*flow_dump //
18 s/used:[0-9]*\.[0-9]*/used:0.0/
19' | sort | uniq]])
1ffd16af 20m4_define([STRIP_METADATA], [[sed 's/metadata=0x[0-9a-f]*/metadata=0x0/']])
9c4044a5
JS
21
22AT_SETUP([dpif-netdev - dummy interface])
23# Create br0 with interfaces p1 and p7
24# and br1 with interfaces p2 and p8
25# with p1 and p2 connected via unix domain socket
26OVS_VSWITCHD_START(
27 [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \
28 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
29 add-br br1 -- \
30 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
31 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
32 fail-mode=secure -- \
33 add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \
34 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
623540e4 35AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9c4044a5
JS
36
37AT_CHECK([ovs-ofctl add-flow br0 action=normal])
38AT_CHECK([ovs-ofctl add-flow br1 action=normal])
39ovs-appctl time/stop
40ovs-appctl time/warp 5000
41AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
42AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
43ovs-appctl time/warp 100
44sleep 1 # wait for forwarders process packets
45
46AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
623540e4
EJ
47recirc_id=0,skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
48recirc_id=0,skb_priority=0,ip,in_port=2,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
49recirc_id=0,skb_priority=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
50recirc_id=0,skb_priority=0,ip,in_port=8,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
9c4044a5
JS
51])
52
53OVS_VSWITCHD_STOP
54AT_CLEANUP
b10d46a6
JS
55
56AT_SETUP([dpif-netdev - miss upcall key matches flow_install])
57OVS_VSWITCHD_START(
58 [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock
59 set bridge br0 datapath-type=dummy other-config:datapath-id=1234 \
60 fail-mode=secure])
623540e4 61AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
b10d46a6
JS
62
63AT_CHECK([ovs-ofctl add-flow br0 action=normal])
64AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
65sleep 1
66
67AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl
68skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
69])
70AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
623540e4 71recirc_id=0,skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
b10d46a6
JS
72])
73
74# Now, the same again without megaflows.
75AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
76])
77AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
78sleep 1
79
80AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl
81skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
82])
83AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
623540e4
EJ
84pkt_mark=0,recirc_id=0,skb_priority=0,icmp,tun_id=0,tun_src=0.0.0.0,tun_dst=0.0.0.0,tun_tos=0,tun_ttl=0,,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,mpls_label=0,mpls_tc=0,mpls_ttl=0,mpls_bos=0,mpls_lse1=0,mpls_lse2=0,icmp_type=8,icmp_code=0, actions: <del>
85recirc_id=0,skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
b10d46a6
JS
86])
87
88OVS_VSWITCHD_STOP
89AT_CLEANUP
90
91AT_SETUP([dpif-netdev - miss upcall key matches flow_dump])
92OVS_VSWITCHD_START(
93 [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock
94 set bridge br0 datapath-type=dummy other-config:datapath-id=1234 \
95 fail-mode=secure])
623540e4 96AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
b10d46a6
JS
97
98AT_CHECK([ovs-ofctl add-flow br0 action=normal])
99AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
100sleep 1
101
102AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl
103skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
104])
105AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | STRIP_XOUT], [0], [dnl
2d18eae8 106skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: <del>
b10d46a6
JS
107])
108
109# Now, the same again without megaflows.
110AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
111])
112AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
113sleep 1
114
115AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl
116skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
117])
118AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | STRIP_XOUT], [0], [dnl
119skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:0, bytes:0, used:never, actions: <del>
2d18eae8 120skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: <del>
b10d46a6
JS
121])
122
123OVS_VSWITCHD_STOP
124AT_CLEANUP