Ejemplo n.º 1
0
 @Test(
     enabled = true,
     dependsOnMethods = "testCreateAnotherNodeWithANewContextToEnsureSharedMemIsntRequired")
 public void testCredentialsCache() throws Exception {
   initializeContextAndClient();
   for (NodeMetadata node : nodes)
     assert (context.getCredentialStore().get("node#" + node.getId()) != null)
         : "credentials for " + node.getId();
 }
Ejemplo n.º 2
0
 @BeforeGroups(groups = {"integration", "live"})
 public void setupClient()
     throws InterruptedException, ExecutionException, TimeoutException, IOException {
   setServiceDefaults();
   if (tag == null) tag = checkNotNull(provider, "provider");
   setupCredentials();
   setupKeyPairForTest();
   initializeContextAndClient();
   buildSocketTester();
 }
 @Test(enabled = true, dependsOnMethods = "testCreateTwoNodesWithRunScript")
 public void testCreateAnotherNodeWithANewContextToEnsureSharedMemIsntRequired() throws Exception {
   initializeContextAndClient();
   TreeSet<NodeMetadata> nodes = Sets.newTreeSet(client.runNodesWithTag(tag, 1, template));
   checkNodes(nodes, tag);
   NodeMetadata node = nodes.first();
   this.nodes.add(node);
   assertEquals(nodes.size(), 1);
   assertLocationSameOrChild(node.getLocation(), template.getLocation());
   assertEquals(node.getImage(), template.getImage());
 }
  @BeforeGroups(groups = {"integration", "live"})
  public void setupClient()
      throws InterruptedException, ExecutionException, TimeoutException, IOException {
    if (tag == null) tag = checkNotNull(service, "service");
    setupCredentials();
    setupKeyPair();
    initializeContextAndClient();

    Injector injector = createSshClientInjector();
    sshFactory = injector.getInstance(SshClient.Factory.class);
    SocketOpen socketOpen = injector.getInstance(SocketOpen.class);
    socketTester = new RetryablePredicate<IPSocket>(socketOpen, 60, 1, TimeUnit.SECONDS);
    injector.injectMembers(socketOpen); // add logger
  }