mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 09:02:10 +00:00
chore: update tests with updated sudoers conf
This commit is contained in:
parent
395b8df895
commit
1f0b78f2fe
@ -61,6 +61,9 @@ class TestSetupProduction(TestBenchBase):
|
|||||||
|
|
||||||
def assert_sudoers(self, user):
|
def assert_sudoers(self, user):
|
||||||
sudoers_file = '/etc/sudoers.d/frappe'
|
sudoers_file = '/etc/sudoers.d/frappe'
|
||||||
|
service = bench.utils.which("service")
|
||||||
|
nginx = bench.utils.which("nginx")
|
||||||
|
|
||||||
self.assertTrue(self.file_exists(sudoers_file))
|
self.assertTrue(self.file_exists(sudoers_file))
|
||||||
|
|
||||||
if os.environ.get("CI"):
|
if os.environ.get("CI"):
|
||||||
@ -69,9 +72,8 @@ class TestSetupProduction(TestBenchBase):
|
|||||||
with open(sudoers_file, 'r') as f:
|
with open(sudoers_file, 'r') as f:
|
||||||
sudoers = f.read()
|
sudoers = f.read()
|
||||||
|
|
||||||
self.assertTrue('{user} ALL = (root) NOPASSWD: /usr/sbin/service nginx *'.format(user=user) in sudoers)
|
self.assertTrue('{user} ALL = (root) NOPASSWD: {service} nginx *'.format(service=service, user=user) in sudoers)
|
||||||
self.assertTrue('{user} ALL = (root) NOPASSWD: /usr/bin/supervisorctl'.format(user=user) in sudoers)
|
self.assertTrue('{user} ALL = (root) NOPASSWD: {nginx}'.format(nginx=nginx, user=user) in sudoers)
|
||||||
self.assertTrue('{user} ALL = (root) NOPASSWD: /usr/sbin/nginx'.format(user=user) in sudoers)
|
|
||||||
|
|
||||||
|
|
||||||
def assert_supervisor_config(self, bench_name, use_rq=True):
|
def assert_supervisor_config(self, bench_name, use_rq=True):
|
||||||
|
Loading…
Reference in New Issue
Block a user