ofp-actions: Assert variable actions have len>0.
[cascardo/ovs.git] / tests / completion.at
index d3b2800..79093f9 100644 (file)
@@ -341,7 +341,8 @@ echo "$@" | tr ' ' '\n' | sed -e '/^$/d' | sed -e 's/$/ /g' | sort -u
 ])
 
 AT_SETUP([vsctl-bashcomp - basic verification])
-AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4])
+AT_SKIP_IF([test -z ${BASH_VERSION+x}])
+AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4'])
 OVS_VSWITCHD_START
 
 # complete ovs-vsctl --db=* [TAB]
@@ -422,7 +423,8 @@ AT_CLEANUP
 
 
 AT_SETUP([vsctl-bashcomp - argument completion])
-AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4])
+AT_SKIP_IF([test -z ${BASH_VERSION+x}])
+AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4'])
 OVS_VSWITCHD_START(
    [add-br br1 -- \
        set bridge br1 datapath-type=dummy -- \
@@ -608,7 +610,7 @@ AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add Bridge br0 other_config ran
 [0], [dnl
 ${MATCH}
 ])
-MATCH="$(PREPARE_MATCH_NOSPACE(random_key=abc))"
+MATCH="$(PREPARE_MATCH_NOSPACE(abc))"
 AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "add Bridge br0 other_config random_key=abc"],
 [0], [dnl
 ${MATCH}
@@ -638,14 +640,14 @@ AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 other"],
 ${MATCH}
 ])
 # then, with the ':' we should complete on key.
-TMP="$(ovs-vsctl --no-heading --columns=other_config list Bridge br0 | tr -d '{\"}' | tr -s ', ' '\n' | cut -d'=' -f1 | xargs printf "other_config:%s\n")"
+TMP="$(ovs-vsctl --no-heading --columns=other_config list Bridge br0 | tr -d '{\"}' | tr -s ', ' '\n' | cut -d'=' -f1)"
 MATCH="$(PREPARE_MATCH_NOSPACE(${TMP}))"
 AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 other_config:"],
 [0], [dnl
 ${MATCH}
 ])
 # finally, if user fill in some value, we should just complete on user input.
-MATCH="$(PREPARE_MATCH_NOSPACE(other_config:random_val1=12345))"
+MATCH="$(PREPARE_MATCH_NOSPACE(random_val1))"
 AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set Bridge br0 other_config:random_val1=12345"],
 [0], [dnl
 ${MATCH}
@@ -677,14 +679,14 @@ AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager "],
 ${MATCH}
 ])
 # filename completion on unix, punix.
-MATCH="$(PREPARE_MATCH_NOSPACE(unix:testsuite.log))"
+MATCH="$(PREPARE_MATCH_NOSPACE(testsuite.log))"
 AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager unix:test"],
 [0], [dnl
 ${MATCH}
 ])
 # no completion on other type, just return available types.
 # in real environment, bash will not complete on anything.
-MATCH="$(PREPARE_MATCH_NOSPACE(pssl: ptcp: punix: ssl: tcp: unix:))"
+MATCH="$(PREPARE_MATCH_NOSPACE(pssl: ptcp: punix: tcp: unix:))"
 AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager ssl:something"],
 [0], [dnl
 ${MATCH}
@@ -748,7 +750,8 @@ AT_CLEANUP
 
 
 AT_SETUP([vsctl-bashcomp - negative test])
-AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4])
+AT_SKIP_IF([test -z ${BASH_VERSION+x}])
+AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4'])
 OVS_VSWITCHD_START
 
 # complete non-matching command.
@@ -786,4 +789,4 @@ OVS_VSWITCHD_STOP
 AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test ""],
 [1], [])
 
-AT_CLEANUP
\ No newline at end of file
+AT_CLEANUP