use of org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition in project linuxtools by eclipse.
the class ContainerLogTest method before.
@Before
public void before() {
deleteAllConnections();
getConnection();
pullImage(IMAGE_NAME);
new WaitWhile(new JobIsRunning());
DockerExplorerView explorer = new DockerExplorerView();
explorer.open();
getConnection().refresh();
getConnection().getImage(IMAGE_NAME).run();
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(explorer);
firstPage.setContainerName(CONTAINER_NAME);
firstPage.setAllocatePseudoTTY();
firstPage.setKeepSTDINOpen();
firstPage.finish();
if (mockitoIsUsed()) {
runContainer();
getConnection().refresh();
new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
}
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
}
use of org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition in project linuxtools by eclipse.
the class NetworkModeTest method checkNetworkMode.
private void checkNetworkMode(String networkMode) {
if (mockitoIsUsed()) {
runContainer(networkMode);
getConnection().refresh();
new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
}
new WaitWhile(new JobIsRunning());
PropertySheet propertiesView = openPropertiesTabForContainer("Inspect", CONTAINER_NAME);
String networkProp = propertiesView.getProperty("HostConfig", "NetworkMode").getPropertyValue();
assertTrue("Container is not running in " + networkMode + " network mode!", networkProp.equals(networkMode));
}
use of org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition in project linuxtools by eclipse.
the class UnconfinedTest method testUnconfined.
@Test
public void testUnconfined() {
DockerImagesTab imagesTab = openDockerImagesTab();
imagesTab.runImage(IMAGE_NAME + ":" + IMAGE_TAG);
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
firstPage.setContainerName(CONTAINER_NAME);
firstPage.setAllocatePseudoTTY();
firstPage.setKeepSTDINOpen();
firstPage.setUnconfined();
firstPage.finish();
if (mockitoIsUsed()) {
runUnconfinedContainer();
// MockDockerClientFactory.addContainer(this.client,
// this.createdContainer, this.containerInfo);
getConnection().refresh();
new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
}
new WaitWhile(new JobIsRunning());
PropertySheet propertiesView = openPropertiesTabForContainer("Inspect", CONTAINER_NAME);
String securityProp = propertiesView.getProperty("HostConfig", "SecurityOpt", "").getPropertyValue();
assertTrue("Container is not running in seccomp:unconfined mode!", securityProp.equals("seccomp:unconfined"));
}
use of org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition in project linuxtools by eclipse.
the class LaunchDockerImageTest method testLaunchConfiguration.
@Test
public void testLaunchConfiguration() {
String imageName = getCompleteImageName(IMAGE_HELLO_WORLD);
RunDockerImageLaunchConfiguration runImageConf = new RunDockerImageLaunchConfiguration();
try {
runDockerImageLaunchConfiguration(imageName + NAME_TAG_SEPARATOR + IMAGE_TAG_LATEST, CONTAINER_NAME, CONFIGURATION_NAME, runImageConf);
if (mockitoIsUsed()) {
MockUtils.runContainer(DEFAULT_CONNECTION_NAME, imageName, IMAGE_TAG_LATEST, CONTAINER_NAME);
getConnection().refresh();
new WaitUntil(new ContainerIsDeployedCondition(CONTAINER_NAME, getConnection()));
}
} catch (WaitTimeoutExpiredException ex) {
throw ex;
}
assertTrue("Container is not deployed!", containerIsDeployed(CONTAINER_NAME));
}
Aggregations