diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-07-14 15:17:33 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-07-26 17:04:38 -0700 |
| commit | 0ab14c8e284b7c5c68aff1ccc6795a1d4b58bd49 (patch) | |
| tree | 0310023fb16eaf5be2e4fb330033fcd972ac6d01 /tests | |
| parent | 06b6d65132e54582031c8166c74725fc90239588 (diff) | |
| download | openvswitch-0ab14c8e284b7c5c68aff1ccc6795a1d4b58bd49.tar.gz | |
ofp-print: Make port "config" and "state" output easier to read.
This changes the output of "ovs-ofctl show" from printing ports like this:
1(eth1): addr:50:54:00:00:00:02, config: 0x11, state:0x1
to this:
1(eth1): addr:50:54:00:00:00:02
config: PORT_DOWN NO_FLOOD
state: LINK_DOWN
which seems much easier to read.
It also eliminates trailing white space from the output.
Reported-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ofp-print.at | 44 | ||||
| -rw-r--r-- | tests/ofproto.at | 16 |
2 files changed, 37 insertions, 23 deletions
diff --git a/tests/ofp-print.at b/tests/ofp-print.at index 03509b65c..c2018c77c 100644 --- a/tests/ofp-print.at +++ b/tests/ofp-print.at @@ -138,19 +138,27 @@ ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \ OFPT_FEATURES_REPLY (xid=0x1): ver:0x1, dpid:0000505400000001 n_tables:2, n_buffers:256 features: capabilities:0x87, actions:0xfff - 1(eth1): addr:50:54:00:00:00:02, config: 0, state:0 - current: 100MB-FD AUTO_NEG @&t@ - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ - 2(eth2): addr:50:54:00:00:00:03, config: 0, state:0 - current: 100MB-FD AUTO_NEG @&t@ - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ - 3(eth0): addr:50:54:00:00:00:01, config: 0, state:0 - current: 100MB-FD AUTO_NEG @&t@ - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ - LOCAL(br0): addr:50:54:00:00:00:01, config: 0x1, state:0x1 + 1(eth1): addr:50:54:00:00:00:02 + config: 0 + state: 0 + current: 100MB-FD AUTO_NEG + advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG + supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG + 2(eth2): addr:50:54:00:00:00:03 + config: 0 + state: 0 + current: 100MB-FD AUTO_NEG + advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG + supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG + 3(eth0): addr:50:54:00:00:00:01 + config: 0 + state: 0 + current: 100MB-FD AUTO_NEG + advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG + supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG + LOCAL(br0): addr:50:54:00:00:00:01 + config: PORT_DOWN + state: LINK_DOWN ]) AT_CLEANUP @@ -256,10 +264,12 @@ AT_CHECK([ovs-ofctl ofp-print "\ 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 \ 00 00 02 08 00 00 02 8f 00 00 02 8f 00 00 00 00 \ "], [0], [dnl -OFPT_PORT_STATUS (xid=0x0): MOD: 3(eth0): addr:50:54:00:00:00:01, config: 0x1, state:0x1 - current: 100MB-FD AUTO_NEG @&t@ - advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ - supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG @&t@ +OFPT_PORT_STATUS (xid=0x0): MOD: 3(eth0): addr:50:54:00:00:00:01 + config: PORT_DOWN + state: LINK_DOWN + current: 100MB-FD AUTO_NEG + advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG + supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG ]) AT_CLEANUP diff --git a/tests/ofproto.at b/tests/ofproto.at index e6def3ec7..f29921843 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -13,7 +13,9 @@ AT_CHECK([STRIP_XIDS stdout], [0], [dnl OFPT_FEATURES_REPLY: ver:0x1, dpid:fedcba9876543210 n_tables:1, n_buffers:256 features: capabilities:0x87, actions:0xfff - LOCAL(br0): addr:aa:55:aa:55:00:00, config: 0x1, state:0x1 + LOCAL(br0): addr:aa:55:aa:55:00:00 + config: PORT_DOWN + state: LINK_DOWN OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 ]) OFPROTO_STOP @@ -23,19 +25,21 @@ AT_SETUP([ofproto - mod-port]) OFPROTO_START for command_config_state in \ 'up 0 0' \ - 'noflood 0x10 0' \ - 'down 0x11 0x1' \ - 'flood 0x1 0x1' + 'noflood NO_FLOOD 0' \ + 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \ + 'flood PORT_DOWN LINK_DOWN' do set $command_config_state - command=$[1] config=$[2] state=$[3] + command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] AT_CHECK([ovs-ofctl -vANY:ANY:WARN mod-port br0 br0 $command]) AT_CHECK([ovs-ofctl -vANY:ANY:WARN show br0], [0], [stdout]) AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl OFPT_FEATURES_REPLY: ver:0x1, dpid:fedcba9876543210 n_tables:1, n_buffers:256 features: capabilities:0x87, actions:0xfff - LOCAL(br0): addr:aa:55:aa:55:00:00, config: $config, state:$state + LOCAL(br0): addr:aa:55:aa:55:00:00 + config: $config + state: $state OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 ]) done |
