test: add tests for merging RestrictNamespaces=
This commit is contained in:
@@ -99,6 +99,9 @@ test_data_files = '''
|
||||
test-execute/exec-readonlypaths-with-bindpaths.service
|
||||
test-execute/exec-readonlypaths.service
|
||||
test-execute/exec-readwritepaths-mount-propagation.service
|
||||
test-execute/exec-restrictnamespaces-merge-all.service
|
||||
test-execute/exec-restrictnamespaces-merge-and.service
|
||||
test-execute/exec-restrictnamespaces-merge-or.service
|
||||
test-execute/exec-restrictnamespaces-mnt-blacklist.service
|
||||
test-execute/exec-restrictnamespaces-mnt.service
|
||||
test-execute/exec-restrictnamespaces-no.service
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user