ofproto-macros: Change STRIP_USED and STRIP_UID to shell functions.
[cascardo/ovs.git] / tests / vtep-ctl.at
index 40ee16e..99e97e8 100644 (file)
@@ -2,8 +2,7 @@ dnl VTEP_OVSDB_INIT([$1])
 dnl
 dnl Creates an empty database named $1.
 m4_define([VTEP_OVSDB_INIT],
-  [OVS_RUNDIR=`pwd`; export OVS_RUNDIR
-   AT_CHECK(
+  [AT_CHECK(
      [ovsdb-tool create $1 $abs_top_srcdir/vtep/vtep.ovsschema],
      [0], [stdout], [ignore])
    AT_CHECK(
@@ -887,3 +886,27 @@ tcp:5.4.3.2\ntcp:8.9.10.11
 ], [], [VTEP_CTL_CLEANUP])
 VTEP_CTL_CLEANUP
 AT_CLEANUP
+
+AT_SETUP([show command])
+AT_KEYWORDS([vtep-ctl show])
+VTEP_CTL_SETUP
+AT_CHECK([RUN_VTEP_CTL(
+  [set-manager tcp:4.5.6.7],
+  [add-ps a],
+  [add-port a a1],
+  [add-ls ls1],
+  [bind-ls a a1 100 ls1],
+  [set Physical_Switch a management_ips=[[4.3.2.1]] tunnel_ips=[[1.2.3.4]]])], [0], [ignore], [], [VTEP_CTL_CLEANUP])
+
+AT_CHECK([vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket show | tail -n+2 | sed 's/=[[a-f0-9-]][[a-f0-9-]]*}/=<ls>}/' ], [0], [dnl
+    Manager "tcp:4.5.6.7"
+    Physical_Switch a
+        management_ips: [["4.3.2.1"]]
+        tunnel_ips: [["1.2.3.4"]]
+        Physical_Port "a1"
+            vlan_bindings:
+                100="ls1"
+], [], [VTEP_CTL_CLEANUP])
+
+VTEP_CTL_CLEANUP
+AT_CLEANUP