@AfterGroups(groups = "live", alwaysRun = true) @Override protected void tearDown() { if (clientOption.isPresent()) { if (testServerId != null) { assertTrue(novaContext.getApi().getServerClientForZone(zone).deleteServer(testServerId)); } if (backupImageId != null) { imageClient.deleteImage(backupImageId); } } super.tearDown(); }
@BeforeGroups(groups = {"integration", "live"}) @Override public void setupContext() { super.setupContext(); zone = Iterables.getLast(novaContext.getApi().getConfiguredZones(), "nova"); serverClient = novaContext.getApi().getServerClientForZone(zone); extensionClient = novaContext.getApi().getExtensionClientForZone(zone); imageClient = novaContext.getApi().getImageClientForZone(zone); clientOption = novaContext.getApi().getAdminActionsExtensionForZone(zone); if (clientOption.isPresent()) { testServerId = createServerInZone(zone).getId(); } }