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

« back to all changes in this revision

Viewing changes to tests/vlan-splinters.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:
 
1
AT_BANNER([VLAN splinters])
 
2
 
 
3
AT_SETUP([VLAN splinters])
 
4
OVS_VSWITCHD_START([], [], [=override])
 
5
ADD_OF_PORTS([br0], 1, 2, 3, 4)
 
6
AT_CHECK([ovs-vsctl \
 
7
  -- set Bridge br0 fail-mode=standalone flood_vlans=0,9,11,15 \
 
8
  -- set port br0 tag=0 \
 
9
  -- set port p1 trunks=0,9,11,15 \
 
10
  -- set interface p1 other-config:enable-vlan-splinters=true \
 
11
  -- set port p2 tag=9 \
 
12
  -- set port p3 tag=11 \
 
13
  -- set port p4 tag=15])
 
14
 
 
15
ovs-appctl dpif/show | sed -n '
 
16
s/\./_/g
 
17
s/^[[   ]]*\([[^        ]][[^   ]]*\) [[0-9]]*\/\([[0-9]]*\).*/\1=\2/p
 
18
' > port-numbers
 
19
cat port-numbers
 
20
. ./port-numbers
 
21
 
 
22
for args in '9 p2' '11 p3' '15 p4'; do
 
23
    set $args
 
24
    vlan=$1
 
25
    eval access_port=\$$2
 
26
    eval splinter_port=\$p1_$vlan
 
27
 
 
28
    # Check that when a packet is received on $splinter_port, it is
 
29
    # treated as if it had been received on p1 in the correct VLAN.
 
30
    AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "in_port($splinter_port)"],
 
31
             [0], [stdout])
 
32
    AT_CHECK_UNQUOTED([sed -n '/^Flow/p; /^Datapath/p' stdout], [0], [dnl
 
33
Flow: metadata=0,in_port=$p1,dl_vlan=$vlan,dl_vlan_pcp=0,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x05ff
 
34
Datapath actions: $access_port
 
35
])
 
36
 
 
37
    # Check that when an OpenFlow action sends a packet to p1 on
 
38
    # splintered VLAN $vlan, it is actually output to $splinter_port.
 
39
    AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "in_port($access_port)"],
 
40
             [0], [stdout])
 
41
    AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: $splinter_port
 
42
])
 
43
done
 
44
 
 
45
OVS_VSWITCHD_STOP
 
46
AT_CLEANUP