Skip to content

Commit

Permalink
test: Avoid sssd.service restart limit failure in check-system-realms
Browse files Browse the repository at this point in the history
Restarting sssd in a loop is prone to run into

> systemd[1]: sssd.service: Start request repeated too quickly.
> systemd[1]: sssd.service: Failed with result 'start-limit-hit'.
  • Loading branch information
martinpitt committed Nov 16, 2023
1 parent 350cd5c commit 68d2eb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/verify/check-system-realms
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ class CommonTests:
b.logout()

# wait until IPA user works
m.execute('while ! su - -c "echo %s | sudo -S true" %s@cockpit.lan; do sleep 5; sss_cache -E || true; systemctl try-restart sssd; done' % (
self.admin_password, self.admin_user), timeout=300)
m.execute(f'while ! su - -c "echo {self.admin_password} | sudo -S true" {self.admin_user}@cockpit.lan; do '
' sleep 5; sss_cache -E || true; systemctl reset-failed sssd; systemctl try-restart sssd; done',
timeout=300)

# change existing local "admin" home dir to domain "admin" user
m.execute(f"chown -R {self.admin_user}@cockpit.lan /home/admin")
Expand Down Expand Up @@ -370,7 +371,7 @@ class CommonTests:
with b.wait_timeout(300):
b.wait_not_present("#realms-join-dialog")
b.logout()
m.execute('while ! id alice; do sleep 5; systemctl restart sssd; done', timeout=300)
m.execute('while ! id alice; do sleep 5; systemctl reset-failed sssd; systemctl restart sssd; done', timeout=300)

# alice's certificate was written by testClientCertAuthentication()
alice_cert_key = ['--cert', "/var/tmp/alice.pem", '--key', "/var/tmp/alice.key"]
Expand Down

0 comments on commit 68d2eb7

Please sign in to comment.