Search in sources :

Example 6 with ContainerIsDeployedCondition

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);
}
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 7 with ContainerIsDeployedCondition

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));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ContainerIsDeployedCondition(org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)

Example 8 with ContainerIsDeployedCondition

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"));
}
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 9 with ContainerIsDeployedCondition

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));
}
Also used : WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) RunDockerImageLaunchConfiguration(org.eclipse.linuxtools.docker.reddeer.ui.RunDockerImageLaunchConfiguration) 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)

Aggregations

ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)9 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)9 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)8 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)7 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)6 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)6 Test (org.junit.Test)6 PropertySheet (org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)5 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)2 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)2 File (java.io.File)1 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)1 DockerExplorerView (org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView)1 RunDockerImageLaunchConfiguration (org.eclipse.linuxtools.docker.reddeer.ui.RunDockerImageLaunchConfiguration)1 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 Before (org.junit.Before)1