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)
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)
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)