use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage in project linuxtools by eclipse.
the class BasicSecurityTest method testBasicSecurity.
@Test
public void testBasicSecurity() {
DockerImagesTab imagesTab = openDockerImagesTab();
imagesTab.runImage(IMAGE_NAME + ":" + IMAGE_TAG);
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
firstPage.setContainerName(CONTAINER_NAME);
firstPage.setAllocatePseudoTTY();
firstPage.setKeepSTDINOpen();
firstPage.setBasicSecurity();
firstPage.finish();
if (mockitoIsUsed()) {
runContainer();
// 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 readonlyProp = propertiesView.getProperty("HostConfig", "ReadonlyRootfs").getPropertyValue();
assertTrue("Container is not running read-only!", readonlyProp.equals("true"));
String tmpfsProp = propertiesView.getProperty("HostConfig", "Tmpfs", "/run").getPropertyValue();
assertTrue("Container /run is not tmpfs rw,exec!", tmpfsProp.equals("rw,exec"));
tmpfsProp = propertiesView.getProperty("HostConfig", "Tmpfs", "/tmp").getPropertyValue();
assertTrue("Container /tmp is not tmpfs rw,exec!", tmpfsProp.equals("rw,exec"));
String capDropProp = propertiesView.getProperty("HostConfig", "CapDrop", "").getPropertyValue();
assertTrue("Container does not have capDrop all!", capDropProp.equals("all"));
}
use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage 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.core.ui.wizards.ImageRunSelectionPage in project linuxtools by eclipse.
the class DockerContainerTest method testRunDockerContainer.
@Test
public void testRunDockerContainer() {
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
assertTrue("Image has not been found!", imageIsDeployed(getCompleteImageName(IMAGE_NAME)));
DockerExplorerView explorer = new DockerExplorerView();
getConnection().getImage(getCompleteImageName(IMAGE_NAME)).run();
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(explorer);
firstPage.setContainerName(CONTAINER_NAME);
firstPage.finish();
if (mockitoIsUsed()) {
MockUtils.runContainer(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST, CONTAINER_NAME);
}
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
new WaitWhile(new ConsoleHasNoChange());
assertTrue("Container does not exists!", containerIsDeployed(CONTAINER_NAME));
}
use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage in project linuxtools by eclipse.
the class ExposePortTest method runContainer.
private void runContainer(String imageName, String imageTag, String containerName, DockerImagesTab imagesTab) {
imagesTab.runImage(imageName + ":" + imageTag);
ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
firstPage.setContainerName(containerName);
firstPage.setPublishAllExposedPorts(false);
firstPage.finish();
new WaitWhile(new JobIsRunning());
new WaitWhile(new ConsoleHasNoChange());
}
use of org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage in project linuxtools by eclipse.
the class LinkContainersTest method runAlpineLinux.
public void runAlpineLinux(String imageName, String containerName) {
String serverAddress = getHttpServerAddress(CONTAINER_NAME_HTTP_SERVER);
DockerImagesTab imagesTab = openDockerImagesTab();
imagesTab.runImage(imageName);
ImageRunSelectionPage firstPage = openImageRunSelectionPage(containerName, false, imagesTab);
firstPage.setContainerName(containerName);
firstPage.setCommand(serverAddress + ":80");
firstPage.addLinkToContainer(CONTAINER_NAME_HTTP_SERVER, "http_server");
firstPage.setPublishAllExposedPorts(false);
firstPage.setAllocatePseudoTTY();
firstPage.setKeepSTDINOpen();
firstPage.finish();
new WaitWhile(new JobIsRunning());
DockerTerminal dt = new DockerTerminal();
dt.open();
if (mockitoIsUsed()) {
mockServerContainer();
dt = MockDockerTerminal.setText("text").build();
}
String terminalText = dt.getTextFromPage("/" + containerName);
assertTrue("No output from terminal!", !terminalText.isEmpty());
assertTrue("Containers are not linked!", !terminalText.contains("Connection refused"));
}
Aggregations