summaryrefslogtreecommitdiffhomepage
path: root/test/test_java_isolation_rootfs.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_java_isolation_rootfs.py')
-rw-r--r--test/test_java_isolation_rootfs.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/test/test_java_isolation_rootfs.py b/test/test_java_isolation_rootfs.py
index 28bc4a0d..bbd2c915 100644
--- a/test/test_java_isolation_rootfs.py
+++ b/test/test_java_isolation_rootfs.py
@@ -5,15 +5,12 @@ import pytest
from unit.applications.lang.java import TestApplicationJava
from unit.option import option
+prerequisites = {'modules': {'java': 'all'}, 'privileged_user': True}
-class TestJavaIsolationRootfs(TestApplicationJava):
- prerequisites = {'modules': {'java': 'all'}}
+class TestJavaIsolationRootfs(TestApplicationJava):
@pytest.fixture(autouse=True)
- def setup_method_fixture(self, is_su, temp_dir):
- if not is_su:
- pytest.skip('require root')
-
+ def setup_method_fixture(self, temp_dir):
os.makedirs(f'{temp_dir}/jars')
os.makedirs(f'{temp_dir}/tmp')
os.chmod(f'{temp_dir}/tmp', 0o777)
@@ -35,10 +32,7 @@ class TestJavaIsolationRootfs(TestApplicationJava):
except subprocess.CalledProcessError:
pytest.fail("Can't run mount process.")
- def teardown_method(self, is_su):
- if not is_su:
- return
-
+ def teardown_method(self):
try:
subprocess.run(
["umount", "--lazy", f"{option.temp_dir}/jars"],
@@ -51,13 +45,8 @@ class TestJavaIsolationRootfs(TestApplicationJava):
except subprocess.CalledProcessError:
pytest.fail("Can't run umount process.")
- def test_java_isolation_rootfs_chroot_war(self, is_su, temp_dir):
- if not is_su:
- pytest.skip('require root')
-
- isolation = {
- 'rootfs': temp_dir,
- }
+ def test_java_isolation_rootfs_chroot_war(self, temp_dir):
+ isolation = {'rootfs': temp_dir}
self.load('empty_war', isolation=isolation)