public void testResetNetworkAndInjectNetworkInfo() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); assertTrue(api.resetNetwork(testServerId)); assertTrue(api.injectNetworkInfo(testServerId)); }
public void testResetNetworkAndInjectNetworkInfo() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); api.resetNetwork(testServerId); api.injectNetworkInfo(testServerId); }
public void testLockAndUnlock() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); // TODO should we be able to double-lock (as it were) assertTrue(api.unlock(testServerId)); assertTrue(api.unlock(testServerId)); assertTrue(api.lock(testServerId)); assertTrue(api.lock(testServerId)); assertTrue(api.unlock(testServerId)); assertTrue(api.unlock(testServerId)); }
@Test public void testCreateBackupOfServer() throws InterruptedException { skipOnAdminExtensionAbsent(); backupImageId = apiOption.get().createBackup(testServerId, "jclouds-test-backup", BackupType.DAILY, 0, CreateBackupOfServerOptions.Builder.metadata(ImmutableMap.of("test", "metadata"))); assertNotNull(backupImageId); // If we don't have extended task status, we'll have to wait here! if (extensionApi.get("OS-EXT-STS") == null) { Thread.sleep(30000); } blockUntilServerInState(testServerId, serverApi, Status.ACTIVE); Image backupImage = imageApi.get(backupImageId); assertEquals(backupImage.getId(), backupImageId); } }
@Test public void testCreateBackupOfServer() throws InterruptedException { skipOnAdminExtensionAbsent(); backupImageId = apiOption.get().createBackup(testServerId, "jclouds-test-backup", BackupType.DAILY, 0, CreateBackupOfServerOptions.Builder.metadata(ImmutableMap.of("test", "metadata"))); assertNotNull(backupImageId); // If we don't have extended task status, we'll have to wait here! if (extensionApi.get("OS-EXT-STS") == null) { Thread.sleep(30000); } blockUntilServerInState(testServerId, serverApi, Status.ACTIVE); Image backupImage = imageApi.get(backupImageId); assertEquals(backupImage.getId(), backupImageId); } }
@Test public void testPauseAndUnpause() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); // Unlock and lock (double-checking error contitions too) try { api.unpause(testServerId); fail("Unpaused active server!"); } catch (HttpResponseException e) { } assertTrue(api.pause(testServerId)); blockUntilServerInState(testServerId, serverApi, Status.PAUSED); try { api.pause(testServerId); fail("paused a paused server!"); } catch (HttpResponseException e) { } assertTrue(api.unpause(testServerId)); blockUntilServerInState(testServerId, serverApi, Status.ACTIVE); try { api.unpause(testServerId); fail("Unpaused a server we just unpaused!"); } catch (HttpResponseException e) { } }
public void testSuspendAndResume() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); // Suspend-resume try { api.resume(testServerId); fail("Resumed an active server!"); } catch (HttpResponseException e) { } assertTrue(api.suspend(testServerId)); blockUntilServerInState(testServerId, serverApi, Status.SUSPENDED); try { api.suspend(testServerId); fail("Suspended an already suspended server!"); } catch (HttpResponseException e) { } assertTrue(api.resume(testServerId)); blockUntilServerInState(testServerId, serverApi, Status.ACTIVE); try { api.resume(testServerId); fail("Resumed an already resumed server!"); } catch (HttpResponseException e) { } }
@Test public void testPauseAndUnpause() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); // Unlock and lock (double-checking error contitions too) try { api.unpause(testServerId); fail("Unpaused active server!"); } catch (HttpResponseException e) { } api.pause(testServerId); blockUntilServerInState(testServerId, serverApi, Status.PAUSED); try { api.pause(testServerId); fail("paused a paused server!"); } catch (HttpResponseException e) { } api.unpause(testServerId); blockUntilServerInState(testServerId, serverApi, Status.ACTIVE); try { api.unpause(testServerId); fail("Unpaused a server we just unpaused!"); } catch (HttpResponseException e) { } }
public void testLockAndUnlock() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); // TODO should we be able to double-lock (as it were) api.unlock(testServerId); api.unlock(testServerId); api.lock(testServerId); api.lock(testServerId); api.unlock(testServerId); api.unlock(testServerId); }
public void testSuspendAndResume() { skipOnAdminExtensionAbsent(); ServerAdminApi api = apiOption.get(); // Suspend-resume try { api.resume(testServerId); fail("Resumed an active server!"); } catch (HttpResponseException e) { } api.suspend(testServerId); blockUntilServerInState(testServerId, serverApi, Status.SUSPENDED); try { api.suspend(testServerId); fail("Suspended an already suspended server!"); } catch (HttpResponseException e) { } api.resume(testServerId); blockUntilServerInState(testServerId, serverApi, Status.ACTIVE); try { api.resume(testServerId); fail("Resumed an already resumed server!"); } catch (HttpResponseException e) { } }