~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to tests/tunnel.at

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
16
16
 
17
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
18
 
br0 (dummy@ovs-dummy):
19
 
        lookups: hit:0 missed:0
20
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
21
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
22
 
        br0 65534/100: (dummy)
23
 
        p1 1/1: (gre: remote_ip=1.1.1.1)
24
 
        p2 2/1: (gre: local_ip=2.2.2.2, remote_ip=1.1.1.1)
25
 
        p3 3/1: (gre: remote_ip=2.2.2.2)
 
17
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
18
                br0 65534/100: (dummy)
 
19
                p1 1/1: (gre: remote_ip=1.1.1.1)
 
20
                p2 2/1: (gre: local_ip=2.2.2.2, remote_ip=1.1.1.1)
 
21
                p3 3/1: (gre: remote_ip=2.2.2.2)
26
22
])
27
23
 
28
24
dnl remote_ip
29
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=1.2.3.4,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
25
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=1.2.3.4,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
30
26
AT_CHECK([tail -1 stdout], [0],
31
27
  [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
32
28
])
33
29
 
34
30
dnl local_ip, remote_ip
35
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
31
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
36
32
AT_CHECK([tail -1 stdout], [0],
37
33
  [Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
38
34
])
41
37
AT_CHECK([ovs-vsctl set Interface p2 type=gre options:local_ip=2.2.2.3 \
42
38
          options:df_default=false options:ttl=1 options:csum=true \
43
39
          -- set Interface p3 type=gre64])
44
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
45
 
br0 (dummy@ovs-dummy):
46
 
        lookups: hit:0 missed:0
47
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
48
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
49
 
        br0 65534/100: (dummy)
50
 
        p1 1/1: (gre: remote_ip=1.1.1.1)
51
 
        p2 2/1: (gre: csum=true, df_default=false, local_ip=2.2.2.3, remote_ip=1.1.1.1, ttl=1)
52
 
        p3 3/64: (gre64: remote_ip=2.2.2.2)
 
40
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
41
                br0 65534/100: (dummy)
 
42
                p1 1/1: (gre: remote_ip=1.1.1.1)
 
43
                p2 2/1: (gre: csum=true, df_default=false, local_ip=2.2.2.3, remote_ip=1.1.1.1, ttl=1)
 
44
                p3 3/64: (gre64: remote_ip=2.2.2.2)
53
45
])
54
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
46
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
55
47
AT_CHECK([tail -1 stdout], [0],
56
48
  [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
57
49
])
58
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.3,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
50
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.3,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
59
51
AT_CHECK([tail -1 stdout], [0],
60
52
  [Datapath actions: set(tunnel(tun_id=0x0,src=2.2.2.3,dst=1.1.1.1,tos=0x0,ttl=1,flags(csum))),1
61
53
])
62
54
 
63
55
dnl nonexistent tunnel
64
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=5.5.5.5,dst=6.6.6.6,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl
65
 
Invalid flow
 
56
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=5.5.5.5,dst=6.6.6.6,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl
 
57
Invalid datapath flow
66
58
ovs-appctl: ovs-vswitchd: server returned an error
67
59
])
68
60
 
69
 
OVS_VSWITCHD_STOP
 
61
OVS_VSWITCHD_STOP(["/receive tunnel port not found/d"])
70
62
AT_CLEANUP
71
63
 
72
64
AT_SETUP([tunnel - ECN decapsulation])
80
72
 
81
73
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
82
74
 
83
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
84
 
br0 (dummy@ovs-dummy):
85
 
        lookups: hit:0 missed:0
86
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
87
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
88
 
        br0 65534/100: (dummy)
89
 
        p1 1/1: (gre: remote_ip=1.1.1.1)
90
 
        p2 2/2: (dummy)
 
75
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
76
                br0 65534/100: (dummy)
 
77
                p1 1/1: (gre: remote_ip=1.1.1.1)
 
78
                p2 2/2: (dummy)
91
79
])
92
80
 
93
81
dnl Tunnel CE and encapsulated packet CE
94
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=3,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
82
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=3,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
95
83
AT_CHECK([tail -1 stdout], [0],
96
84
  [Datapath actions: 2
97
85
])
98
86
 
99
87
dnl Tunnel CE and encapsulated packet ECT(1)
100
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
88
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
101
89
AT_CHECK([tail -1 stdout], [0],
102
90
  [Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0x3,ttl=64,frag=no)),2
103
91
])
104
92
 
105
93
dnl Tunnel CE and encapsulated packet ECT(2)
106
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=2,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
94
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=2,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
107
95
AT_CHECK([tail -1 stdout], [0],
108
96
  [Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0x3,ttl=64,frag=no)),2
109
97
])
110
98
 
111
99
dnl Tunnel CE and encapsulated packet Non-ECT
112
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
100
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x3,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
113
101
AT_CHECK([tail -1 stdout], [0],
114
102
  [Datapath actions: drop
115
103
])
128
116
 
129
117
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
130
118
 
131
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
132
 
br0 (dummy@ovs-dummy):
133
 
        lookups: hit:0 missed:0
134
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
135
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
136
 
        br0 65534/100: (dummy)
137
 
        p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1)
138
 
        p2 2/2: (dummy)
 
119
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
120
                br0 65534/100: (dummy)
 
121
                p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1)
 
122
                p2 2/2: (dummy)
139
123
])
140
124
 
141
125
dnl Basic
142
 
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
126
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
143
127
AT_CHECK([tail -1 stdout], [0],
144
128
  [Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
145
129
])
146
130
 
147
131
dnl ECN
148
 
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
132
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=1,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
149
133
AT_CHECK([tail -1 stdout], [0],
150
134
  [Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df,key))),1
151
135
])
164
148
 
165
149
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
166
150
 
167
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
168
 
br0 (dummy@ovs-dummy):
169
 
        lookups: hit:0 missed:0
170
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
171
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
172
 
        br0 65534/100: (dummy)
173
 
        p1 1/1: (gre: remote_ip=1.1.1.1, tos=inherit, ttl=inherit)
174
 
        p2 2/2: (dummy)
 
151
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
152
                br0 65534/100: (dummy)
 
153
                p1 1/1: (gre: remote_ip=1.1.1.1, tos=inherit, ttl=inherit)
 
154
                p2 2/2: (dummy)
175
155
])
176
156
 
177
157
dnl Basic
178
 
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
158
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
179
159
AT_CHECK([tail -1 stdout], [0],
180
160
  [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x4,ttl=128,flags(df))),1
181
161
])
182
162
 
183
163
dnl ECN
184
 
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=5,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
164
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=5,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
185
165
AT_CHECK([tail -1 stdout], [0],
186
166
  [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x5,ttl=128,flags(df))),1
187
167
])
188
168
 
189
169
dnl non-IP
190
 
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18)'], [0], [stdout])
 
170
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18)'], [0], [stdout])
191
171
AT_CHECK([tail -1 stdout], [0],
192
172
  [Datapath actions: set(tunnel(tun_id=0x0,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df))),1
193
173
])
210
190
 
211
191
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
212
192
 
213
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
214
 
br0 (dummy@ovs-dummy):
215
 
        lookups: hit:0 missed:0
216
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
217
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
218
 
        br0 65534/100: (dummy)
219
 
        p1 1/1: (gre: key=flow, remote_ip=1.1.1.1)
220
 
        p2 2/1: (gre: key=flow, remote_ip=2.2.2.2)
221
 
        p3 3/1: (gre: key=flow, remote_ip=3.3.3.3)
222
 
        p4 4/1: (gre: key=flow, remote_ip=4.4.4.4)
 
193
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
194
                br0 65534/100: (dummy)
 
195
                p1 1/1: (gre: key=flow, remote_ip=1.1.1.1)
 
196
                p2 2/1: (gre: key=flow, remote_ip=2.2.2.2)
 
197
                p3 3/1: (gre: key=flow, remote_ip=3.3.3.3)
 
198
                p4 4/1: (gre: key=flow, remote_ip=4.4.4.4)
223
199
])
224
200
 
225
 
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
 
201
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
226
202
AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
227
203
set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
228
204
set(tunnel(tun_id=0x2,src=0.0.0.0,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,key))),1,dnl
246
222
 
247
223
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
248
224
 
249
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
250
 
br0 (dummy@ovs-dummy):
251
 
        lookups: hit:0 missed:0
252
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
253
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
254
 
        br0 65534/100: (dummy)
255
 
        p1 1/1: (gre: key=1, remote_ip=1.1.1.1)
256
 
        p2 2/1: (gre: in_key=2, out_key=3, remote_ip=1.1.1.1)
257
 
        p3 3/1: (gre: out_key=5, remote_ip=1.1.1.1)
258
 
])
259
 
 
260
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x1,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
261
 
AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
262
 
set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
263
 
set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
264
 
set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
265
 
])
266
 
 
267
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
268
 
AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
269
 
set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
270
 
set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
271
 
set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
272
 
])
273
 
 
274
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
225
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
226
                br0 65534/100: (dummy)
 
227
                p1 1/1: (gre: key=1, remote_ip=1.1.1.1)
 
228
                p2 2/1: (gre: in_key=2, out_key=3, remote_ip=1.1.1.1)
 
229
                p3 3/1: (gre: out_key=5, remote_ip=1.1.1.1)
 
230
])
 
231
 
 
232
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x1,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
233
AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
 
234
set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
 
235
set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
 
236
set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
 
237
])
 
238
 
 
239
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
240
AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
 
241
set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
 
242
set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
 
243
set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
 
244
])
 
245
 
 
246
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags()),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
275
247
AT_CHECK([tail -1 stdout], [0], [Datapath actions: dnl
276
248
set(tunnel(tun_id=0x5,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
277
249
set(tunnel(tun_id=0x1,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,dnl
278
250
set(tunnel(tun_id=0x3,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1
279
251
])
280
252
 
281
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0xf,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl
282
 
Invalid flow
 
253
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0xf,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [2], [ignore], [dnl
 
254
Invalid datapath flow
283
255
ovs-appctl: ovs-vswitchd: server returned an error
284
256
])
285
 
OVS_VSWITCHD_STOP
 
257
OVS_VSWITCHD_STOP(["/receive tunnel port not found/d"])
286
258
AT_CLEANUP
287
259
 
288
260
AT_SETUP([tunnel - key match])
302
274
 
303
275
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
304
276
 
305
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
306
 
br0 (dummy@ovs-dummy):
307
 
        lookups: hit:0 missed:0
308
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
309
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
310
 
        br0 65534/100: (dummy)
311
 
        p1 1/1: (gre: key=flow, remote_ip=1.1.1.1)
312
 
        p2 2/1: (gre: key=3, remote_ip=3.3.3.3)
313
 
        p3 3/3: (dummy)
314
 
        p4 4/4: (dummy)
315
 
        p5 5/5: (dummy)
 
277
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
278
                br0 65534/100: (dummy)
 
279
                p1 1/1: (gre: key=flow, remote_ip=1.1.1.1)
 
280
                p2 2/1: (gre: key=3, remote_ip=3.3.3.3)
 
281
                p3 3/3: (dummy)
 
282
                p4 4/4: (dummy)
 
283
                p5 5/5: (dummy)
316
284
])
317
285
 
318
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
286
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x2,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
319
287
AT_CHECK([tail -1 stdout], [0], [dnl
320
288
Datapath actions: 3
321
289
])
322
290
 
323
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x3,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
291
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
324
292
AT_CHECK([tail -1 stdout], [0], [dnl
325
293
Datapath actions: 4,3,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,5
326
294
])
327
295
 
328
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x3,src=3.3.3.3,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
296
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x3,src=3.3.3.3,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
329
297
AT_CHECK([tail -1 stdout], [0], [dnl
330
298
Datapath actions: 4,3,5
331
299
])
332
300
 
333
 
AT_CHECK([ovs-appctl ofproto/trace br0 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
 
301
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'tunnel(tun_id=0x0,src=1.1.1.1,dst=2.2.2.2,tos=0x0,ttl=64,flags(key)),in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
334
302
AT_CHECK([tail -1 stdout], [0], [dnl
335
303
        - Sends "packet-in" messages to the OpenFlow controller.
336
304
])
342
310
OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=vxlan \
343
311
                    options:remote_ip=1.1.1.1 ofport_request=1])
344
312
 
345
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
346
 
br0 (dummy@ovs-dummy):
347
 
        lookups: hit:0 missed:0
348
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
349
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
350
 
        br0 65534/100: (dummy)
351
 
        p1 1/1: (vxlan: remote_ip=1.1.1.1)
 
313
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
314
                br0 65534/100: (dummy)
 
315
                p1 1/1: (vxlan: remote_ip=1.1.1.1)
 
316
])
 
317
 
 
318
OVS_VSWITCHD_STOP
 
319
AT_CLEANUP
 
320
 
 
321
AT_SETUP([tunnel - LISP])
 
322
OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=lisp \
 
323
                    options:remote_ip=1.1.1.1 ofport_request=1])
 
324
 
 
325
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
326
                br0 65534/100: (dummy)
 
327
                p1 1/1: (lisp: remote_ip=1.1.1.1)
352
328
])
353
329
 
354
330
OVS_VSWITCHD_STOP
358
334
OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=vxlan \
359
335
                    options:remote_ip=1.1.1.1 ofport_request=1 options:dst_port=4341])
360
336
 
361
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
362
 
br0 (dummy@ovs-dummy):
363
 
        lookups: hit:0 missed:0
364
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
365
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
366
 
        br0 65534/100: (dummy)
367
 
        p1 1/1: (vxlan: dst_port=4341, remote_ip=1.1.1.1)
 
337
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
338
                br0 65534/100: (dummy)
 
339
                p1 1/1: (vxlan: dst_port=4341, remote_ip=1.1.1.1)
368
340
])
369
341
 
370
342
dnl change UDP port
371
343
 
372
344
AT_CHECK([ovs-vsctl -- set Interface p1 options:dst_port=5000])
373
345
 
374
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
375
 
br0 (dummy@ovs-dummy):
376
 
        lookups: hit:0 missed:0
377
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
378
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
379
 
        br0 65534/100: (dummy)
380
 
        p1 1/2: (vxlan: dst_port=5000, remote_ip=1.1.1.1)
 
346
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
347
                br0 65534/100: (dummy)
 
348
                p1 1/2: (vxlan: dst_port=5000, remote_ip=1.1.1.1)
381
349
])
382
350
 
383
351
dnl change UDP port to default
384
352
 
385
353
AT_CHECK([ovs-vsctl -- set Interface p1 options:dst_port=4789])
386
354
 
387
 
AT_CHECK([ovs-appctl dpif/show], [0], [dnl
388
 
br0 (dummy@ovs-dummy):
389
 
        lookups: hit:0 missed:0
390
 
        flows: cur: 0, avg: 0.000, max: 0, life span: 0(ms)
391
 
                overall avg: add rate: 0.000/min, del rate: 0.000/min
392
 
        br0 65534/100: (dummy)
393
 
        p1 1/1: (vxlan: remote_ip=1.1.1.1)
 
355
AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
 
356
                br0 65534/100: (dummy)
 
357
                p1 1/1: (vxlan: remote_ip=1.1.1.1)
394
358
])
 
359
OVS_VSWITCHD_STOP
 
360
AT_CLEANUP
395
361
 
 
362
AT_SETUP([ofproto-dpif - set_field - tun_src/tun_dst/tun_id])
 
363
OVS_VSWITCHD_START([dnl
 
364
    add-port br0 p1 -- set Interface p1 type=gre options:key=flow \
 
365
        options:remote_ip=1.1.1.1 ofport_request=1 \
 
366
    -- add-port br0 p2 -- set Interface p2 type=gre options:key=flow \
 
367
        options:remote_ip=flow ofport_request=2 \
 
368
    -- add-port br0 p3 -- set Interface p3 type=gre options:key=flow \
 
369
        options:remote_ip=flow options:local_ip=flow ofport_request=3 \
 
370
    -- add-port br0 p4 -- set Interface p4 type=gre options:key=3 \
 
371
        options:remote_ip=flow ofport_request=4 \
 
372
    -- add-port br0 p5 -- set Interface p5 type=gre options:key=flow \
 
373
        options:remote_ip=5.5.5.5 ofport_request=5])
 
374
ADD_OF_PORTS([br0], [90])
 
375
AT_DATA([flows.txt], [dnl
 
376
in_port=90 actions=resubmit:1,resubmit:2,resubmit:3,resubmit:4,resubmit:5
 
377
in_port=1 actions=set_field:42->tun_id,output:1
 
378
in_port=2 actions=set_field:3.3.3.3->tun_dst,output:2
 
379
in_port=3 actions=set_field:1.1.1.1->tun_src,set_field:4.4.4.4->tun_dst,output:3
 
380
in_port=4 actions=set_field:2.2.2.2->tun_dst,output:4
 
381
in_port=5 actions=set_field:5->tun_id
 
382
])
 
383
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
 
384
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
 
385
AT_CHECK([tail -1 stdout], [0],
 
386
  [Datapath actions: set(tunnel(tun_id=0x2a,src=0.0.0.0,dst=1.1.1.1,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,src=0.0.0.0,dst=3.3.3.3,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x2a,src=1.1.1.1,dst=4.4.4.4,tos=0x0,ttl=64,flags(df,key))),1,set(tunnel(tun_id=0x3,src=0.0.0.0,dst=2.2.2.2,tos=0x0,ttl=64,flags(df,key))),1
 
387
])
396
388
OVS_VSWITCHD_STOP
397
389
AT_CLEANUP