test_ruby_isolation.py (1737:9be01e5d6ce5) test_ruby_isolation.py (1740:53149d20bb97)
1import shutil
2
3import os
4import pytest
5
1import shutil
2
3import os
4import pytest
5
6from conftest import unit_run
7from conftest import unit_stop
8from unit.applications.lang.ruby import TestApplicationRuby
6from unit.applications.lang.ruby import TestApplicationRuby
9from unit.feature.isolation import TestFeatureIsolation
10from unit.option import option
11
12
13class TestRubyIsolation(TestApplicationRuby):
14 prerequisites = {'modules': {'ruby': 'any'}, 'features': ['isolation']}
15
7from unit.option import option
8
9
10class TestRubyIsolation(TestApplicationRuby):
11 prerequisites = {'modules': {'ruby': 'any'}, 'features': ['isolation']}
12
16 @classmethod
17 def setup_class(cls, complete_check=True):
18 check = super().setup_class(complete_check=False)
19
20 unit = unit_run()
21 option.temp_dir = unit['temp_dir']
22
23 TestFeatureIsolation().check(option.available, unit['temp_dir'])
24
25 assert unit_stop() is None
26 shutil.rmtree(unit['temp_dir'])
27
28 return check if not complete_check else check()
29
30 def test_ruby_isolation_rootfs(self, is_su):
31 isolation_features = option.available['features']['isolation'].keys()
32
33 if not is_su:
34 if not 'unprivileged_userns_clone' in isolation_features:
35 pytest.skip('requires unprivileged userns or root')
36
37 if 'user' not in isolation_features:

--- 35 unchanged lines hidden ---
13 def test_ruby_isolation_rootfs(self, is_su):
14 isolation_features = option.available['features']['isolation'].keys()
15
16 if not is_su:
17 if not 'unprivileged_userns_clone' in isolation_features:
18 pytest.skip('requires unprivileged userns or root')
19
20 if 'user' not in isolation_features:

--- 35 unchanged lines hidden ---