diff options
| author | Andrei Belov <defan@nginx.com> | 2020-08-13 19:28:27 +0300 |
|---|---|---|
| committer | Andrei Belov <defan@nginx.com> | 2020-08-13 19:28:27 +0300 |
| commit | aff76e4f90b4e948c327ce2b021dc3203c33cbcd (patch) | |
| tree | 5bd6ac3aa92683777548472984c209bf26d8a971 /test/test_configuration.py | |
| parent | 04ce9f997e0e49e57ce4b5fc4aa98134232a1974 (diff) | |
| parent | 6473d4b65a99aa10d509220fb99d8c4f65631ed0 (diff) | |
| download | unit-aff76e4f90b4e948c327ce2b021dc3203c33cbcd.tar.gz unit-aff76e4f90b4e948c327ce2b021dc3203c33cbcd.tar.bz2 | |
Merged with the default branch.1.19.0-1
Diffstat (limited to 'test/test_configuration.py')
| -rw-r--r-- | test/test_configuration.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/test_configuration.py b/test/test_configuration.py index 0329ef5e..0b0c9c78 100644 --- a/test/test_configuration.py +++ b/test/test_configuration.py @@ -400,13 +400,42 @@ class TestConfiguration(TestControl): "path": "/app", "module": "wsgi", } - for a in range(999) + # Larger number of applications can cause test fail with default + # open files limit due to the lack of file descriptors. + for a in range(100) }, "listeners": {"*:7080": {"pass": "applications/app-1"}}, } self.assertIn('success', self.conf(conf)) + def test_unprivileged_user_error(self): + self.skip_alerts.extend( + [ + r'cannot set user "root"', + r'failed to apply new conf', + ] + ) + if self.is_su: + print('unprivileged tests, skip this') + raise unittest.SkipTest() + + self.assertIn( + 'error', + self.conf( + { + "app": { + "type": "external", + "processes": 1, + "executable": "/app", + "user": "root", + } + }, + 'applications', + ), + 'setting user', + ) + if __name__ == '__main__': TestConfiguration.main() |
