summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri.lebouder@enovance.com>2015-01-31 18:34:18 +0100
committerGonéri Le Bouder <goneri.lebouder@enovance.com>2015-02-02 12:05:21 +0000
commite58007c9c45dbf34900b96b7205374a28644ad83 (patch)
tree801f53f65f3b84b451f0e5ad0d32a6710f4c0b5d
parente9baa4dae7e24a5863676a8482e1b6c805830c0f (diff)
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
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Ghe Rivero <ghe.rivero@gmail.com> Code-Review+1: Marios Andreou <marios@redhat.com> Code-Review+2: Steve Kowalik <steven@wedontsleep.org> Workflow+1: Steve Kowalik <steven@wedontsleep.org> Code-Review+2: James Polley <jp@jamezpolley.com> Code-Review+1: Stephanie Miller <stephane@alum.mit.edu> Submitted-by: Jenkins Submitted-at: Wed, 11 Feb 2015 07:11:14 +0000 Reviewed-on: https://review.openstack.org/151885 Project: openstack/tripleo-image-elements Branch: refs/heads/master
-rwxr-xr-xelements/mysql-common/os-refresh-config/post-configure.d/50-mysql-users8
-rw-r--r--elements/os-svc-install/tests/test_os_svc_daemon.py11
2 files changed, 13 insertions, 6 deletions
diff --git a/elements/mysql-common/os-refresh-config/post-configure.d/50-mysql-users b/elements/mysql-common/os-refresh-config/post-configure.d/50-mysql-users
index fcf3f97..86c5ea0 100755
--- a/elements/mysql-common/os-refresh-config/post-configure.d/50-mysql-users
+++ b/elements/mysql-common/os-refresh-config/post-configure.d/50-mysql-users
@@ -93,10 +93,10 @@ for createuser in to_create:
93 else: 93 else:
94 cmd = "GRANT %s ON *.*" % (privilege) 94 cmd = "GRANT %s ON *.*" % (privilege)
95 95
96 cmd_local = "%s TO `%s`@'localhost' IDENTIFIED BY '%s'" \ 96 cmd_local = ("%s TO `%s`@'localhost' IDENTIFIED BY '%s'" %
97 % (cmd, username, password) 97 (cmd, username, password))
98 cmd_global = "%s TO `%s`@'%%' IDENTIFIED BY '%s'" \ 98 cmd_global = ("%s TO `%s`@'%%' IDENTIFIED BY '%s'" %
99 % (cmd, username, password) 99 (cmd, username, password))
100 100
101 if opts.noop: 101 if opts.noop:
102 print(cmd_local) 102 print(cmd_local)
diff --git a/elements/os-svc-install/tests/test_os_svc_daemon.py b/elements/os-svc-install/tests/test_os_svc_daemon.py
index 6a94686..5a439b7 100644
--- a/elements/os-svc-install/tests/test_os_svc_daemon.py
+++ b/elements/os-svc-install/tests/test_os_svc_daemon.py
@@ -24,6 +24,7 @@ class TestOsSvcDaemon(tests.base.ScriptTestBase):
24 self._stub_script('dib-init-system', 'echo systemd') 24 self._stub_script('dib-init-system', 'echo systemd')
25 output = self._run_command( 25 output = self._run_command(
26 ['elements/os-svc-install/bin/os-svc-daemon', 26 ['elements/os-svc-install/bin/os-svc-daemon',
27 '-l',
27 '-p', 28 '-p',
28 '-n', 'foo', 29 '-n', 'foo',
29 '-u', 'bar', 30 '-u', 'bar',
@@ -59,6 +60,7 @@ RequiredBy=foo.service
59 self._stub_script('dib-init-system', 'echo upstart') 60 self._stub_script('dib-init-system', 'echo upstart')
60 output = self._run_command( 61 output = self._run_command(
61 ['elements/os-svc-install/bin/os-svc-daemon', 62 ['elements/os-svc-install/bin/os-svc-daemon',
63 '-l',
62 '-p', 64 '-p',
63 '-n', 'foo', 65 '-n', 'foo',
64 '-u', 'bar', 66 '-u', 'bar',
@@ -78,8 +80,8 @@ end script
78 80
79respawn 81respawn
80# the default post-start of 1 second sleep delays respawning enough to 82# the default post-start of 1 second sleep delays respawning enough to
81# not hit the default of 10 times in 5 seconds. Make it 2 times in 5s. 83# not hit the default of 10 times in 5 seconds. Make it 2 times in 10s.
82respawn limit 2 5 84respawn limit 2 10
83 85
84exec start-stop-daemon --start -c bar --exec /opt/stack/venvs/bar/bin/baz -- a 86exec start-stop-daemon --start -c bar --exec /opt/stack/venvs/bar/bin/baz -- a
85 87
@@ -91,6 +93,7 @@ post-start exec sleep 1
91 self._stub_script('dib-init-system', 'echo systemd') 93 self._stub_script('dib-init-system', 'echo systemd')
92 output = self._run_command( 94 output = self._run_command(
93 ['elements/os-svc-install/bin/os-svc-daemon', 95 ['elements/os-svc-install/bin/os-svc-daemon',
96 '-l',
94 '-p', 97 '-p',
95 '-n', 'foo', 98 '-n', 'foo',
96 '-u', 'bar', 99 '-u', 'bar',
@@ -112,6 +115,7 @@ RequiredBy=foo.service
112 self._stub_script('dib-init-system', 'echo upstart') 115 self._stub_script('dib-init-system', 'echo upstart')
113 output = self._run_command( 116 output = self._run_command(
114 ['elements/os-svc-install/bin/os-svc-daemon', 117 ['elements/os-svc-install/bin/os-svc-daemon',
118 '-l',
115 '-p', 119 '-p',
116 '-n', 'foo', 120 '-n', 'foo',
117 '-u', 'bar', 121 '-u', 'bar',
@@ -134,6 +138,7 @@ end script
134 self._stub_script('dib-init-system', 'echo systemd') 138 self._stub_script('dib-init-system', 'echo systemd')
135 output = self._run_command( 139 output = self._run_command(
136 ['elements/os-svc-install/bin/os-svc-daemon', 140 ['elements/os-svc-install/bin/os-svc-daemon',
141 '-l',
137 '-p', 142 '-p',
138 '-n', 'foo', 143 '-n', 'foo',
139 '-u', 'foo', 144 '-u', 'foo',
@@ -146,6 +151,7 @@ end script
146 self._stub_script('dib-init-system', 'echo upstart') 151 self._stub_script('dib-init-system', 'echo upstart')
147 output = self._run_command( 152 output = self._run_command(
148 ['elements/os-svc-install/bin/os-svc-daemon', 153 ['elements/os-svc-install/bin/os-svc-daemon',
154 '-l',
149 '-p', 155 '-p',
150 '-n', 'foo', 156 '-n', 'foo',
151 '-u', 'foo', 157 '-u', 'foo',
@@ -182,6 +188,7 @@ end script
182 self._stub_script('dib-init-system', 'echo upstart') 188 self._stub_script('dib-init-system', 'echo upstart')
183 output = self._run_command( 189 output = self._run_command(
184 ['elements/os-svc-install/bin/os-svc-daemon', 190 ['elements/os-svc-install/bin/os-svc-daemon',
191 '-l',
185 '-p', 192 '-p',
186 '-n', 'foo', 193 '-n', 'foo',
187 '-u', 'foo', 194 '-u', 'foo',