def TestHookSucceeded():
  master = GetMasterNode().primary
  job_id = ExecuteJobProducingCommand("gnt-debug delay --submit 1")
  time.sleep(3)
  AssertEqual(IsFileExists(master, _GetHookFilePath(job_id, "pre")), True,
              "Global pre hook hasn't been executed.")
  AssertEqual(IsFileExists(master, _GetHookFilePath(job_id, "post",
                           constants.POST_HOOKS_STATUS_SUCCESS)), True,
              "Global post hook hasn't been executed with status *success*")
  AssertEqual(IsFileExists(master, _GetHookFilePath(job_id, "post",
                           constants.POST_HOOKS_STATUS_ERROR)), False,
              "Global post hook has been executed with status *error*")
  AssertEqual(IsFileExists(master, _GetHookFilePath(job_id, "post",
                           constants.POST_HOOKS_STATUS_DISAPPEARED)), False,
              "Global post hook has been executed with status *disappeared*")
Checks whether the global hooks have been executed (status succes).
dataset/ETHPy150Open ganeti/ganeti/qa/qa_global_hooks.py/TestHookSucceeded