Merge 'master' into 'next'.
[sliver-openvswitch.git] / tests / ofproto.at
1 AT_BANNER([ofproto])
2
3 AT_SETUP([ofproto - echo request])
4 OFPROTO_START
5 AT_CHECK([ovs-ofctl -vANY:ANY:WARN probe br0])
6 OFPROTO_STOP
7 AT_CLEANUP
8
9 AT_SETUP([ofproto - feature request, config request])
10 OFPROTO_START
11 AT_CHECK([ovs-ofctl -vANY:ANY:WARN show br0], [0], [stdout])
12 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
13 OFPT_FEATURES_REPLY: ver:0x1, dpid:fedcba9876543210
14 n_tables:1, n_buffers:256
15 features: capabilities:0x87, actions:0xfff
16  LOCAL(br0): addr:aa:55:aa:55:00:00, config: 0x1, state:0x1
17 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
18 ])
19 OFPROTO_STOP
20 AT_CLEANUP
21
22 AT_SETUP([ofproto - mod-port])
23 OFPROTO_START
24 for command_config_state in \
25     'up 0 0' \
26     'noflood 0x10 0' \
27     'down 0x11 0x1' \
28     'flood 0x1 0x1'
29 do
30     set $command_config_state
31     command=$[1] config=$[2] state=$[3]
32     AT_CHECK([ovs-ofctl -vANY:ANY:WARN mod-port br0 br0 $command])
33     AT_CHECK([ovs-ofctl -vANY:ANY:WARN show br0], [0], [stdout])
34     AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
35 OFPT_FEATURES_REPLY: ver:0x1, dpid:fedcba9876543210
36 n_tables:1, n_buffers:256
37 features: capabilities:0x87, actions:0xfff
38  LOCAL(br0): addr:aa:55:aa:55:00:00, config: $config, state:$state
39 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
40 ])
41 done
42 OFPROTO_STOP
43 AT_CLEANUP
44
45 AT_SETUP([ofproto - basic flow_mod commands])
46 OFPROTO_START
47 AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS], [0], [NXST_FLOW reply:
48 ])
49 AT_CHECK([echo 'in_port=1,actions=0' | ovs-ofctl add-flows br0 -])
50 AT_CHECK([ovs-ofctl add-flow br0 in_port=0,actions=1])
51 AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS | STRIP_DURATION | sort], [0], [dnl
52  cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, in_port=0 actions=output:1
53  cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, in_port=1 actions=output:0
54  cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, in_port=65534 actions=output:1
55 NXST_FLOW reply:
56 ])
57 AT_CHECK([ovs-ofctl del-flows br0])
58 AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS], [0], [NXST_FLOW reply:
59 ])
60 OFPROTO_STOP
61 AT_CLEANUP