summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/test_ruby_isolation.py7
-rw-r--r--test/unit/applications/lang/ruby.py16
-rw-r--r--test/unit/check/isolation.py7
3 files changed, 20 insertions, 10 deletions
diff --git a/test/test_ruby_isolation.py b/test/test_ruby_isolation.py
index 8443d857..f414d610 100644
--- a/test/test_ruby_isolation.py
+++ b/test/test_ruby_isolation.py
@@ -35,13 +35,6 @@ class TestRubyIsolation(TestApplicationRuby):
'pid': True,
}
- os.mkdir(option.temp_dir + '/ruby')
-
- shutil.copytree(
- option.test_dir + '/ruby/status_int',
- option.temp_dir + '/ruby/status_int',
- )
-
self.load('status_int', isolation=isolation)
assert 'success' in self.conf(
diff --git a/test/unit/applications/lang/ruby.py b/test/unit/applications/lang/ruby.py
index 02644584..d95d62b4 100644
--- a/test/unit/applications/lang/ruby.py
+++ b/test/unit/applications/lang/ruby.py
@@ -1,12 +1,26 @@
+import os
+import shutil
+
from unit.applications.proto import TestApplicationProto
from unit.option import option
+from unit.utils import public_dir
class TestApplicationRuby(TestApplicationProto):
application_type = "ruby"
+ def prepare_env(self, script):
+ shutil.copytree(
+ option.test_dir + '/ruby/' + script,
+ option.temp_dir + '/ruby/' + script
+ )
+
+ public_dir(option.temp_dir + '/ruby/' + script)
+
def load(self, script, name='config.ru', **kwargs):
- script_path = option.test_dir + '/ruby/' + script
+ self.prepare_env(script)
+
+ script_path = option.temp_dir + '/ruby/' + script
self._load_conf(
{
diff --git a/test/unit/check/isolation.py b/test/unit/check/isolation.py
index 7c83ae35..43c8842f 100644
--- a/test/unit/check/isolation.py
+++ b/test/unit/check/isolation.py
@@ -3,6 +3,7 @@ import os
from unit.applications.lang.go import TestApplicationGo
from unit.applications.lang.java import TestApplicationJava
+from unit.applications.lang.ruby import TestApplicationRuby
from unit.applications.lang.node import TestApplicationNode
from unit.applications.proto import TestApplicationProto
from unit.http import TestHTTP
@@ -65,14 +66,16 @@ def check_isolation():
}
elif 'ruby' in available['modules']:
+ TestApplicationRuby().prepare_env('empty')
+
conf = {
"listeners": {"*:7080": {"pass": "applications/empty"}},
"applications": {
"empty": {
"type": "ruby",
"processes": {"spare": 0},
- "working_directory": option.test_dir + "/ruby/empty",
- "script": option.test_dir + "/ruby/empty/config.ru",
+ "working_directory": option.temp_dir + "/ruby/empty",
+ "script": option.temp_dir + "/ruby/empty/config.ru",
"isolation": {"namespaces": {"credential": True}},
}
},