diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java index 123c594ecc..e9298e2f65 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerClientLiveTest.java @@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit; import com.google.common.base.Predicates; import org.jclouds.cloudstack.domain.AsyncJob; +import org.jclouds.cloudstack.domain.JobResult; import org.jclouds.cloudstack.domain.LoadBalancerRule; import org.jclouds.cloudstack.domain.LoadBalancerRule.Algorithm; import org.jclouds.cloudstack.domain.LoadBalancerRule.State; @@ -121,10 +122,18 @@ public class LoadBalancerClientLiveTest extends BaseCloudStackClientLiveTest { public void testAssignToLoadBalancerRule() throws Exception { if (networksDisabled) return; - assertTrue(jobComplete.apply(client.getLoadBalancerClient().assignVirtualMachinesToLoadBalancerRule(rule.getId(), - vm.getId()))); - assertEquals(client.getLoadBalancerClient().listVirtualMachinesAssignedToLoadBalancerRule(rule.getId()).size(), 1); + long jobId = client.getLoadBalancerClient().assignVirtualMachinesToLoadBalancerRule(rule.getId(), + vm.getId()); + assertTrue(jobComplete.apply(jobId)); + AsyncJob result = client.getAsyncJobClient().getAsyncJob(jobId); + assertTrue(result.hasSucceed()); + Set machines = client.getLoadBalancerClient().listVirtualMachinesAssignedToLoadBalancerRule(rule.getId()); + assertEquals(machines.size(), 1); assertTrue(loadBalancerRuleActive.apply(rule), rule.toString()); + } + + @Test(dependsOnMethods = "testAssignToLoadBalancerRule") + public void testCanSshInThroughNewLoadBalancerRule() throws Exception { loopAndCheckSSH(); }