summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-10-06 20:30:51 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-10-06 20:30:51 +0100
commit37390d2a3be3646ad5a4c52d46ce93fc8f8a416b (patch)
treef2d02f181ffea5bf3e513b7408bbb73430071917
parent703d79042b8dd161e7c53d485b90af2b926148e6 (diff)
downloadunit-37390d2a3be3646ad5a4c52d46ce93fc8f8a416b.tar.gz
unit-37390d2a3be3646ad5a4c52d46ce93fc8f8a416b.tar.bz2
Tests: fixed tests to run as root.
Diffstat (limited to '')
-rw-r--r--test/test_asgi_lifespan.py4
-rw-r--r--test/test_ruby_isolation.py8
2 files changed, 4 insertions, 8 deletions
diff --git a/test/test_asgi_lifespan.py b/test/test_asgi_lifespan.py
index 2fbc68f8..3d6fdcce 100644
--- a/test/test_asgi_lifespan.py
+++ b/test/test_asgi_lifespan.py
@@ -3,7 +3,7 @@ import pytest
from distutils.version import LooseVersion
from unit.applications.lang.python import TestApplicationPython
-from conftest import option
+from conftest import option, public_dir
class TestASGILifespan(TestApplicationPython):
@@ -23,6 +23,8 @@ class TestASGILifespan(TestApplicationPython):
open(shutdown_path, 'a').close()
open(version_path, 'a').close()
+ public_dir(option.test_dir + '/python/lifespan/empty')
+
assert self.get()['status'] == 204
self.stop()
diff --git a/test/test_ruby_isolation.py b/test/test_ruby_isolation.py
index be20300e..e88c60b2 100644
--- a/test/test_ruby_isolation.py
+++ b/test/test_ruby_isolation.py
@@ -33,15 +33,9 @@ class TestRubyIsolation(TestApplicationRuby):
if not 'unprivileged_userns_clone' in isolation_features:
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 = {
'namespaces': {'credential': not is_su, 'mount': True},
- 'rootfs': self.temp_dir,
+ 'rootfs': option.test_dir,
}
self.load('status_int', isolation=isolation)