当前位置: 首页>>代码示例>>Python>>正文


Python RemoteClient.get_boot_time方法代码示例

本文整理汇总了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)
开发者ID:vuntz,项目名称:tempest,代码行数:19,代码来源:test_server_actions.py

示例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)
开发者ID:Grindizer,项目名称:tempest,代码行数:19,代码来源:test_server_actions.py

示例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)
开发者ID:mindpool,项目名称:tempest,代码行数:21,代码来源:test_server_actions.py


注:本文中的tempest.common.utils.linux.remote_client.RemoteClient.get_boot_time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。