[ovs-dev] [PATCHv2 1/2] ovs-vsctl: Add "--real" and "--fake" options to "list-br".

Justin Pettit jpettit at nicira.com
Sat Dec 1 23:56:40 UTC 2012


On Sat, Dec 1, 2012 at 11:25 AM, Ben Pfaff <blp at nicira.com> wrote:


> Ideally we'd add one or two usages to tests/ovs-vsctl.at.
>

Okay.  How about the following incremental?

-=-=-=-=-=-=-=-=-
diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
index 4d4ce10..9552469 100644
--- a/tests/ovs-vsctl.at
+++ b/tests/ovs-vsctl.at
@@ -439,6 +439,22 @@ CHECK_IFACES([xapi1], [eth0.$1])
 OVS_VSCTL_CLEANUP
 AT_CLEANUP

+AT_SETUP([list bridges -- real and fake (VLAN $1)])
+AT_KEYWORDS([ovs-vsctl fake-bridge])
+OVS_VSCTL_SETUP
+OVS_VSCTL_SETUP_SIMPLE_FAKE_CONF([$1])
+AT_CHECK([RUN_OVS_VSCTL_ONELINE([-- list-br])], [0],
+  [xapi1\nxenbr0
+], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL_ONELINE([-- --real list-br])], [0],
+  [xenbr0
+], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL_ONELINE([-- --fake list-br])], [0],
+  [xapi1
+], [], [OVS_VSCTL_CLEANUP])
+OVS_VSCTL_CLEANUP
+AT_CLEANUP
+
 AT_SETUP([simple fake bridge + del-br fake bridge (VLAN $1)])
 AT_KEYWORDS([ovs-vsctl fake-bridge])
 OVS_VSCTL_SETUP
-=-=-=-=-=-=-=-=-


> One could write this:
>         if ((br->parent && fake) || (!br->parent && real)) {
> as:
>         if (br->parent ? fake : real) {
> Personally I think that's more straightforward, but you may not agree.
> Certainly, I understand both forms.
>

Yeah, I think that's cleaner.  I went ahead and changed it to that.

--Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20121201/01ae36dd/attachment-0003.html>


More information about the dev mailing list