wait for nextcloud-cron to finish in test
This commit is contained in:
parent
1d7d7d196a
commit
c34a2f4c58
1 changed files with 7 additions and 1 deletions
|
@ -13,6 +13,7 @@ let
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import time
|
||||||
|
|
||||||
start_all()
|
start_all()
|
||||||
server.wait_for_unit("phpfpm-nextcloud.service")
|
server.wait_for_unit("phpfpm-nextcloud.service")
|
||||||
|
@ -47,7 +48,12 @@ let
|
||||||
server.systemctl("start nextcloud-cron.service")
|
server.systemctl("start nextcloud-cron.service")
|
||||||
|
|
||||||
# If the service failed, then we're not happy.
|
# If the service failed, then we're not happy.
|
||||||
server.require_unit_state("nextcloud-cron", "inactive")
|
status = "active"
|
||||||
|
while status == "active":
|
||||||
|
status = server.get_unit_info("nextcloud-cron")["ActiveState"]
|
||||||
|
time.sleep(5)
|
||||||
|
if status != "inactive":
|
||||||
|
raise Exception("Cron job did not finish correctly")
|
||||||
|
|
||||||
if not find_in_logs("nextcloud-cron", "nextcloud-cron.service: Deactivated successfully."):
|
if not find_in_logs("nextcloud-cron", "nextcloud-cron.service: Deactivated successfully."):
|
||||||
raise Exception("Nextcloud cron job did not finish successfully.")
|
raise Exception("Nextcloud cron job did not finish successfully.")
|
||||||
|
|
Loading…
Reference in a new issue