summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2020-08-13 12:17:15 +0100
committerTiago Natel de Moura <t.nateldemoura@f5.com>2020-08-13 12:17:15 +0100
commit479fdff39d3d213c6067ca34ef3b7476bd2b7826 (patch)
treee2b15337bc03468ff5af9ed46eb0be93bfd83b4b
parent8032686a57c739d673e5554ba8517a4076f9e742 (diff)
downloadunit-479fdff39d3d213c6067ca34ef3b7476bd2b7826.tar.gz
unit-479fdff39d3d213c6067ca34ef3b7476bd2b7826.tar.bz2
Tests: set root by unprivilaged user.
Diffstat (limited to '')
-rw-r--r--test/test_configuration.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test_configuration.py b/test/test_configuration.py
index fec1b3dc..0b0c9c78 100644
--- a/test/test_configuration.py
+++ b/test/test_configuration.py
@@ -409,6 +409,33 @@ class TestConfiguration(TestControl):
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()