diff options
author | Alex Wang <alexw@nicira.com> | 2015-08-12 21:29:06 -0700 |
---|---|---|
committer | Alex Wang <alexw@nicira.com> | 2015-08-13 00:58:59 -0700 |
commit | 016e46846db5decbe6337500230cb56fd4b1bdf7 (patch) | |
tree | 7cb6028c1718e047f4a01a68cd898f8bbc8bde10 /tests/ovn-sbctl.at | |
parent | ebbcddeba883d16e203caf22e69c711241a0eef3 (diff) | |
download | openvswitch-016e46846db5decbe6337500230cb56fd4b1bdf7.tar.gz |
db-ctl-base: Allow print rows that weak reference to table in
'cmd_show_table'.
Sometimes, it is desirable to print the table with weak reference to
the table specified in 'struct cmd_show_table'. For example the
Port_Binding table rows in OVN_Southbound database that refer to the
same Chassis table row can be printed under the same chassis entry
in 'ovn-sbctl show' output.
To achieve it, this commit adds a new struct in 'struct cmd_show_table'
that allows users to print a table with weak reference to 'table'
specified in 'struct cmd_show_table'. The 'ovn-sbctl' which now prints
the Port_Binding entries with Chassis table, is the first user of this
new feature.
Requested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'tests/ovn-sbctl.at')
-rw-r--r-- | tests/ovn-sbctl.at | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ovn-sbctl.at b/tests/ovn-sbctl.at index 6bda181eb..16968fd06 100644 --- a/tests/ovn-sbctl.at +++ b/tests/ovn-sbctl.at @@ -48,6 +48,30 @@ AT_CHECK([ovn-sbctl show], [0], [dnl Chassis "ch0" Encap stt ip: "1.2.3.5" + Port_Binding "vif0" +]) + +# adds another 'vif1' +AT_CHECK([ovn-nbctl lport-add br-test vif1]) +AT_CHECK([ovn-nbctl lport-set-macs vif1 f0:ab:cd:ef:01:03]) +AT_CHECK([ovn-sbctl lport-bind vif1 ch0]) + +AT_CHECK([ovn-sbctl show | sed 's/vif[[0-9]]/vif/'], [0], [dnl +Chassis "ch0" + Encap stt + ip: "1.2.3.5" + Port_Binding "vif" + Port_Binding "vif" +]) + +# deletes 'vif1' +AT_CHECK([ovn-nbctl lport-del vif1]) + +AT_CHECK([ovn-sbctl show], [0], [dnl +Chassis "ch0" + Encap stt + ip: "1.2.3.5" + Port_Binding "vif0" ]) uuid=$(ovn-sbctl --columns=_uuid list Chassis ch0 | cut -d ':' -f2 | tr -d ' ') |