])
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]
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 -- \
[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}
${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}
${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}
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.
AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test ""],
[1], [])
-AT_CLEANUP
\ No newline at end of file
+AT_CLEANUP