Skip to content

Commit

Permalink
Tests: Restart systemd-journald instead of stop/start
Browse files Browse the repository at this point in the history
systemd-journald service by default is in running state.
The tests should restart the service after modifying configurations.

Signed-off-by: Kaushik Banerjee <[email protected]>

Reviewed-by: Anuj Borah <[email protected]>
(cherry picked from commit 0f351c2)
  • Loading branch information
kaushikub authored and jakub-vavra-cz committed Sep 2, 2024
1 parent aa94afc commit eda5e2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tests/multihost/alltests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,16 +1187,16 @@ def write_journalsssd(session_multihost, request):
contents = "DEBUG_LOGGER=--logger=journald"
session_multihost.client[0].put_file_contents('/etc/sysconfig/sssd',
contents)
start_journald = 'systemctl start systemd-journald'
session_multihost.client[0].run_command(start_journald)
restart_journald = 'systemctl restart systemd-journald'
session_multihost.client[0].run_command(restart_journald)

def remove_journalsssd():
""" Remove /etc/sysconfig/sssd"""
cmd = 'rm -f /etc/sysconfig/sssd'
stop_journald = 'systemctl stop systemd-journald'
restart_journald = 'systemctl restart systemd-journald'
restart_sssd = 'systemctl restart sssd'
session_multihost.client[0].run_command(cmd)
session_multihost.client[0].run_command(stop_journald)
session_multihost.client[0].run_command(restart_journald)
session_multihost.client[0].run_command(restart_sssd)
request.addfinalizer(remove_journalsssd)

Expand Down

0 comments on commit eda5e2e

Please sign in to comment.