Skip to content

Commit

Permalink
tests/tunnel.at: Add geneve options mirror test.
Browse files Browse the repository at this point in the history
Test geneve options mirror flow doesn't add redundant mirror.

Acked-by: Simon Horman <[email protected]>
Signed-off-by: Roi Dayan <[email protected]>
Signed-off-by: Eelco Chaudron <[email protected]>
  • Loading branch information
roidayan authored and chaudron committed Oct 13, 2023
1 parent 834bd91 commit c92ded5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/tunnel.at
Original file line number Diff line number Diff line change
Expand Up @@ -1279,3 +1279,32 @@ AT_CHECK([tail -1 stdout], [0],

OVS_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([tunnel - Geneve metadata mirror])
OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=geneve \
options:remote_ip=1.1.1.1 ofport_request=1 \
-- add-port br0 p2 -- set Interface p2 type=dummy \
ofport_request=2 ofport_request=2])
OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
add_of_ports br0 90
AT_CHECK([ovs-vsctl \
set Bridge br0 mirrors=@m --\
--id=@p90 get Port p90 --\
--id=@m create Mirror name=mymirror select_all=true output_port=@p90], [0], [stdout])

AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0,{class=0xffff,type=1,len=8}->tun_metadata1"])

AT_DATA([flows.txt], [dnl
in_port=2,actions=set_field:0xa->tun_metadata0,set_field:0x1234567890abcdef->tun_metadata1,1
tun_metadata0=0xb/0xf,actions=2
])
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])

flow="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=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
AT_CHECK_UNQUOTED([tail -1 stdout], [0],
[Datapath actions: 90,set(tunnel(dst=1.1.1.1,ttl=64,tp_dst=6081,geneve({class=0xffff,type=0,len=4,0xa}{class=0xffff,type=0x1,len=8,0x1234567890abcdef}),flags(df))),6081
])

OVS_VSWITCHD_STOP
AT_CLEANUP

0 comments on commit c92ded5

Please sign in to comment.