cmd = (utils.ShellQuoteArgs(["gnt-instance", "list", "-o", "status", name]) +
' | grep running')
- ret = StartSSH(master["primary"], cmd).wait()
+ ret = StartSSH(master.primary, cmd).wait()
return ret == 0
"""Removes the watcher daemon's state file.
"""
- AssertCommand([
- "bash", "-c",
- "rm -vf %s" % (pathutils.WATCHER_GROUP_STATE_FILE % "*-*-*-*"),
- ])
+ path = \
+ qa_utils.MakeNodePath(qa_config.GetMasterNode(),
+ pathutils.WATCHER_GROUP_STATE_FILE % "*-*-*-*")
+
+ AssertCommand(["bash", "-c", "rm -vf %s" % path])
def _RunWatcherDaemon():
AssertCommand(["gnt-cluster", "watcher", "pause", "4h"])
cmd = ["gnt-cluster", "watcher", "info"]
- output = GetCommandOutput(master["primary"],
+ output = GetCommandOutput(master.primary,
utils.ShellQuoteArgs(cmd))
AssertMatch(output, r"^.*\bis paused\b.*")
AssertCommand(["gnt-cluster", "watcher", "continue"])
cmd = ["gnt-cluster", "watcher", "info"]
- output = GetCommandOutput(master["primary"],
+ output = GetCommandOutput(master.primary,
utils.ShellQuoteArgs(cmd))
AssertMatch(output, r"^.*\bis not paused\b.*")
"""Test automatic restart of instance by ganeti-watcher.
"""
- inst_name = qa_utils.ResolveInstanceName(instance["name"])
+ inst_name = qa_utils.ResolveInstanceName(instance.name)
_ResetWatcherDaemon()
_ShutdownInstance(inst_name)
"""Test five consecutive instance failures.
"""
- inst_name = qa_utils.ResolveInstanceName(instance["name"])
+ inst_name = qa_utils.ResolveInstanceName(instance.name)
inst_was_running = bool(_InstanceRunning(inst_name))
_ResetWatcherDaemon()