diff options
author | Anton Lindqvist <anton@cvs.openbsd.org> | 2024-01-05 10:37:55 +0000 |
---|---|---|
committer | Anton Lindqvist <anton@cvs.openbsd.org> | 2024-01-05 10:37:55 +0000 |
commit | 39f4555786d5f259dd8e084f1e7d6e56172daf9f (patch) | |
tree | bdc08a2905e1266be3e798272f7ce3711532e061 /regress/sys/netinet/carp/carp_2.sh | |
parent | 14c2daf534567ad36fd8003978dc31924767eafe (diff) |
Wait until the expected interface state is reached instead of relying on
arbitrary sleeps. Should hopefully make these tests more stable.
Diffstat (limited to 'regress/sys/netinet/carp/carp_2.sh')
-rw-r--r-- | regress/sys/netinet/carp/carp_2.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/regress/sys/netinet/carp/carp_2.sh b/regress/sys/netinet/carp/carp_2.sh index 2cd53f0f47c..ce877509dd7 100644 --- a/regress/sys/netinet/carp/carp_2.sh +++ b/regress/sys/netinet/carp/carp_2.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: carp_2.sh,v 1.2 2023/10/19 18:36:41 anton Exp $ +# $OpenBSD: carp_2.sh,v 1.3 2024/01/05 10:37:54 anton Exp $ cleanup() @@ -81,13 +81,13 @@ ifconfig carp$IFNO2 rdomain $RD2 lladdr $lladdr2 192.168.0.1/24 \ # # IFNO1 must become master -sleep 3.1 # need 3 seconds to become master +wait_until "ifconfig carp$IFNO1 | grep -q 'status: master'" test sh -c "ifconfig carp$IFNO1 | grep -q 'status: master'" test sh -c "ifconfig carp$IFNO2 | grep -q 'status: backup'" # carpdemote must work ifconfig -g ${IFGPREFIX}a carpdemote -sleep 0.1 +wait_until "ifconfig carp$IFNO1 | grep -q 'status: backup'" test sh -c "ifconfig carp$IFNO1 | grep -q 'status: backup'" test sh -c "ifconfig carp$IFNO2 | grep -q 'status: master'" |