test_python_isolation_chroot.py (1654:fc7d0578e124) test_python_isolation_chroot.py (1673:883f2f79c2f6)
1import pytest
2
3from unit.applications.lang.python import TestApplicationPython
4from unit.feature.isolation import TestFeatureIsolation
5
6
7class TestPythonIsolation(TestApplicationPython):
8 prerequisites = {'modules': {'python': 'any'}}

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

23
24 assert (
25 self.getjson(url='/?path=' + temp_dir)['body']['FileExists']
26 == False
27 ), 'temp_dir does not exists in rootfs'
28
29 assert (
30 self.getjson(url='/?path=/proc/self')['body']['FileExists']
1import pytest
2
3from unit.applications.lang.python import TestApplicationPython
4from unit.feature.isolation import TestFeatureIsolation
5
6
7class TestPythonIsolation(TestApplicationPython):
8 prerequisites = {'modules': {'python': 'any'}}

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

23
24 assert (
25 self.getjson(url='/?path=' + temp_dir)['body']['FileExists']
26 == False
27 ), 'temp_dir does not exists in rootfs'
28
29 assert (
30 self.getjson(url='/?path=/proc/self')['body']['FileExists']
31 == False
31 == True
32 ), 'no /proc/self'
33
34 assert (
35 self.getjson(url='/?path=/dev/pts')['body']['FileExists'] == False
36 ), 'no /dev/pts'
37
38 assert (
39 self.getjson(url='/?path=/sys/kernel')['body']['FileExists']
40 == False
41 ), 'no /sys/kernel'
42
43 ret = self.getjson(url='/?path=/app/python/ns_inspect')
44
45 assert (
46 ret['body']['FileExists'] == True
47 ), 'application exists in rootfs'
32 ), 'no /proc/self'
33
34 assert (
35 self.getjson(url='/?path=/dev/pts')['body']['FileExists'] == False
36 ), 'no /dev/pts'
37
38 assert (
39 self.getjson(url='/?path=/sys/kernel')['body']['FileExists']
40 == False
41 ), 'no /sys/kernel'
42
43 ret = self.getjson(url='/?path=/app/python/ns_inspect')
44
45 assert (
46 ret['body']['FileExists'] == True
47 ), 'application exists in rootfs'