//System.out.println(executeCommand("fabric:info"));
//System.out.println(executeCommand("fabric:profile-list"));
ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);
try {
FabricService fabricService = fabricProxy.getService();
CreateContainerOptions options = CreateSshContainerOptions.builder().name("ssh1").host(host).port(Integer.parseInt(port)).username(username).password(password).build();
CreateContainerMetadata[] metadata = fabricService.createContainers(options);
assertNotNull(metadata);
assertEquals(1, metadata.length);
if (metadata[0].getFailure() != null) {
throw metadata[0].getFailure();
}
assertTrue("Expected successful creation of remote ssh container", metadata[0].isSuccess());
assertNotNull("Expected successful creation of remote ssh container", metadata[0].getContainer());
Provision.containersStatus(Arrays.asList(metadata[0].getContainer()), "success", PROVISION_TIMEOUT);
System.out.println(executeCommand("fabric:container-list -v"));
System.out.println(executeCommand("fabric:container-resolver-list"));
Container ssh1 = fabricService.getContainer("ssh1");
assertTrue(ssh1.isAlive());
createAndAssertChildContainer(fabricService, "ssh2", "ssh1", "default");
//Stop & Start Remote Child
Container ssh2 = fabricService.getContainer("ssh2");
ssh2.stop();
assertFalse(ssh2.isAlive());
ssh2.start();
Provision.containersStatus(Arrays.asList(ssh2), "success", PROVISION_TIMEOUT);
assertTrue(ssh2.isAlive());