]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Switch to ncat instead of nc
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 5 Jul 2024 08:27:56 +0000 (10:27 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 10 Jul 2024 16:52:29 +0000 (18:52 +0200)
ncat is available in CentOS Stream 9 without having to enable EPEL.

14 files changed:
mkosi.conf.d/10-arch/mkosi.conf
mkosi.conf.d/10-centos-fedora/mkosi.conf
mkosi.conf.d/10-debian-ubuntu/mkosi.conf
mkosi.conf.d/10-opensuse/mkosi.conf
mkosi.images/minimal-base/mkosi.conf.d/10-arch.conf
mkosi.images/minimal-base/mkosi.conf.d/10-centos-fedora.conf
mkosi.images/minimal-base/mkosi.conf.d/10-debian-ubuntu-opensuse.conf
mkosi.images/minimal-base/mkosi.conf.d/10-opensuse.conf
test/TEST-13-NSPAWN/test.sh
test/test-functions
test/units/TEST-07-PID1.exec-context.sh
test/units/TEST-07-PID1.issue-2467.sh
test/units/TEST-07-PID1.issue-3171.sh
test/units/TEST-13-NSPAWN.nspawn.sh

index 80e648a9451d40799e61d78690a9b0b9cd43365a..d9f75c65d3399d246025110070b1947bb627405e 100644 (file)
@@ -37,8 +37,8 @@ Packages=
         linux
         man-db
         multipath-tools
+        nmap
         open-iscsi
-        openbsd-netcat
         openssh
         openssl
         pacman
index 4d0f7e71ea2049157632b2e4405b69ccb182e22d..4c6109a54454969310f8a9bc36d5272b71aef10f 100644 (file)
@@ -45,7 +45,7 @@ Packages=
         libcap-ng-utils
         libubsan
         man-db
-        netcat
+        nmap-ncat
         openssh-clients
         openssh-server
         pam
index 31be15af783ef7149c8721bfd746a538b2febe5a..07bf95cee7017baae630f1bfd1708fc8185279b6 100644 (file)
@@ -65,7 +65,7 @@ Packages=
         locales
         man-db
         multipath-tools
-        netcat-openbsd
+        ncat
         open-iscsi
         openssh-client
         openssh-server
index e54d19d55e704e54af72c9bd9449e422ca034cd8..ff93b12efa7f4d089c14252dc66e2e50a66d47d4 100644 (file)
@@ -8,6 +8,7 @@ InitrdInclude=initrd/
 
 [Distribution]
 Release=tumbleweed
+Repositories=non-oss
 PackageManagerTrees=macros.db_backend:/etc/rpm/macros.db_backend
 
 [Content]
@@ -60,6 +61,7 @@ Packages=
         libkmod2
         libubsan1
         multipath-tools
+        ncat
         open-iscsi
         openssh-clients
         openssh-server
index 9b033975d64c2058cf5ddc812474d66182f2fcc0..4978ca5cf7b58f1672661e09c99c48e50de49353 100644 (file)
@@ -7,7 +7,7 @@ Distribution=arch
 Packages=
         inetutils
         iproute
-        openbsd-netcat
+        nmap
 
 RemoveFiles=
         # Arch Linux doesn't split their gcc-libs package so we manually remove
index 3a3e5286402af5c6a5250f5f0b5eb8e5f9a5058f..c0a43cba19d2276a6f16c1198e9957cb7aae1b6f 100644 (file)
@@ -9,4 +9,4 @@ Packages=
         hostname
         iproute
         iproute-tc
-        netcat
+        nmap-ncat
index a715ec1f6c8a7bd574e6714b32d10b8cae1f39cd..b293926b08d0ac6b05e042a69d8f4b638d913108 100644 (file)
@@ -9,4 +9,4 @@ Packages=
         hostname
         iproute2
         mount
-        netcat-openbsd
+        ncat
index 2e370ec04f4efe39bcaf0953bbbc7b2fdc589a47..c164d328745364563643ee9739fdb440475c2ca3 100644 (file)
@@ -7,5 +7,5 @@ Distribution=opensuse
 Packages=
         hostname
         iproute2
-        netcat-openbsd
+        ncat
         patterns-base-minimal_base
index 9a0404f4b0c11f5480cac9ebb4cb82d22c21f68c..5c85b0c5dc81038b61f3251d0d80133114b6adc1 100755 (executable)
@@ -32,7 +32,7 @@ test_append_files() {
         ls \
         md5sum \
         mountpoint \
-        nc \
+        ncat \
         ps \
         seq \
         sleep \
index 03f188b0a2574960fabeb241e1d1319a582e3963..e219812e726cab86b3a260be889a30ac13577ada 100644 (file)
@@ -208,7 +208,7 @@ BASICTOOLS=(
     mount
     mountpoint
     mv
-    nc
+    ncat
     nproc
     ping
     pkill
index 69274a57439a85c47b3656805b6d191d2d152872..0809460955999d6430070fc8eaf19a0f5a903e88 100755 (executable)
@@ -186,27 +186,27 @@ if ! systemd-detect-virt -cq; then
         )
 
         # We should fail with EPERM when trying to bind to a socket not on the allow list
-        # (nc exits with 2 in that case)
+        # (ncat exits with 2 in that case)
         systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -l 127.0.0.1 9999; exit 42'
+            bash -xec 'timeout 1s ncat -l 127.0.0.1 9999; exit 42'
         systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -l ::1 9999; exit 42'
+            bash -xec 'timeout 1s ncat -l ::1 9999; exit 42'
         systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -6 -u -l ::1 9999; exit 42'
+            bash -xec 'timeout 1s ncat -6 -u -l ::1 9999; exit 42'
         systemd-run --wait -p SuccessExitStatus="1 2" --pipe "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -4 -l 127.0.0.1 6666; exit 42'
+            bash -xec 'timeout 1s ncat -4 -l 127.0.0.1 6666; exit 42'
         systemd-run --wait -p SuccessExitStatus="1 2" --pipe -p SocketBindDeny=any \
-            bash -xec 'timeout 1s nc -l 127.0.0.1 9999; exit 42'
+            bash -xec 'timeout 1s ncat -l 127.0.0.1 9999; exit 42'
         # Consequently, we should succeed when binding to a socket on the allow list
         # and keep listening on it until we're killed by `timeout` (EC 124)
         systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -4 -l 127.0.0.1 1234; exit 1'
+            bash -xec 'timeout 1s ncat -4 -l 127.0.0.1 1234; exit 1'
         systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -4 -u -l 127.0.0.1 5678; exit 1'
+            bash -xec 'timeout 1s ncat -4 -u -l 127.0.0.1 5678; exit 1'
         systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -6 -l ::1 1234; exit 1'
+            bash -xec 'timeout 1s ncat -6 -l ::1 1234; exit 1'
         systemd-run --wait --pipe -p SuccessExitStatus=124 "${ARGUMENTS[@]}" \
-            bash -xec 'timeout 1s nc -6 -l ::1 6666; exit 1'
+            bash -xec 'timeout 1s ncat -6 -l ::1 6666; exit 1'
     fi
 
     losetup -d "$LODEV"
index de0577b97800f0719b4fe82f48446397ce3dd01a..083a1e723f32811c0cc804e00e6ab68ff3ba229b 100755 (executable)
@@ -8,7 +8,7 @@ set -o pipefail
 
 rm -f /tmp/nonexistent
 systemctl start issue2467.socket
-nc -i20 -w20 -U /run/test.ctl || :
+ncat -i20 -w20 -U /run/test.ctl || :
 
 # TriggerLimitIntervalSec= by default is set to 2s. A "sleep 10" should give
 # systemd enough time even on slower machines, to reach the trigger limit.
index 374df542b8e7f7dae583dac23b7aae21360753f4..e1a4b6479f9898ec6234e94a19054bc98f846782 100755 (executable)
@@ -30,21 +30,21 @@ EOF
 systemctl start issue-3171.socket
 systemctl is-active issue-3171.socket
 [[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]
-echo A | nc -w1 -U /run/issue-3171.socket
+echo A | ncat -w1 -U /run/issue-3171.socket
 
 mv $U ${U}.disabled
 systemctl daemon-reload
 systemctl is-active issue-3171.socket
 [[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]
-echo B | nc -w1 -U /run/issue-3171.socket && exit 1
+echo B | ncat -w1 -U /run/issue-3171.socket && exit 1
 
 mv ${U}.disabled $U
 systemctl daemon-reload
 systemctl is-active issue-3171.socket
-echo C | nc -w1 -U /run/issue-3171.socket && exit 1
+echo C | ncat -w1 -U /run/issue-3171.socket && exit 1
 [[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]
 
 systemctl restart issue-3171.socket
 systemctl is-active issue-3171.socket
-echo D | nc -w1 -U /run/issue-3171.socket
+echo D | ncat -w1 -U /run/issue-3171.socket
 [[ "$(stat --format='%G' /run/issue-3171.socket)" == adm ]]
index 7901e9877bf976d2ebe02387ab96ed33b980295d..c73b49b1a544519cb6a5924d82a34a540058708d 100755 (executable)
@@ -702,7 +702,7 @@ EOF
 testcase_notification_socket() {
     # https://github.com/systemd/systemd/issues/4944
     local root
-    local cmd='echo a | nc -U -u -w 1 /run/host/notify'
+    local cmd='echo a | ncat -U -u -w 1 /run/host/notify'
 
     root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_notification_socket.XXX)"
     create_dummy_container "$root"