From 715994b1254d32ebb2404f1ab0d302f21eab5118 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Wed, 29 Nov 2017 10:36:04 +0100 Subject: [PATCH] Fix GCE live tests --- .../functions/ResetWindowsPassword.java | 146 ++++++++++++------ ...sWithGroupEncodedIntoNameThenAddToSet.java | 42 +++-- .../googlecomputeengine/domain/Image.java | 2 +- .../functions/ResetWindowsPasswordTest.java | 5 +- .../features/AddressApiLiveTest.java | 2 +- .../features/BackendServiceApiLiveTest.java | 2 +- .../features/DiskApiLiveTest.java | 2 +- .../features/FirewallApiLiveTest.java | 2 +- .../features/ForwardingRuleApiLiveTest.java | 2 +- .../GlobalForwardingRuleApiLiveTest.java | 2 +- .../features/InstanceApiLiveTest.java | 2 +- .../features/InstanceApiWindowsLiveTest.java | 2 +- .../features/NetworkApiLiveTest.java | 2 +- .../features/ProjectApiLiveTest.java | 2 +- .../features/RouteApiLiveTest.java | 2 +- .../features/SnapshotApiLiveTest.java | 2 +- .../features/TargetPoolApiLiveTest.java | 2 +- .../src/test/resources/logback-test.xml | 2 +- 18 files changed, 134 insertions(+), 89 deletions(-) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPassword.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPassword.java index 3d381892d4..7fbef6d7c0 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPassword.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPassword.java @@ -16,32 +16,11 @@ */ package org.jclouds.googlecomputeengine.compute.functions; -import com.google.common.base.Function; -import com.google.common.base.Predicate; -import com.google.common.base.Throwables; -import com.google.common.collect.ImmutableMap; -import com.google.common.io.BaseEncoding; -import com.google.common.util.concurrent.Atomics; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import org.jclouds.compute.reference.ComputeServiceConstants; -import org.jclouds.crypto.Crypto; -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.domain.Instance; -import org.jclouds.googlecomputeengine.domain.Instance.SerialPortOutput; -import org.jclouds.googlecomputeengine.domain.Metadata; -import org.jclouds.googlecomputeengine.domain.Operation; -import org.jclouds.googlecomputeengine.features.InstanceApi; -import org.jclouds.logging.Logger; -import org.jclouds.util.Predicates2; +import static com.google.common.base.Predicates.notNull; +import static com.google.common.collect.Iterables.filter; +import static com.google.common.collect.Iterables.transform; +import static com.google.common.collect.Iterables.tryFind; -import javax.annotation.Resource; -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.inject.Inject; -import javax.inject.Named; import java.math.BigInteger; import java.nio.charset.Charset; import java.security.InvalidKeyException; @@ -53,13 +32,42 @@ import java.security.spec.RSAPublicKeySpec; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; -import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.TimeZone; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Resource; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.inject.Inject; +import javax.inject.Named; + +import org.jclouds.compute.reference.ComputeServiceConstants; +import org.jclouds.crypto.Crypto; +import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; +import org.jclouds.googlecomputeengine.domain.Instance; +import org.jclouds.googlecomputeengine.domain.Instance.SerialPortOutput; +import org.jclouds.googlecomputeengine.domain.Metadata; +import org.jclouds.googlecomputeengine.domain.Operation; +import org.jclouds.googlecomputeengine.features.InstanceApi; +import org.jclouds.json.Json; +import org.jclouds.logging.Logger; +import org.jclouds.util.Predicates2; + +import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.base.Predicate; +import com.google.common.base.Splitter; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableMap; +import com.google.common.io.BaseEncoding; +import com.google.common.util.concurrent.Atomics; +import com.google.gson.GsonBuilder; +import com.google.inject.TypeLiteral; /** * References: @@ -92,12 +100,15 @@ public class ResetWindowsPassword implements Function, String> { private final GoogleComputeEngineApi api; private final Crypto crypto; private final Predicate> operationDone; + private final Json json; @Inject - protected ResetWindowsPassword(GoogleComputeEngineApi api, Crypto crypto, Predicate> operationDone) { + protected ResetWindowsPassword(GoogleComputeEngineApi api, Crypto crypto, + Predicate> operationDone, Json json) { this.api = api; this.crypto = crypto; this.operationDone = operationDone; + this.json = json; } @Override @@ -135,31 +146,64 @@ public class ResetWindowsPassword implements Function, String> { operation.get().httpErrorMessage()); } - try { - final Map passwordDict = new HashMap(); - boolean passwordRetrieved = Predicates2.retry(new Predicate() { - public boolean apply(Instance instance) { - String serialPortContents = instanceApi.getSerialPortOutput(instance.name(), 4).contents(); - if (!serialPortContents.startsWith("{\"ready\":true")) { - return false; - } - String[] contentEntries = serialPortContents.split("\n"); - passwordDict.clear(); - passwordDict.putAll(new Gson().fromJson(contentEntries[contentEntries.length - 1], Map.class)); - passwordDict.put("passwordDictContentEntries", contentEntries[contentEntries.length - 1]); - return passwordDict.get("encryptedPassword") != null; - } - }, 10 * 60, 30, TimeUnit.SECONDS).apply(instance.get()); // Notice that timeoutDuration should be less than EXPIRE_DURATION - if (passwordRetrieved) { - return decryptPassword(checkNotNull(passwordDict.get("encryptedPassword"), "encryptedPassword shouldn't be null"), keys); - } else { - throw new IllegalStateException("encryptedPassword shouldn't be null: " + passwordDict.get("passwordDictContentEntries")); - } - } catch (Exception e) { - throw Throwables.propagate(e); - } + try { + final AtomicReference encryptedPassword = Atomics.newReference(); + boolean passwordRetrieved = Predicates2.retry(new Predicate() { + public boolean apply(Instance instance) { + String serialPortContents = instanceApi.getSerialPortOutput(instance.name(), 4).contents(); + List contentEntries = Splitter.on('\n').splitToList(serialPortContents); + + Optional retrievedPassword = tryFind( + filter(transform(contentEntries, deserializeSerialOutput(json)), notNull()), HasEncryptedPassword) + .transform(ExtractEncryptedPassword); + + if (retrievedPassword.isPresent()) { + encryptedPassword.set(retrievedPassword.get()); + } + + return retrievedPassword.isPresent(); + } + // Notice that timeoutDuration should be less than EXPIRE_DURATION + }, 10 * 60, 30, TimeUnit.SECONDS).apply(instance.get()); + + if (passwordRetrieved) { + return decryptPassword(encryptedPassword.get(), keys); + } else { + throw new IllegalStateException("Did not find the encrypted password in the serial port output"); + } + } catch (Exception e) { + throw Throwables.propagate(e); + } } + private static Function> deserializeSerialOutput(final Json json) { + return new Function>() { + @Override + public Map apply(String input) { + try { + return json.fromJson(input, new TypeLiteral>() { + }.getType()); + } catch (Exception ex) { + return null; + } + } + }; + } + + private static final Predicate> HasEncryptedPassword = new Predicate>() { + @Override + public boolean apply(Map input) { + return input.containsKey("encryptedPassword"); + } + }; + + private static final Function, String> ExtractEncryptedPassword = new Function, String>() { + @Override + public String apply(Map input) { + return (String) input.get("encryptedPassword"); + } + }; + /** * Decrypts the given password - the encrypted text is base64-encoded. * As per the GCE docs, assumes it was encrypted with algorithm "RSA/NONE/OAEPPadding", and UTF-8. diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java index b60a5f040e..ba4b6fdac1 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/strategy/CreateNodesWithGroupEncodedIntoNameThenAddToSet.java @@ -208,34 +208,32 @@ public final class CreateNodesWithGroupEncodedIntoNameThenAddToSet extends } int[] inboundPorts = templateOptions.getInboundPorts(); - if ((inboundPorts == null) || inboundPorts.length == 0){ - return; - } + + if (inboundPorts != null && inboundPorts.length > 0) { + List ports = simplifyPorts(inboundPorts); + String name = naming.name(ports); + Firewall firewall = firewallApi.get(name); + AtomicReference operation = null; - List ports = simplifyPorts(inboundPorts); - String name = naming.name(ports); - Firewall firewall = firewallApi.get(name); - AtomicReference operation = null; - - String interiorRange = subnet.isPresent() ? subnet.get().ipCidrRange() : DEFAULT_INTERNAL_NETWORK_RANGE; - - if (firewall == null) { - List rules = ImmutableList.of(Rule.create("tcp", ports), Rule.create("udp", ports)); - FirewallOptions firewallOptions = new FirewallOptions().name(name).network(network.selfLink()) + String interiorRange = subnet.isPresent() ? subnet.get().ipCidrRange() : DEFAULT_INTERNAL_NETWORK_RANGE; + + if (firewall == null) { + List rules = ImmutableList.of(Rule.create("tcp", ports), Rule.create("udp", ports)); + FirewallOptions firewallOptions = new FirewallOptions().name(name).network(network.selfLink()) .allowedRules(rules).sourceTags(templateOptions.getTags()) - .sourceRanges(of(interiorRange, EXTERIOR_RANGE)) - .targetTags(ImmutableList.of(name)); + .sourceRanges(of(interiorRange, EXTERIOR_RANGE)).targetTags(ImmutableList.of(name)); - operation = Atomics.newReference(firewallApi - .createInNetwork(firewallOptions.name(), network.selfLink(), firewallOptions)); + operation = Atomics.newReference(firewallApi.createInNetwork(firewallOptions.name(), network.selfLink(), + firewallOptions)); - operationDone.apply(operation); - checkState(operation.get().httpErrorStatusCode() == null, "Could not insert firewall, operation failed %s", - operation); + operationDone.apply(operation); + checkState(operation.get().httpErrorStatusCode() == null, "Could not insert firewall, operation failed %s", + operation); + } - // Add tags for firewalls - tags.add(name); + tags.add(name); // Add tags for the inbound ports firewall } + templateOptions.tags(tags); } diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java index b055ee27ab..09a3d55f5f 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java @@ -82,7 +82,7 @@ public abstract class Image { public abstract Status status(); - public abstract Long archiveSizeBytes(); + @Nullable public abstract Long archiveSizeBytes(); public abstract Long diskSizeGb(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPasswordTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPasswordTest.java index 23f24d989d..4ec5f201e7 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPasswordTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/ResetWindowsPasswordTest.java @@ -20,6 +20,8 @@ import com.google.common.base.Predicate; import com.google.common.base.Predicates; import com.google.common.collect.ImmutableMap; import com.google.common.io.BaseEncoding; +import com.google.gson.Gson; + import org.jclouds.crypto.Crypto; import org.jclouds.encryption.bouncycastle.BouncyCastleCrypto; import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; @@ -29,6 +31,7 @@ import org.jclouds.googlecomputeengine.domain.Metadata; import org.jclouds.googlecomputeengine.domain.Operation; import org.jclouds.googlecomputeengine.features.InstanceApi; import org.jclouds.googlecomputeengine.parse.ParseInstanceTest; +import org.jclouds.json.internal.GsonWrapper; import org.testng.annotations.Test; import javax.crypto.Cipher; @@ -93,7 +96,7 @@ public class ResetWindowsPasswordTest { replay(api, instanceApi, operation, serialPortOutput, crypto, keyPairGenerator); - ResetWindowsPassword generator = new ResetWindowsPassword(api, crypto, operationDone); + ResetWindowsPassword generator = new ResetWindowsPassword(api, crypto, operationDone, new GsonWrapper(new Gson())); String result = generator.apply(ImmutableMap.of("instance", new AtomicReference(instance), "zone", zone, "email", "test@google.com", "userName", "test")); verify(api, instanceApi, operation, serialPortOutput); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java index cee41f63d2..c64c150be6 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiLiveTest.java @@ -53,7 +53,7 @@ public class AddressApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertEquals(addresses.next().size(), 1); } - @Test(groups = "live", dependsOnMethods = "testListAddress") + @Test(groups = "live", dependsOnMethods = "testListAddress", alwaysRun = true) public void testDeleteAddress() { assertOperationDoneSuccessfully(api().delete(ADDRESS_NAME)); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java index 9ed6ceb696..4434a2ab3f 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/BackendServiceApiLiveTest.java @@ -103,7 +103,7 @@ public class BackendServiceApiLiveTest extends BaseGoogleComputeEngineApiLiveTes } */ - @Test(groups = "live", dependsOnMethods = "testListBackendService") + @Test(groups = "live", dependsOnMethods = "testListBackendService", alwaysRun = true) public void testDeleteBackendService() { assertOperationDoneSuccessfully(api().delete(BACKEND_SERVICE_NAME)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java index ec020bc13d..b84eca41c1 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiLiveTest.java @@ -64,7 +64,7 @@ public class DiskApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertDiskEquals(disksAsList.get(0)); } - @Test(groups = "live", dependsOnMethods = "testListDisk") + @Test(groups = "live", dependsOnMethods = "testListDisk", alwaysRun = true) public void testDeleteDisk() { assertOperationDoneSuccessfully(api().delete(DISK_NAME)); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java index 794f27e86f..0ed4b57da6 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiLiveTest.java @@ -107,7 +107,7 @@ public class FirewallApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertEquals(firewalls.next().size(), 1); } - @Test(groups = "live", dependsOnMethods = "testListFirewall") + @Test(groups = "live", dependsOnMethods = "testListFirewall", alwaysRun = true) public void testDeleteFirewall() { assertOperationDoneSuccessfully(api().delete(FIREWALL_NAME)); assertOperationDoneSuccessfully(api.networks().delete(FIREWALL_NETWORK_NAME)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java index 625c958fa5..ce486417be 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ForwardingRuleApiLiveTest.java @@ -73,7 +73,7 @@ public class ForwardingRuleApiLiveTest extends BaseGoogleComputeEngineApiLiveTes address = addressApi().get(ADDRESS_NAME); } - @AfterClass + @AfterClass(alwaysRun = true) public void tearDown() { assertOperationDoneSuccessfully(targetPoolApi().delete(TARGETPOOL_NAME)); assertOperationDoneSuccessfully(targetPoolApi().delete(TARGETPOOL_NAME_NEW)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java index 7aefc25b6a..2d4da057ce 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalForwardingRuleApiLiveTest.java @@ -104,7 +104,7 @@ public class GlobalForwardingRuleApiLiveTest extends BaseGoogleComputeEngineApiL assertEquals(forwardingRules.size(), 1); } - @Test(groups = "live", dependsOnMethods = "testListGlobalForwardingRule") + @Test(groups = "live", dependsOnMethods = "testListGlobalForwardingRule", alwaysRun = true) public void testDeleteGlobalForwardingRule() { assertOperationDoneSuccessfully(api().delete(GLOBAL_FORWARDING_RULE_NAME)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java index 7b56456b37..bbdb215139 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java @@ -354,7 +354,7 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertEquals(resultTags, expectedTags); } - @AfterClass(groups = { "integration", "live" }) + @AfterClass(groups = { "integration", "live" }, alwaysRun = true) protected void tearDownContext() { try { waitOperationDone(api().delete(INSTANCE_NAME)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiWindowsLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiWindowsLiveTest.java index 381711a9be..bb96e430f5 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiWindowsLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiWindowsLiveTest.java @@ -119,7 +119,7 @@ public class InstanceApiWindowsLiveTest extends BaseGoogleComputeEngineApiLiveTe assertFalse(Strings.isNullOrEmpty(result), "Password shouldn't be empty"); } - @AfterClass(groups = { "integration", "live" }) + @AfterClass(groups = { "integration", "live" }, alwaysRun = true) protected void tearDownContext() { try { waitOperationDone(api().delete(INSTANCE_NAME)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java index cec92def0b..98863ffb7f 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiLiveTest.java @@ -61,7 +61,7 @@ public class NetworkApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertNetworkEquals(networksAsList.get(0)); } - @Test(groups = "live", dependsOnMethods = "testListNetwork") + @Test(groups = "live", dependsOnMethods = "testListNetwork", alwaysRun = true) public void testDeleteNetwork() { assertOperationDoneSuccessfully(api().delete(NETWORK_NAME)); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java index 632766bde4..79e60c1ad5 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiLiveTest.java @@ -64,7 +64,7 @@ public class ProjectApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertNotNull(project.commonInstanceMetadata().fingerprint()); } - @Test(groups = "live", dependsOnMethods = "addItemToMetadata") + @Test(groups = "live", dependsOnMethods = "addItemToMetadata", alwaysRun = true) public void testDeleteItemFromMetadata() { Metadata metadata = project.commonInstanceMetadata().remove(METADATA_ITEM_KEY); assertOperationDoneSuccessfully(api.project().setCommonInstanceMetadata(metadata)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java index 002a79e07a..d47576f353 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiLiveTest.java @@ -75,7 +75,7 @@ public class RouteApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertRouteEquals(routesAsList.get(0)); } - @Test(groups = "live", dependsOnMethods = "testListRoute") + @Test(groups = "live", dependsOnMethods = "testListRoute", alwaysRun = true) public void testDeleteRoute() { assertOperationDoneSuccessfully(api().delete(ROUTE_NAME)); assertOperationDoneSuccessfully(api.networks().delete(ROUTE_NETWORK_NAME)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java index 57c76cb693..179a2a3a9c 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiLiveTest.java @@ -71,7 +71,7 @@ public class SnapshotApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertSnapshotEquals(snapshotsAsList.get(0)); } - @Test(groups = "live", dependsOnMethods = "testListSnapshot") + @Test(groups = "live", dependsOnMethods = "testListSnapshot", alwaysRun = true) public void testDeleteDisk() { assertOperationDoneSuccessfully(diskApi().delete(DISK_NAME)); assertOperationDoneSuccessfully(api().delete(SNAPSHOT_NAME)); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java index ea742a93a8..38dfd1e7da 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/TargetPoolApiLiveTest.java @@ -258,7 +258,7 @@ public class TargetPoolApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertOperationDoneSuccessfully(api().delete(BACKUP_TARGETPOOL_NAME)); } - @AfterClass(groups = { "integration", "live" }) + @AfterClass(groups = { "integration", "live" }, alwaysRun = true) public void testCleanup(){ InstanceApi instanceApi = api.instancesInZone(DEFAULT_ZONE_NAME); HttpHealthCheckApi httpHealthCheckApi = api.httpHeathChecks(); diff --git a/providers/google-compute-engine/src/test/resources/logback-test.xml b/providers/google-compute-engine/src/test/resources/logback-test.xml index cb55d49823..b9e961687f 100644 --- a/providers/google-compute-engine/src/test/resources/logback-test.xml +++ b/providers/google-compute-engine/src/test/resources/logback-test.xml @@ -13,7 +13,7 @@ - target/jclouds-compute.log + target/test-data/jclouds-compute.log %d %-5p [%c] [%thread] %m%n