Skip to content

Commit

Permalink
[test] Fix mutex test
Browse files Browse the repository at this point in the history
  • Loading branch information
cgalibern committed Aug 2, 2021
1 parent dfed3d4 commit d8afb49
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions opensvc/tests/commands/daemon/test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,15 @@ def daemon_start_native(_):
status = json.load(status_file)
print(status)
assert len(status) > 0, "no mutexes returned"
for name, value in status.get_items():
assert "unlocked" in value, "'%s' mutex is not unlocked, value: '%s'" % (name, value)
mutex_busy = 0
mutex_free = 0
for name, value in status.items():
if "owner=None" in value or "unlocked" in value:
mutex_free =+ 1
else:
mutex_busy =+ 1
assert mutex_free > mutex_busy, \
"found more busy than free mutexes: \n%s" % status
assert len([k for k in status.keys() if "logger" in k]) > 0, "no logger in mutexes"

print('daemon status...')
Expand Down

0 comments on commit d8afb49

Please sign in to comment.