本文整理汇总了Python中tempest.common.utils.linux.remote_client.RemoteClient.get_boot_time方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteClient.get_boot_time方法的具体用法?Python RemoteClient.get_boot_time怎么用?Python RemoteClient.get_boot_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tempest.common.utils.linux.remote_client.RemoteClient
的用法示例。
在下文中一共展示了RemoteClient.get_boot_time方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reboot_server_soft
# 需要导入模块: from tempest.common.utils.linux.remote_client import RemoteClient [as 别名]
# 或者: from tempest.common.utils.linux.remote_client.RemoteClient import get_boot_time [as 别名]
def test_reboot_server_soft(self):
# The server should be signaled to reboot gracefully
if self.run_ssh:
# Get the time the server was last rebooted,
resp, server = self.client.get_server(self.server_id)
linux_client = RemoteClient(server, self.ssh_user, self.password)
boot_time = linux_client.get_boot_time()
resp, body = self.client.reboot(self.server_id, 'SOFT')
self.assertEqual(202, resp.status)
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
if self.run_ssh:
# Log in and verify the boot time has changed
linux_client = RemoteClient(server, self.ssh_user, self.password)
new_boot_time = linux_client.get_boot_time()
self.assertGreater(new_boot_time, boot_time)
示例2: test_reboot_server_hard
# 需要导入模块: from tempest.common.utils.linux.remote_client import RemoteClient [as 别名]
# 或者: from tempest.common.utils.linux.remote_client.RemoteClient import get_boot_time [as 别名]
def test_reboot_server_hard(self):
# The server should be power cycled
if self.run_ssh:
# Get the time the server was last rebooted,
resp, server = self.client.get_server(self.server_id)
linux_client = RemoteClient(server, self.ssh_user, self.password)
boot_time = linux_client.get_boot_time()
resp, body = self.client.reboot(self.server_id, "HARD")
self.assertEqual(202, resp.status)
self.client.wait_for_server_status(self.server_id, "ACTIVE")
if self.run_ssh:
# Log in and verify the boot time has changed
linux_client = RemoteClient(server, self.ssh_user, self.password)
new_boot_time = linux_client.get_boot_time()
self.assertGreater(new_boot_time, boot_time)
示例3: test_reboot_server_soft
# 需要导入模块: from tempest.common.utils.linux.remote_client import RemoteClient [as 别名]
# 或者: from tempest.common.utils.linux.remote_client.RemoteClient import get_boot_time [as 别名]
def test_reboot_server_soft(self):
"""The server should be signaled to reboot gracefully"""
if self.run_ssh:
# Get the time the server was last rebooted,
# waiting for one minute as who doesn't have seconds precision
resp, server = self.client.get_server(self.server_id)
linux_client = RemoteClient(server, self.ssh_user, self.password)
boot_time = linux_client.get_boot_time()
time.sleep(60)
resp, body = self.client.reboot(self.server_id, 'SOFT')
self.assertEqual(202, resp.status)
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
if self.run_ssh:
# Log in and verify the boot time has changed
linux_client = RemoteClient(server, self.ssh_user, self.password)
new_boot_time = linux_client.get_boot_time()
self.assertGreater(new_boot_time, boot_time)