diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2019-01-28 17:17:23 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2019-01-28 17:17:23 +0300 |
commit | d60fbc6d4476982fb683d485859acd2c29a6837c (patch) | |
tree | 449dba554c836aa928b66a1850d55905f20032d9 /test/test_configuration.py | |
parent | 7dddfe2143e28dcde147d8420f0bd129babaec3a (diff) | |
download | unit-d60fbc6d4476982fb683d485859acd2c29a6837c.tar.gz unit-d60fbc6d4476982fb683d485859acd2c29a6837c.tar.bz2 |
Tests: large configuration tests.
Diffstat (limited to 'test/test_configuration.py')
-rw-r--r-- | test/test_configuration.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/test_configuration.py b/test/test_configuration.py index 02705afe..7f81b86b 100644 --- a/test/test_configuration.py +++ b/test/test_configuration.py @@ -217,5 +217,52 @@ 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'failed to apply new conf' + ]) + apps = 1000 + + conf = { + "applications": + {"app-" + str(a): { + "type": "python", + "processes": { "spare": 0 }, + "path": "/app", + "module": "wsgi" + } for a in range(apps) + }, + "listeners": { + "*:" + str(7080 + a): { + "application": "app-" + str(a) + } for a in range(apps) + } + } + + self.assertIn('success', self.conf(conf)) + if __name__ == '__main__': TestUnitConfiguration.main() |