diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2020-12-09 16:15:50 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2020-12-09 16:15:50 +0000 |
commit | 4c846ae69308983050a55f6467c2d53e78120e0b (patch) | |
tree | e3554147a322a883fb63cdfd7d1740980da12589 /test/test_go_isolation.py | |
parent | 783cdc2a3d99bd9fb8d75218d679ddb571420e98 (diff) | |
download | unit-4c846ae69308983050a55f6467c2d53e78120e0b.tar.gz unit-4c846ae69308983050a55f6467c2d53e78120e0b.tar.bz2 |
Tests: isolation check moved to the pytest_sessionstart().
This change eliminates the need for some classes
to run Unit one more time before running tests.
Diffstat (limited to 'test/test_go_isolation.py')
-rw-r--r-- | test/test_go_isolation.py | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/test/test_go_isolation.py b/test/test_go_isolation.py index ac12c8ca..48c1b80c 100644 --- a/test/test_go_isolation.py +++ b/test/test_go_isolation.py @@ -5,31 +5,13 @@ import shutil import pytest -from conftest import unit_run -from conftest import unit_stop from unit.applications.lang.go import TestApplicationGo -from unit.feature.isolation import TestFeatureIsolation from unit.option import option +from unit.utils import getns class TestGoIsolation(TestApplicationGo): prerequisites = {'modules': {'go': 'any'}, 'features': ['isolation']} - isolation = TestFeatureIsolation() - - @classmethod - def setup_class(cls, complete_check=True): - check = super().setup_class(complete_check=False) - - unit = unit_run() - option.temp_dir = unit['temp_dir'] - - TestFeatureIsolation().check(option.available, unit['temp_dir']) - - assert unit_stop() is None - shutil.rmtree(unit['temp_dir']) - - return check if not complete_check else check() - def unpriv_creds(self): nobody_uid = pwd.getpwnam('nobody').pw_uid @@ -219,8 +201,8 @@ class TestGoIsolation(TestApplicationGo): == option.available['features']['isolation'][ns] ), ('%s match' % ns) - assert obj['NS']['MNT'] != self.isolation.getns('mnt'), 'mnt set' - assert obj['NS']['USER'] != self.isolation.getns('user'), 'user set' + assert obj['NS']['MNT'] != getns('mnt'), 'mnt set' + assert obj['NS']['USER'] != getns('user'), 'user set' def test_isolation_pid(self, is_su): if not self.isolation_key('pid'): |