Search in sources :

Example 11 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class AbstractDockerBotTest method openPropertiesTabForImage.

protected PropertySheet openPropertiesTabForImage(String tabName, String imageName) {
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    getConnection().getImage(imageName).select();
    propertiesView.selectTab(tabName);
    return propertiesView;
}
Also used : PropertySheet(org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)

Example 12 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet 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 13 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet 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 14 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet 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 15 with PropertySheet

use of org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet in project linuxtools by eclipse.

the class PropertiesViewTest method testContainerPropertiesTab.

@Test
public void testContainerPropertiesTab() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.runImage(IMAGE_NAME);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.finish();
    // new WaitWhile(new ContainerIsDeployedCondition(CONTAINER_NAME,
    // getConnection()));
    DockerContainersTab containerTab = new DockerContainersTab();
    containerTab.activate();
    containerTab.refresh();
    new WaitWhile(new JobIsRunning());
    if (mockitoIsUsed()) {
        MockUtils.runContainer(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST, CONTAINER_NAME);
    }
    getConnection();
    // open Properties view
    PropertySheet propertiesView = new PropertySheet();
    propertiesView.open();
    containerTab.select(CONTAINER_NAME);
    propertiesView.selectTab("Info");
}
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) DockerContainersTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Aggregations

PropertySheet (org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)18 Test (org.junit.Test)9 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)8 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)7 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)5 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)5 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)5 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)3 TableItem (org.eclipse.reddeer.swt.api.TableItem)2 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)2 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)2 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)1 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)1 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)1 Before (org.junit.Before)1