diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2021-01-13 06:24:41 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2021-01-13 06:24:41 +0000 |
commit | 5d983ea762eba5fe26a07defbc09eeec8ecc5aeb (patch) | |
tree | dc495e26e40a2f6a10c1fa0faabe611d06a06d3c /test | |
parent | 22dac5bd62d19c0f8743b63ec8c47b3b071eb000 (diff) | |
download | unit-5d983ea762eba5fe26a07defbc09eeec8ecc5aeb.tar.gz unit-5d983ea762eba5fe26a07defbc09eeec8ecc5aeb.tar.bz2 |
Tests: added test for "procfs" option.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_python_isolation.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_python_isolation.py b/test/test_python_isolation.py index e1a42c98..680f2c03 100644 --- a/test/test_python_isolation.py +++ b/test/test_python_isolation.py @@ -88,3 +88,26 @@ class TestPythonIsolation(TestApplicationPython): self.conf({"listeners": {}, "applications": {}}) assert waitforunmount(temp_dir), 'language_deps unmount' + + def test_python_isolation_procfs(self, is_su, temp_dir): + isolation_features = option.available['features']['isolation'].keys() + + if not is_su: + pytest.skip('requires root') + + isolation = {'rootfs': temp_dir, 'automount': {'procfs': False}} + + self.load('ns_inspect', isolation=isolation) + + assert ( + self.getjson(url='/?path=/proc/self')['body']['FileExists'] + == False + ), 'no /proc/self' + + isolation['automount']['procfs'] = True + + self.load('ns_inspect', isolation=isolation) + + assert ( + self.getjson(url='/?path=/proc/self')['body']['FileExists'] == True + ), '/proc/self' |