From: Miroslav Lichvar Date: Wed, 27 Aug 2025 08:58:42 +0000 (+0200) Subject: test: avoid using cmdport equal to ntpport in system tests X-Git-Tag: 4.8~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e95d5a161d99c741ba31e9fa7ea2d758da8dae92;p=thirdparty%2Fchrony.git test: avoid using cmdport equal to ntpport in system tests Make sure the two randomly generated port numbers used in system tests are different to avoid failures. --- diff --git a/test/system/test.common b/test/system/test.common index 07f259d6..d0894195 100644 --- a/test/system/test.common +++ b/test/system/test.common @@ -213,7 +213,10 @@ generate_chrony_conf() { user=$(get_user) ntpport=$(get_free_port) - cmdport=$(get_free_port) + while true; do + cmdport=$(get_free_port) + [ "$ntpport" -ne "$cmdport" ] && break + done echo "0.0 10000" > "$TEST_LIBDIR/driftfile" echo "1 MD5 abcdefghijklmnopq" > "$TEST_DIR/keys"