diff options
author | YAMAMOTO Takashi <yamamoto@midokura.com> | 2015-10-14 06:36:20 +0000 |
---|---|---|
committer | YAMAMOTO Takashi <yamamoto@midokura.com> | 2015-11-26 18:37:07 +0900 |
commit | 622aff9668176cec0fde985928b863e871c42831 (patch) | |
tree | 6e176309f67153ad25e943ef5b4b9401a95bb967 /tests/completion.at | |
parent | 6a54bae19648a305a52fb6a911723cbc49bc822b (diff) | |
download | openvswitch-622aff9668176cec0fde985928b863e871c42831.tar.gz |
completion.at: Improve portability
NetBSD's /bin/sh complains on the syntax of bash array.
While the use of eval might seem overkill, it's tricky to avoid
the error because the generated code will be a part of the surrounding
subshell and the syntax check is done a bit earlier than the execution
of these conditionals.
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests/completion.at')
-rw-r--r-- | tests/completion.at | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/completion.at b/tests/completion.at index 0aca7aabb..79093f9b6 100644 --- a/tests/completion.at +++ b/tests/completion.at @@ -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 -- \ @@ -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 |