From: Patrick Donnelly Date: Mon, 1 Jul 2019 18:21:13 +0000 (-0700) Subject: qa: use hard_reset to reboot kclient X-Git-Tag: v15.1.0~2037^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b75544be86ba3300d386d1039fa3059afff085e9;p=ceph.git qa: use hard_reset to reboot kclient power_off may allow the mounts to gracefully unmount. We don't want this if the kclient is stuck or we desire the client to "disappear" and come back. Fixes: http://tracker.ceph.com/issues/37681 Depends-on: https://github.com/ceph/teuthology/pull/1296 Signed-off-by: Patrick Donnelly --- diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index 6b128f57247d..950a1137d1b7 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -1,6 +1,7 @@ from StringIO import StringIO import json import logging +import time from textwrap import dedent from teuthology.orchestra.run import CommandFailedError from teuthology import misc @@ -176,21 +177,31 @@ class KernelMount(CephFSMount): self.ipmi_user, self.ipmi_password, self.ipmi_domain) - con.power_off() + con.hard_reset(wait_for_login=False) self.mounted = False def kill_cleanup(self): assert not self.mounted - con = orchestra_remote.getRemoteConsole(self.client_remote.hostname, - self.ipmi_user, - self.ipmi_password, - self.ipmi_domain) - con.power_on() + # We need to do a sleep here because we don't know how long it will + # take for a hard_reset to be effected. + time.sleep(30) - # Wait for node to come back up after reboot - misc.reconnect(None, 300, [self.client_remote]) + try: + # Wait for node to come back up after reboot + misc.reconnect(None, 300, [self.client_remote]) + except: + # attempt to get some useful debug output: + con = orchestra_remote.getRemoteConsole(self.client_remote.hostname, + self.ipmi_user, + self.ipmi_password, + self.ipmi_domain) + con.check_status(timeout=60) + raise + + # Remove mount directory + self.client_remote.run(args=['uptime'], timeout=10) # Remove mount directory self.client_remote.run(