aboutgitcodebugslistschat
path: root/test/pasta_options/no_pidns
diff options
context:
space:
mode:
Diffstat (limited to 'test/pasta_options/no_pidns')
-rw-r--r--test/pasta_options/no_pidns25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/pasta_options/no_pidns b/test/pasta_options/no_pidns
new file mode 100644
index 0000000..f565b2f
--- /dev/null
+++ b/test/pasta_options/no_pidns
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# PASST - Plug A Simple Socket Transport
+# for qemu/UNIX domain socket mode
+#
+# PASTA - Pack A Subtle Tap Abstraction
+# for network namespace/tap device mode
+#
+# test/pasta_options/no_pidns - Check --no-pidns handling
+
+htools readlink
+
+test Command is spawned in a new PID namespace by default
+set PIDNS __STATEDIR__/pidns
+set OUT __STATEDIR__/no-pidns.out
+set ERR __STATEDIR__/no-pidns.err
+
+passt readlink /proc/self/ns/pid > __PIDNS__
+passt ./pasta -q -- readlink /proc/self/ns/pid > __OUT__ 2> __ERR__
+check [ "$(cat __PIDNS__)" != "$(cat __OUT__)" ]
+
+test --no-pidns keeps command in the caller's PID namespace
+passt ./pasta -q --no-pidns -- readlink /proc/self/ns/pid > __OUT__ 2> __ERR__
+check [ "$(cat __PIDNS__)" = "$(cat __OUT__)" ]
+check [ ! -s __ERR__ ]