Tests: set root by unprivilaged user.

This commit is contained in:
Tiago Natel de Moura
2020-08-13 12:17:15 +01:00
parent 8032686a57
commit 479fdff39d

View File

@@ -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()