summaryrefslogtreecommitdiffhomepage
path: root/test/test_java_isolation_rootfs.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-10-19 22:25:29 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-10-19 22:25:29 +0100
commit54837759f36eddb80af22c8d73e103a948221dc7 (patch)
tree420c6ce21ad3868db4037d160406f7754bb392e5 /test/test_java_isolation_rootfs.py
parentd8628a43d0705deeb3473faf0252288038defc2b (diff)
downloadunit-54837759f36eddb80af22c8d73e103a948221dc7.tar.gz
unit-54837759f36eddb80af22c8d73e103a948221dc7.tar.bz2
Tests: fixed unit.log print.
Diffstat (limited to 'test/test_java_isolation_rootfs.py')
-rw-r--r--test/test_java_isolation_rootfs.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/test/test_java_isolation_rootfs.py b/test/test_java_isolation_rootfs.py
index f0f04df1..4f9e9834 100644
--- a/test/test_java_isolation_rootfs.py
+++ b/test/test_java_isolation_rootfs.py
@@ -11,14 +11,12 @@ class TestJavaIsolationRootfs(TestApplicationJava):
prerequisites = {'modules': {'java': 'all'}}
def setup_method(self, is_su):
- super().setup_method()
-
if not is_su:
return
- os.makedirs(self.temp_dir + '/jars')
- os.makedirs(self.temp_dir + '/tmp')
- os.chmod(self.temp_dir + '/tmp', 0o777)
+ os.makedirs(option.temp_dir + '/jars')
+ os.makedirs(option.temp_dir + '/tmp')
+ os.chmod(option.temp_dir + '/tmp', 0o777)
try:
process = subprocess.Popen(
@@ -26,7 +24,7 @@ class TestJavaIsolationRootfs(TestApplicationJava):
"mount",
"--bind",
option.current_dir + "/build",
- self.temp_dir + "/jars",
+ option.temp_dir + "/jars",
],
stderr=subprocess.STDOUT,
)
@@ -42,7 +40,7 @@ class TestJavaIsolationRootfs(TestApplicationJava):
try:
process = subprocess.Popen(
- ["umount", "--lazy", self.temp_dir + "/jars"],
+ ["umount", "--lazy", option.temp_dir + "/jars"],
stderr=subprocess.STDOUT,
)
@@ -51,15 +49,12 @@ class TestJavaIsolationRootfs(TestApplicationJava):
except:
pytest.fail('Cann\'t run mount process.')
- # super teardown must happen after unmount to avoid deletion of /build
- super().teardown_method()
-
- def test_java_isolation_rootfs_chroot_war(self, is_su):
+ def test_java_isolation_rootfs_chroot_war(self, is_su, temp_dir):
if not is_su:
pytest.skip('require root')
isolation = {
- 'rootfs': self.temp_dir,
+ 'rootfs': temp_dir,
}
self.load('empty_war', isolation=isolation)