1
0
Fork 0

wait for nextcloud-cron to finish in test

This commit is contained in:
ibizaman 2024-05-29 14:43:12 -07:00 committed by Pierre Penninckx
parent 1d7d7d196a
commit c34a2f4c58

View file

@ -13,6 +13,7 @@ let
import json
import os
import pathlib
import time
start_all()
server.wait_for_unit("phpfpm-nextcloud.service")
@ -47,7 +48,12 @@ let
server.systemctl("start nextcloud-cron.service")
# 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."):
raise Exception("Nextcloud cron job did not finish successfully.")