Tests: fixed tests to run as root.
This commit is contained in:
@@ -3,7 +3,7 @@ import pytest
|
|||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
from unit.applications.lang.python import TestApplicationPython
|
from unit.applications.lang.python import TestApplicationPython
|
||||||
from conftest import option
|
from conftest import option, public_dir
|
||||||
|
|
||||||
|
|
||||||
class TestASGILifespan(TestApplicationPython):
|
class TestASGILifespan(TestApplicationPython):
|
||||||
@@ -23,6 +23,8 @@ class TestASGILifespan(TestApplicationPython):
|
|||||||
open(shutdown_path, 'a').close()
|
open(shutdown_path, 'a').close()
|
||||||
open(version_path, 'a').close()
|
open(version_path, 'a').close()
|
||||||
|
|
||||||
|
public_dir(option.test_dir + '/python/lifespan/empty')
|
||||||
|
|
||||||
assert self.get()['status'] == 204
|
assert self.get()['status'] == 204
|
||||||
|
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|||||||
@@ -33,15 +33,9 @@ class TestRubyIsolation(TestApplicationRuby):
|
|||||||
if not 'unprivileged_userns_clone' in isolation_features:
|
if not 'unprivileged_userns_clone' in isolation_features:
|
||||||
pytest.skip('requires unprivileged userns or root')
|
pytest.skip('requires unprivileged userns or root')
|
||||||
|
|
||||||
os.mkdir(self.temp_dir + '/ruby')
|
|
||||||
|
|
||||||
shutil.copytree(
|
|
||||||
option.test_dir + '/ruby/status_int',
|
|
||||||
self.temp_dir + '/ruby/status_int',
|
|
||||||
)
|
|
||||||
isolation = {
|
isolation = {
|
||||||
'namespaces': {'credential': not is_su, 'mount': True},
|
'namespaces': {'credential': not is_su, 'mount': True},
|
||||||
'rootfs': self.temp_dir,
|
'rootfs': option.test_dir,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.load('status_int', isolation=isolation)
|
self.load('status_int', isolation=isolation)
|
||||||
|
|||||||
Reference in New Issue
Block a user