test: add tests for merging RestrictNamespaces=

This commit is contained in:
Yu Watanabe
2018-04-27 10:48:43 +09:00
parent aa9d574de9
commit 1dcf96c29f
5 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Test merging RestrictNamespaces= with all flags
[Service]
RestrictNamespaces=mnt pid cgroup net uts ipc user
RestrictNamespaces=net
ExecStart=unshare -m -u -i -n -p -f
Type=oneshot

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Test merging RestrictNamespaces= with AND
[Service]
RestrictNamespaces=mnt pid
RestrictNamespaces=~mnt usr
ExecStart=unshare -p -f
ExecStart=sh -c '! unshare -m -u -i -n'
Type=oneshot

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Test merging RestrictNamespaces= with OR
[Service]
RestrictNamespaces=mnt pid
RestrictNamespaces=mnt uts
ExecStart=unshare -m -u -p -f
ExecStart=sh -c '! unshare -u -i -n'
Type=oneshot