Skip to content

Commit

Permalink
t_client.sh: conditionally skip ifconfig+route check
Browse files Browse the repository at this point in the history
For --dev null or --dev-type af_unix:lwipopenvn tests, there will be
no visible change to ifconfig or route output, so tests will fail
("how can this be?").  Set EXPECT_IFCONFIG4_<n>=- to skip this
check.

(Simply leaving both EXPECT_IFCONFIG* vars empty and using that as
trigger would interfere with the magic from commit df0b00c)

v2: fix string-equal comparison

Change-Id: Iec1953415afb53755488dd44407568e72d28e854
Signed-off-by: Gert Doering <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg29473.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
cron2 committed Sep 28, 2024
1 parent 95e5a0b commit 5ccaa49
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/t_client.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ check_ifconfig()
expect_list="$@"

if [ -z "$expect_list" ] ; then return ; fi
if [ "$expect_list" = "-" ] ; then return ; fi

for expect in $expect_list
do
Expand Down Expand Up @@ -404,13 +405,17 @@ do
output "save ifconfig+route"
get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt

output -n "compare pre-openvpn ifconfig+route with current values..."
if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
$LOGDIR/$SUF:ifconfig_route.txt >/dev/null
then
fail "no differences between ifconfig/route before OpenVPN start and now."
if [ "$expect_ifconfig4" = "-" ] ; then
output "skip ifconfig+route check"
else
output " OK!\n"
output -n "compare pre-openvpn ifconfig+route with current values..."
if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
$LOGDIR/$SUF:ifconfig_route.txt >/dev/null
then
fail "no differences between ifconfig/route before OpenVPN start and now."
else
output " OK!\n"
fi
fi

# post init script needed?
Expand Down

0 comments on commit 5ccaa49

Please sign in to comment.