Skip to content

Commit

Permalink
chore: update tests with updated sudoers conf
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Mar 15, 2020
1 parent 395b8df commit 1f0b78f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bench/tests/test_setup_production.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def assert_nginx_process(self):

def assert_sudoers(self, user):
sudoers_file = '/etc/sudoers.d/frappe'
service = bench.utils.which("service")
nginx = bench.utils.which("nginx")

self.assertTrue(self.file_exists(sudoers_file))

if os.environ.get("CI"):
Expand All @@ -69,9 +72,8 @@ def assert_sudoers(self, user):
with open(sudoers_file, 'r') as f:
sudoers = f.read()

self.assertTrue('{user} ALL = (root) NOPASSWD: /usr/sbin/service nginx *'.format(user=user) in sudoers)
self.assertTrue('{user} ALL = (root) NOPASSWD: /usr/bin/supervisorctl'.format(user=user) in sudoers)
self.assertTrue('{user} ALL = (root) NOPASSWD: /usr/sbin/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: {nginx}'.format(nginx=nginx, user=user) in sudoers)


def assert_supervisor_config(self, bench_name, use_rq=True):
Expand Down

0 comments on commit 1f0b78f

Please sign in to comment.