diff options
author | Petr Vorel <pvorel@suse.cz> | 2018-07-02 13:56:40 +0200 |
---|---|---|
committer | Petr Vorel <pvorel@suse.cz> | 2018-07-04 17:53:28 +0200 |
commit | a93c34f914554a5054034a3b49b942c0e336f09b (patch) | |
tree | 0d5579cadc61cf65e31a274ed4eaf6359a263cf2 /testcases/lib | |
parent | a9954796758ce5e700fb5a1407a1cc26b9adcd80 (diff) |
tst_net.sh: Introduce TST_LIB_NET_LOADED
to load it only once.
Some tests (macsec0{1,2}.sh) load tst_net.sh twice via loading from
ipsec_lib.sh and virt_lib.sh. That brings duplicity in some variables
(TST_OPTS) and create infinite loop, as tst_net_setup calls itself.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Diffstat (limited to 'testcases/lib')
-rw-r--r-- | testcases/lib/tst_net.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index aad701952..507d5b788 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -19,6 +19,9 @@ # Author: Alexey Kodanev <alexey.kodanev@oracle.com> # +[ -n "$TST_LIB_NET_LOADED" ] && return 0 +TST_LIB_NET_LOADED=1 + TST_OPTS="6$TST_OPTS" TST_PARSE_ARGS_CALLER="$TST_PARSE_ARGS" TST_PARSE_ARGS="tst_net_parse_args" @@ -73,9 +76,7 @@ tst_net_setup() [ -n "$TST_SETUP_CALLER" ] && $TST_SETUP_CALLER } -if [ -z "$TST_LIB_LOADED" ]; then - [ -n "$TST_USE_LEGACY_API" ] && . test.sh || . tst_test.sh -fi +[ -n "$TST_USE_LEGACY_API" ] && . test.sh || . tst_test.sh if [ -n "$TST_USE_LEGACY_API" ]; then tst_net_read_opts "$@" |