-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure curl and wget are installed in images
- Loading branch information
1 parent
ef42f52
commit 176b243
Showing
8 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
management-api-server/src/test/java/com/datastax/mgmtapi/DockerImageIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright DataStax, Inc. | ||
* | ||
* Please see the included license file for details. | ||
*/ | ||
package com.datastax.mgmtapi; | ||
|
||
import static org.junit.Assert.fail; | ||
import static org.junit.Assume.assumeTrue; | ||
|
||
import com.datastax.mgmtapi.helpers.IntegrationTestUtils; | ||
import java.io.IOException; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
@RunWith(Parameterized.class) | ||
public class DockerImageIT extends BaseDockerIntegrationTest { | ||
|
||
public DockerImageIT(String version) throws IOException { | ||
super(version); | ||
} | ||
|
||
@Test | ||
public void testCurlExists() { | ||
assumeTrue(IntegrationTestUtils.shouldRun()); | ||
// see if curl is installed | ||
try { | ||
testCommandExists("curl"); | ||
} catch (Throwable t) { | ||
// this is expected, ensure the message indicates a process error code | ||
fail( | ||
"\"curl\" was not found in the image. Please ensure it has been added to the Dockerfile"); | ||
} | ||
} | ||
|
||
@Test | ||
public void testWgetExists() { | ||
assumeTrue(IntegrationTestUtils.shouldRun()); | ||
// ensure wget is installed | ||
try { | ||
testCommandExists("wget"); | ||
} catch (Throwable t) { | ||
fail( | ||
"\"wget\" was not found in the image. Please ensure it has been added to the Dockerfile"); | ||
} | ||
} | ||
|
||
private void testCommandExists(String cmd) { | ||
String execId = docker.runCommand("which", "wget"); | ||
docker.waitTillFinished(execId); | ||
} | ||
} |