summaryrefslogtreecommitdiffhomepage
path: root/test/test_configuration.py
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2019-03-01 18:30:09 +0300
committerAndrei Belov <defan@nginx.com>2019-03-01 18:30:09 +0300
commit3c3720cba7154bc168cbd00c74817626bb53e140 (patch)
treeda1500f7c6bd5e90ecf45299b6f4b19a29d521cd /test/test_configuration.py
parent315a864c27aa27a48c013c4a1ef67a099ffea894 (diff)
parentdf02b03824065389c73213b19736140442cf63bc (diff)
downloadunit-3c3720cba7154bc168cbd00c74817626bb53e140.tar.gz
unit-3c3720cba7154bc168cbd00c74817626bb53e140.tar.bz2
Merged with the default branch.
Diffstat (limited to 'test/test_configuration.py')
-rw-r--r--test/test_configuration.py49
1 files changed, 48 insertions, 1 deletions
diff --git a/test/test_configuration.py b/test/test_configuration.py
index 02705afe..52a67d38 100644
--- a/test/test_configuration.py
+++ b/test/test_configuration.py
@@ -132,7 +132,6 @@ class TestUnitConfiguration(unit.TestUnitControl):
self.skip_sanitizer = True
self.skip_alerts.extend([
r'failed to apply previous configuration',
- r'sendmsg.+failed',
r'process \d+ exited on signal'
])
@@ -217,5 +216,53 @@ class TestUnitConfiguration(unit.TestUnitControl):
}
}), 'no port')
+ @unittest.expectedFailure
+ def test_json_application_name_large(self):
+ self.skip_alerts.append(r'epoll_ctl.+failed')
+ name = "X" * 1024 * 1024
+
+ self.assertIn('success', self.conf({
+ "listeners": {
+ "*:7080": {
+ "application": name
+ }
+ },
+ "applications": {
+ name: {
+ "type": "python",
+ "processes": { "spare": 0 },
+ "path": "/app",
+ "module": "wsgi"
+ }
+ }
+ }))
+
+ @unittest.expectedFailure
+ def test_json_application_many(self):
+ self.skip_alerts.extend([
+ r'eventfd.+failed',
+ r'epoll_create.+failed',
+ r'failed to apply new conf'
+ ])
+ apps = 999
+
+ conf = {
+ "applications":
+ {"app-" + str(a): {
+ "type": "python",
+ "processes": { "spare": 0 },
+ "path": "/app",
+ "module": "wsgi"
+ } for a in range(apps)
+ },
+ "listeners": {
+ "*:" + str(7000 + a): {
+ "application": "app-" + str(a)
+ } for a in range(apps)
+ }
+ }
+
+ self.assertIn('success', self.conf(conf))
+
if __name__ == '__main__':
TestUnitConfiguration.main()