tox: fix the test suite

fix pep8 syntax (H904 Wrap long lines in parentheses instead of a backslash).

fix two regressions in test_os_svc_daemon.py introduced by
    Ibd491881d79160ad1457526d51512f5fc1cf9ea5:
  - ensure os-svc-daemon won't try to write in /etc/os-logging by passing
    the “-l” extra parameter.
  - fix the test_standard_upstart test from test_os_svc_daemon.py to
     match the expected outpout.

Change-Id: I113504947d126e9d91409f97f8291d5b8fc15c42
This commit is contained in:
Gonéri Le Bouder 2015-01-31 18:34:18 +01:00
parent e9baa4dae7
commit e58007c9c4
2 changed files with 13 additions and 6 deletions

View File

@ -93,10 +93,10 @@ for createuser in to_create:
else:
cmd = "GRANT %s ON *.*" % (privilege)
cmd_local = "%s TO `%s`@'localhost' IDENTIFIED BY '%s'" \
% (cmd, username, password)
cmd_global = "%s TO `%s`@'%%' IDENTIFIED BY '%s'" \
% (cmd, username, password)
cmd_local = ("%s TO `%s`@'localhost' IDENTIFIED BY '%s'" %
(cmd, username, password))
cmd_global = ("%s TO `%s`@'%%' IDENTIFIED BY '%s'" %
(cmd, username, password))
if opts.noop:
print(cmd_local)

View File

@ -24,6 +24,7 @@ class TestOsSvcDaemon(tests.base.ScriptTestBase):
self._stub_script('dib-init-system', 'echo systemd')
output = self._run_command(
['elements/os-svc-install/bin/os-svc-daemon',
'-l',
'-p',
'-n', 'foo',
'-u', 'bar',
@ -59,6 +60,7 @@ RequiredBy=foo.service
self._stub_script('dib-init-system', 'echo upstart')
output = self._run_command(
['elements/os-svc-install/bin/os-svc-daemon',
'-l',
'-p',
'-n', 'foo',
'-u', 'bar',
@ -78,8 +80,8 @@ end script
respawn
# the default post-start of 1 second sleep delays respawning enough to
# not hit the default of 10 times in 5 seconds. Make it 2 times in 5s.
respawn limit 2 5
# not hit the default of 10 times in 5 seconds. Make it 2 times in 10s.
respawn limit 2 10
exec start-stop-daemon --start -c bar --exec /opt/stack/venvs/bar/bin/baz -- a
@ -91,6 +93,7 @@ post-start exec sleep 1
self._stub_script('dib-init-system', 'echo systemd')
output = self._run_command(
['elements/os-svc-install/bin/os-svc-daemon',
'-l',
'-p',
'-n', 'foo',
'-u', 'bar',
@ -112,6 +115,7 @@ RequiredBy=foo.service
self._stub_script('dib-init-system', 'echo upstart')
output = self._run_command(
['elements/os-svc-install/bin/os-svc-daemon',
'-l',
'-p',
'-n', 'foo',
'-u', 'bar',
@ -134,6 +138,7 @@ end script
self._stub_script('dib-init-system', 'echo systemd')
output = self._run_command(
['elements/os-svc-install/bin/os-svc-daemon',
'-l',
'-p',
'-n', 'foo',
'-u', 'foo',
@ -146,6 +151,7 @@ end script
self._stub_script('dib-init-system', 'echo upstart')
output = self._run_command(
['elements/os-svc-install/bin/os-svc-daemon',
'-l',
'-p',
'-n', 'foo',
'-u', 'foo',
@ -182,6 +188,7 @@ end script
self._stub_script('dib-init-system', 'echo upstart')
output = self._run_command(
['elements/os-svc-install/bin/os-svc-daemon',
'-l',
'-p',
'-n', 'foo',
'-u', 'foo',