scoutfs: add portscan test

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2026-08-28 15:40:58 -07:00
parent 2b3f4e29a9
commit 4c267f88c6
3 changed files with 35 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
== make sure unknown disconnect doesn't shut down server
should be leader: 1
should still be leader: 1
+1
View File
@@ -65,4 +65,5 @@ block-stale-reads.sh
freed-list-wedge.sh
inode-deletion.sh
renameat2-noreplace.sh
portscan.sh
xfstests.sh
+31
View File
@@ -0,0 +1,31 @@
#
# Make sure the server ignores connections that aren't participating.
#
t_require_commands nc
echo "== make sure unknown disconnect doesn't shut down server"
# get server addr [1] and port [1]
sv=$(t_server_nr)
addrs=($(grep "peer 0.0.0.0" $(t_debugfs_path $sv)/connections | \
awk -F"[: ]" '{print $2,$3}'))
# verify that the server is leader and record its term
echo "should be leader: $(cat $(t_sysfs_path $sv)/quorum/is_leader)"
before=$(awk '($1 == "term") { print $2 }' < $(t_sysfs_path $sv)/quorum/status)
# send junk
echo " " | nc ${addrs[0]} ${addrs[1]}
# make sure the server is still leader with the same term
echo "should still be leader: $(cat $(t_sysfs_path $sv)/quorum/is_leader)"
after=$(awk '($1 == "term") { print $2 }' < $(t_sysfs_path $sv)/quorum/status)
if [ -z "$before" -o -z "$after" ]; then
echo "couldn't find terms: before '$before', or after '$after'"
fi
if [ "$before" != "$after" ]; then
echo "term before $before != term after $after"
fi
t_pass