test_ruby_isolation.py (1654:fc7d0578e124) test_ruby_isolation.py (1672:1b93d4f6fc0a)
1import shutil
2
3import pytest
4
5from conftest import option
6from conftest import unit_run
7from conftest import unit_stop
8from unit.applications.lang.ruby import TestApplicationRuby

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

21
22 TestFeatureIsolation().check(option.available, unit['temp_dir'])
23
24 assert unit_stop() is None
25 shutil.rmtree(unit['temp_dir'])
26
27 return check if not complete_check else check()
28
1import shutil
2
3import pytest
4
5from conftest import option
6from conftest import unit_run
7from conftest import unit_stop
8from unit.applications.lang.ruby import TestApplicationRuby

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

21
22 TestFeatureIsolation().check(option.available, unit['temp_dir'])
23
24 assert unit_stop() is None
25 shutil.rmtree(unit['temp_dir'])
26
27 return check if not complete_check else check()
28
29 def test_ruby_isolation_rootfs(self, is_su):
29 def test_ruby_isolation_rootfs_mount_namespace(self, is_su):
30 isolation_features = option.available['features']['isolation'].keys()
31
32 if 'mnt' not in isolation_features:
33 pytest.skip('requires mnt ns')
34
35 if not is_su:
36 if 'user' not in isolation_features:
37 pytest.skip('requires unprivileged userns or root')

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

50 '"/ruby/status_int/config.ru"', 'applications/status_int/script',
51 )
52
53 assert 'success' in self.conf(
54 '"/ruby/status_int"', 'applications/status_int/working_directory',
55 )
56
57 assert self.get()['status'] == 200, 'status int'
30 isolation_features = option.available['features']['isolation'].keys()
31
32 if 'mnt' not in isolation_features:
33 pytest.skip('requires mnt ns')
34
35 if not is_su:
36 if 'user' not in isolation_features:
37 pytest.skip('requires unprivileged userns or root')

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

50 '"/ruby/status_int/config.ru"', 'applications/status_int/script',
51 )
52
53 assert 'success' in self.conf(
54 '"/ruby/status_int"', 'applications/status_int/working_directory',
55 )
56
57 assert self.get()['status'] == 200, 'status int'
58
59 def test_ruby_isolation_rootfs(self, is_su):
60 if not is_su:
61 pytest.skip('requires root')
62 return
63
64 isolation = {'rootfs': option.test_dir}
65
66 self.load('status_int', isolation=isolation)
67
68 assert 'success' in self.conf(
69 '"/ruby/status_int/config.ru"', 'applications/status_int/script',
70 )
71
72 assert 'success' in self.conf(
73 '"/ruby/status_int"', 'applications/status_int/working_directory',
74 )
75
76 assert self.get()['status'] == 200, 'status int'