summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/unit/applications/lang/ruby.py24
-rw-r--r--test/unit/applications/proto.py16
2 files changed, 24 insertions, 16 deletions
diff --git a/test/unit/applications/lang/ruby.py b/test/unit/applications/lang/ruby.py
index d95d62b4..61d50558 100644
--- a/test/unit/applications/lang/ruby.py
+++ b/test/unit/applications/lang/ruby.py
@@ -12,7 +12,7 @@ class TestApplicationRuby(TestApplicationProto):
def prepare_env(self, script):
shutil.copytree(
option.test_dir + '/ruby/' + script,
- option.temp_dir + '/ruby/' + script
+ option.temp_dir + '/ruby/' + script,
)
public_dir(option.temp_dir + '/ruby/' + script)
@@ -22,17 +22,23 @@ class TestApplicationRuby(TestApplicationProto):
script_path = option.temp_dir + '/ruby/' + script
+ app = {
+ "type": self.get_application_type(),
+ "processes": {"spare": 0},
+ "working_directory": script_path,
+ "script": script_path + '/' + name,
+ }
+
+ for key in [
+ 'hooks',
+ ]:
+ if key in kwargs:
+ app[key] = kwargs[key]
+
self._load_conf(
{
"listeners": {"*:7080": {"pass": "applications/" + script}},
- "applications": {
- script: {
- "type": self.get_application_type(),
- "processes": {"spare": 0},
- "working_directory": script_path,
- "script": script_path + '/' + name,
- }
- },
+ "applications": {script: app},
},
**kwargs
)
diff --git a/test/unit/applications/proto.py b/test/unit/applications/proto.py
index 92754c03..e30d21ff 100644
--- a/test/unit/applications/proto.py
+++ b/test/unit/applications/proto.py
@@ -47,13 +47,15 @@ class TestApplicationProto(TestControl):
if 'applications' in conf:
for app in conf['applications'].keys():
app_conf = conf['applications'][app]
- if 'user' in kwargs:
- app_conf['user'] = kwargs['user']
- if 'group' in kwargs:
- app_conf['group'] = kwargs['group']
-
- if 'isolation' in kwargs:
- app_conf['isolation'] = kwargs['isolation']
+ for key in [
+ 'user',
+ 'group',
+ 'isolation',
+ 'processes',
+ 'threads',
+ ]:
+ if key in kwargs:
+ app_conf[key] = kwargs[key]
assert 'success' in self.conf(conf), 'load application configuration'