Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/31'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuhamedagic committed May 19, 2016
2 parents 6316bdd + c0b2b37 commit 9b227e9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/assertions.py
Expand Up @@ -8,7 +8,7 @@ def configFileMissingMyIP(self, config_file=None, lock_file=None):
self.run_booth(config_file=config_file, lock_file=lock_file,
expected_exitcode=1, expected_daemon=False)

expected_error = "ERROR: Cannot find myself in the configuration"
expected_error = "(ERROR|error): Cannot find myself in the configuration"
self.assertRegexpMatches(stderr, expected_error)

def assertLockFileError(self, config_file=None, config_text=None,
Expand Down
4 changes: 2 additions & 2 deletions test/serverenv.py
Expand Up @@ -136,14 +136,14 @@ def check_daemon_handling(self, runner, expected_daemon):
self.assertTrue(daemon_pid is not None, err)

daemon_running = self.is_pid_running_daemon(daemon_pid)
err = "pid in lock file should referred to a running daemon"
err = "pid in lock file should refer to a running daemon"
self.assertTrue(daemon_running, err)

if daemon_running:
self.kill_pid(int(daemon_pid))
time.sleep(1)
daemon_pid = self.get_daemon_pid_from_lock_file(runner.lock_file)
self.assertTrue(daemon_pid is not None,
self.assertTrue(daemon_pid is None,
'bnc#749763: lock file should vanish after daemon is killed')

def get_daemon_pid_from_lock_file(self, lock_file):
Expand Down
2 changes: 1 addition & 1 deletion test/servertests.py
Expand Up @@ -79,7 +79,7 @@ def test_missing_quotes(self):
if line_contains_IP:
self.assertRegexpMatches(
self.read_log(),
"ERROR: invalid config file format: unquoted '.'",
"(ERROR|error): invalid config file format: unquoted '.'",
'IP addresses need to be quoted'
)

Expand Down
6 changes: 4 additions & 2 deletions test/utils.py
Expand Up @@ -12,5 +12,7 @@ def get_IP():
(stdout, stderr, returncode) = run_cmd(['hostname', '-i'])
if returncode != 0:
raise RuntimeError, "Failed to run hostname -i:\n" + stderr
# in case multiple IP addresses are returned, use only the first.
return re.sub(r'\s.*', '', stdout)
# in case multiple IP addresses are returned, use only the first
# and also strip '%<device>' part possibly present with IPv6 address
ret = re.sub(r'\s.*', '', stdout)
return "::1" if '%' in ret else ret

0 comments on commit 9b227e9

Please sign in to comment.