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.
This commit is contained in:
Miroslav Lichvar
2025-08-27 10:58:42 +02:00
parent 2c63dfee34
commit e95d5a161d

View File

@@ -213,7 +213,10 @@ generate_chrony_conf() {
user=$(get_user)
ntpport=$(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"