aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2025-09-05 16:43:17 +1000
committerStefano Brivio <sbrivio@redhat.com>2025-09-05 13:00:20 +0200
commit00e3580ab925bbcaaaaefbb31e744fef84660937 (patch)
tree85285698a84b70dc2770831969147b9f9519743e
parent3c44ef852586101eb6a5b8750d07454dbfb8a1a3 (diff)
downloadpasst-00e3580ab925bbcaaaaefbb31e744fef84660937.tar
passt-00e3580ab925bbcaaaaefbb31e744fef84660937.tar.gz
passt-00e3580ab925bbcaaaaefbb31e744fef84660937.tar.bz2
passt-00e3580ab925bbcaaaaefbb31e744fef84660937.tar.lz
passt-00e3580ab925bbcaaaaefbb31e744fef84660937.tar.xz
passt-00e3580ab925bbcaaaaefbb31e744fef84660937.tar.zst
passt-00e3580ab925bbcaaaaefbb31e744fef84660937.zip
test: Explicit specify forwarding ports for pasta in log rotation tests
test/pasta_options/log_to_file uses tcp_crr in a loop to generate log messages for what it's actually testing. For this to work, pasta needs to forward two ports. We set a PORTS variable with the options for this, but never actually use it. The test works, because without the options we use automatic port forwarding. That makes the test more fragile than it needs to be, in a way that's not at all related to what we're actually trying to test. Avoid this possible point of failure by explicitly specifying the forwarding. I encountered this because Fedora has now updated to a kernel with the /proc/net lseek() bug. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--test/pasta_options/log_to_file10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/pasta_options/log_to_file b/test/pasta_options/log_to_file
index 3ead06c..db78b04 100644
--- a/test/pasta_options/log_to_file
+++ b/test/pasta_options/log_to_file
@@ -30,19 +30,19 @@ endef
test Log creation
-set PORTS -t 10001,10002 -u 10001,10002
+set PORTS -t 10001,10002 -u 10001,10002 -T none -U none
set LOG_FILE __STATEDIR__/pasta.log
-passt ./pasta -l __LOG_FILE__ -- /bin/true
+passt ./pasta __PORTS__ -l __LOG_FILE__ -- /bin/true
check [ -s __LOG_FILE__ ]
test Log truncated on creation
-passt ./pasta -l __LOG_FILE__ -- /bin/true & wait
+passt ./pasta __PORTS__ -l __LOG_FILE__ -- /bin/true & wait
pout PID2 echo $!
check head -1 __LOG_FILE__ | grep '^pasta .* [(]__PID2__[)]$'
test Maximum log size
-passtb ./pasta --config-net -d -f -l __LOG_FILE__ --log-size $((100 * 1024)) -- sh -c 'while true; do tcp_crr --nolog -l1 -P 10001 -C 10002 -6; done'
+passtb ./pasta __PORTS__ --config-net -d -f -l __LOG_FILE__ --log-size $((100 * 1024)) -- sh -c 'while true; do tcp_crr --nolog -l1 -P 10001 -C 10002 -6; done'
sleep 1
flood_log_client
@@ -67,7 +67,7 @@ passt unshare -rUm
passt mkdir __STATEDIR__/t
passt mount -t tmpfs none __STATEDIR__/t
set LOG_FILE __STATEDIR__/t/log
-passt ./pasta --config-net -d -l __LOG_FILE__ --log-size $((100 * 1024))
+passt ./pasta __PORTS__ --config-net -d -l __LOG_FILE__ --log-size $((100 * 1024))
flood_log_server
flood_log_client