1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00

test: add a couple of sanity tests for --port=

This commit is contained in:
Frantisek Sumsal 2023-05-17 14:57:50 +02:00
parent cf260f799f
commit 74696ba5ef
2 changed files with 16 additions and 1 deletions

View File

@ -30,7 +30,8 @@ test_append_files() {
seq \
sleep \
stat \
touch
touch \
true
cp /etc/os-release "$container/usr/lib/os-release"
cat >"$container/sbin/init" <<EOF

View File

@ -213,6 +213,20 @@ EOF
test ! -e "$tmpdir/3/nope"
rm -fr "$tmpdir"
# --port (sanity only)
systemd-nspawn --network-veth --directory="$root" --port=80 --port=90 true
systemd-nspawn --network-veth --directory="$root" --port=80:8080 true
systemd-nspawn --network-veth --directory="$root" --port=tcp:80 true
systemd-nspawn --network-veth --directory="$root" --port=tcp:80:8080 true
systemd-nspawn --network-veth --directory="$root" --port=udp:80 true
systemd-nspawn --network-veth --directory="$root" --port=udp:80:8080 --port=tcp:80:8080 true
(! systemd-nspawn --network-veth --directory="$root" --port= true)
(! systemd-nspawn --network-veth --directory="$root" --port=-1 true)
(! systemd-nspawn --network-veth --directory="$root" --port=: true)
(! systemd-nspawn --network-veth --directory="$root" --port=icmp:80:8080 true)
(! systemd-nspawn --network-veth --directory="$root" --port=tcp::8080 true)
(! systemd-nspawn --network-veth --directory="$root" --port=8080: true)
# Assorted tests
systemd-nspawn --directory="$root" --suppress-sync=yes bash -xec 'echo hello'
systemd-nspawn --capability=help