test_python_isolation.py (1773:6c7e716cdec5) test_python_isolation.py (1774:8a90da5c0e24)
1
2import pytest
3from unit.applications.lang.python import TestApplicationPython
4from unit.option import option
5from unit.utils import findmnt
6from unit.utils import waitformount
7from unit.utils import waitforunmount
8

--- 74 unchanged lines hidden (view full) ---

83
84 assert findmnt().find(temp_dir) == -1
85 assert (self.get()['status'] == 200), 'enabled language_deps'
86 assert waitformount(temp_dir), 'language_deps mount'
87
88 self.conf({"listeners": {}, "applications": {}})
89
90 assert waitforunmount(temp_dir), 'language_deps unmount'
1
2import pytest
3from unit.applications.lang.python import TestApplicationPython
4from unit.option import option
5from unit.utils import findmnt
6from unit.utils import waitformount
7from unit.utils import waitforunmount
8

--- 74 unchanged lines hidden (view full) ---

83
84 assert findmnt().find(temp_dir) == -1
85 assert (self.get()['status'] == 200), 'enabled language_deps'
86 assert waitformount(temp_dir), 'language_deps mount'
87
88 self.conf({"listeners": {}, "applications": {}})
89
90 assert waitforunmount(temp_dir), 'language_deps unmount'
91
92 def test_python_isolation_procfs(self, is_su, temp_dir):
93 isolation_features = option.available['features']['isolation'].keys()
94
95 if not is_su:
96 pytest.skip('requires root')
97
98 isolation = {'rootfs': temp_dir, 'automount': {'procfs': False}}
99
100 self.load('ns_inspect', isolation=isolation)
101
102 assert (
103 self.getjson(url='/?path=/proc/self')['body']['FileExists']
104 == False
105 ), 'no /proc/self'
106
107 isolation['automount']['procfs'] = True
108
109 self.load('ns_inspect', isolation=isolation)
110
111 assert (
112 self.getjson(url='/?path=/proc/self')['body']['FileExists'] == True
113 ), '/proc/self'