From 0a100e5d8f499bafbfad26d9fb6040f14af486f3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 27 Jun 2023 14:37:47 -0400 Subject: [PATCH 1/2] meta: firewall: Fix firewalld test with non-abstract sockets On a recent Fedora Rawhide, dbus-daemon-1.14.8-1 prints a string prefixed by 'unix:path' instead of the expected 'unix:abstract', thereby failing the test. Allowing this alternate prefix fixes the test, so for communication with the daemon it is not relevant. Signed-off-by: Phil Sutter --- plugins/meta/firewall/firewall_firewalld_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/meta/firewall/firewall_firewalld_test.go b/plugins/meta/firewall/firewall_firewalld_test.go index cfb3a1f6..b81670de 100644 --- a/plugins/meta/firewall/firewall_firewalld_test.go +++ b/plugins/meta/firewall/firewall_firewalld_test.go @@ -86,7 +86,8 @@ func spawnSessionDbus(wg *sync.WaitGroup) (string, *exec.Cmd) { bytes, err := bufio.NewReader(stdout).ReadString('\n') Expect(err).NotTo(HaveOccurred()) busAddr := strings.TrimSpace(bytes) - Expect(strings.HasPrefix(busAddr, "unix:abstract")).To(BeTrue()) + Expect(strings.HasPrefix(busAddr, "unix:abstract") || + strings.HasPrefix(busAddr, "unix:path")).To(BeTrue()) var startWg sync.WaitGroup wg.Add(1) From 8e69e38d5125a9b13e2fa2027e4d06c2f236d248 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 27 Jun 2023 21:52:40 +0200 Subject: [PATCH 2/2] test_linux.sh: Do not fail if called twice The script is set to exit on error, so mkdir failing because /tmp/cni-rootless already exists aborts the test run. Call 'mkdir -p' to avoid the spurious error. Signed-off-by: Phil Sutter --- test_linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_linux.sh b/test_linux.sh index e2003f7a..90213956 100755 --- a/test_linux.sh +++ b/test_linux.sh @@ -39,5 +39,5 @@ for t in ${PKG}; do done # Run the pkg/ns tests as non root user -mkdir /tmp/cni-rootless +mkdir -p /tmp/cni-rootless (export XDG_RUNTIME_DIR=/tmp/cni-rootless; cd pkg/ns/; unshare -rmn go test)