Search in sources :

Example 16 with DockerImagesTab

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab 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 17 with DockerImagesTab

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.

the class VariablesTest method testVariables.

@Test
public void testVariables() {
    getConnection();
    DockerImagesTab imagesTab = openDockerImagesTab();
    buildImage(IMAGE_NAME, "resources/test-variables", imagesTab);
    if (mockitoIsUsed()) {
        MockUtils.pullImage(DEFAULT_CONNECTION_NAME, IMAGE_NAME, IMAGE_TAG_LATEST);
    }
    assertConsoleSuccess();
    imagesTab.activate();
    imagesTab.refresh();
    new WaitWhile(new JobIsRunning());
    imagesTab.runImage(IMAGE_NAME);
    ImageRunSelectionPage firstPage = new ImageRunSelectionPage(imagesTab);
    firstPage.setContainerName(CONTAINER_NAME);
    firstPage.next();
    ImageRunResourceVolumesVariablesPage secondPage = new ImageRunResourceVolumesVariablesPage(firstPage);
    secondPage.addEnviromentVariable("FOO", "barbarbar");
    if (mockitoIsUsed()) {
        MockDockerClientFactory.addContainer(this.client, this.createdContainer, this.containerInfo);
    }
    secondPage.finish();
    new WaitWhile(new JobIsRunning());
    assertConsoleContains("FOO is barbarbar");
}
Also used : ImageRunSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ImageRunResourceVolumesVariablesPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest) Test(org.junit.Test)

Example 18 with DockerImagesTab

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.

the class AbstractImageBotTest method addTagToImage.

protected void addTagToImage(String imageName, String imageTag) {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.activate();
    if (mockitoIsUsed()) {
        MockUtils.pullImage(DEFAULT_CONNECTION_NAME, imageName, imageTag);
    } else {
        imagesTab.addTagToImage(imageName, imageTag);
    }
}
Also used : DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)

Example 19 with DockerImagesTab

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.

the class HierarchyViewTest method testHierarchyView.

@Test
public void testHierarchyView() {
    DockerImagesTab imageTab = openDockerImagesTab();
    buildImage(IMAGE_TEST_BUILD, DOCKERFILE_FOLDER, imageTab);
    if (mockitoIsUsed()) {
        buildImage();
    }
    DockerImageHierarchyTab hierarchyTab = openDockerImageHierarchyTab();
    List<TreeItem> treeItems = hierarchyTab.getTreeItems();
    compareTextInFirstNode(treeItems, "alpine:3.3");
    List<TreeItem> treeItems2 = treeItems.get(0).getItems();
    compareTextInFirstNode(treeItems2, IMAGE_TEST_BUILD + NAME_TAG_SEPARATOR + IMAGE_TAG_LATEST);
}
Also used : TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) DockerImageHierarchyTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImageHierarchyTab) Test(org.junit.Test)

Example 20 with DockerImagesTab

use of org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab in project linuxtools by eclipse.

the class ImageTagTest method testAddRemoveTagToImage.

@Test
public void testAddRemoveTagToImage() {
    DockerImagesTab imagesTab = openDockerImagesTab();
    imagesTab.activate();
    addTagToImage(IMAGE_NAME, IMAGE_TAG);
    new WaitWhile(new JobIsRunning());
    assertTrue("Image tag has not been added", imagesTab.getImageTags(IMAGE_NAME).contains(IMAGE_TAG));
    removeTagFromImage(IMAGE_NAME, IMAGE_TAG);
    new WaitWhile(new JobIsRunning());
    assertTrue("ImageTaghasNotBeenRemoved", !imagesTab.getImageTags(IMAGE_NAME).contains(IMAGE_TAG));
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DockerImagesTab(org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) Test(org.junit.Test)

Aggregations

DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)25 Test (org.junit.Test)18 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)16 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)16 AbstractImageBotTest (org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)12 ImageRunSelectionPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunSelectionPage)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)7 PropertySheet (org.eclipse.reddeer.eclipse.ui.views.properties.PropertySheet)7 ContainerIsDeployedCondition (org.eclipse.linuxtools.docker.reddeer.condition.ContainerIsDeployedCondition)6 ImageRunResourceVolumesVariablesPage (org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageRunResourceVolumesVariablesPage)3 DockerContainersTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerContainersTab)3 File (java.io.File)2 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 IOException (java.io.IOException)1 MockDockerTerminal (org.eclipse.linuxtools.docker.integration.tests.mock.MockDockerTerminal)1 DockerComposePreferencePage (org.eclipse.linuxtools.docker.reddeer.preferences.DockerComposePreferencePage)1 DockerExplorerView (org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView)1 DockerImageHierarchyTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImageHierarchyTab)1 DockerTerminal (org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal)1