Search in sources :

Example 86 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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"));
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 87 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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);
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition) Before(org.junit.Before)

Example 88 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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));
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 89 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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());
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 90 with JobIsRunning

use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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"));
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) MockDockerTerminal(org.eclipse.linuxtools.docker.integration.tests.mock.MockDockerTerminal) DockerTerminal(org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Aggregations

JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)154 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)142 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)62 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)52 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)46 Test (org.junit.Test)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)31 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)29 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)28 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)23 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)18 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)14 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)14 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)13 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)12 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)10