Search in sources :

Example 16 with ContainerResultMatcher

use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.

the class CondaITCase method canInstallFromArtipie.

@Test
void canInstallFromArtipie() throws IOException {
    this.moveCondarc();
    this.containers.putBinaryToArtipie(new TestResource("conda/packages.json").asBytes(), "/var/artipie/data/my-conda/linux-64/repodata.json");
    this.containers.putBinaryToArtipie(new TestResource("conda/snappy-1.1.3-0.tar.bz2").asBytes(), "/var/artipie/data/my-conda/linux-64/snappy-1.1.3-0.tar.bz2");
    this.containers.assertExec("Package snappy-1.1.3-0 was not installed successfully", new ContainerResultMatcher(new IsEqual<>(0), Matchers.allOf(new StringContains("http://artipie:8080/my-conda"), new StringContains("linux-64::snappy-1.1.3-0"))), "conda", "install", "--verbose", "-y", "snappy");
}
Also used : TestResource(com.artipie.asto.test.TestResource) ContainerResultMatcher(com.artipie.test.ContainerResultMatcher) IsEqual(org.hamcrest.core.IsEqual) StringContains(org.hamcrest.core.StringContains) Test(org.junit.jupiter.api.Test)

Example 17 with ContainerResultMatcher

use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.

the class DebianGpgITCase method setUp.

@BeforeEach
void setUp() throws IOException {
    this.containers.assertExec("Apt-get update failed", new ContainerResultMatcher(), "apt-get", "update");
    this.containers.assertExec("Failed to install curl", new ContainerResultMatcher(), "apt-get", "install", "-y", "curl");
    this.containers.assertExec("Failed to install gnupg", new ContainerResultMatcher(), "apt-get", "install", "-y", "gnupg");
    this.containers.assertExec("Failed to add public key to apt-get", new ContainerResultMatcher(), "apt-key", "add", "/w/public-key.asc");
    this.containers.putBinaryToClient("deb http://artipie:8080/my-debian my-debian main".getBytes(), "/etc/apt/sources.list");
}
Also used : ContainerResultMatcher(com.artipie.test.ContainerResultMatcher) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 18 with ContainerResultMatcher

use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.

the class HelmITCase method uploadChartAndCreateIndexYaml.

@Test
void uploadChartAndCreateIndexYaml() throws Exception {
    final String url = "http://artipie:8080/my-helm";
    this.containers.assertExec("Failed to upload helm archive", new ContainerResultMatcher(new IsEqual<>(0)), "curl", "-X", "PUT", String.format("%s/%s", url, "tomcat"), "--upload-file", String.format("/w/%s", HelmITCase.CHART), "--verbose");
    this.containers.assertExec("Init failed", new ContainerResultMatcher(new IsEqual<>(0)), "helm", "init", "--stable-repo-url", url, "--client-only");
    this.containers.assertExec("Chart repository was not added", new ContainerResultMatcher(new IsEqual<>(0)), "helm", "repo", "add", "chartrepo", url);
    this.containers.assertExec("Repo update from chart repository failed", new ContainerResultMatcher(new IsEqual<>(0), new StringContains("Update Complete.")), "helm", "repo", "update");
}
Also used : ContainerResultMatcher(com.artipie.test.ContainerResultMatcher) IsEqual(org.hamcrest.core.IsEqual) StringContains(org.hamcrest.core.StringContains) Test(org.junit.jupiter.api.Test)

Example 19 with ContainerResultMatcher

use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.

the class FileITCase method canUpload.

@Test
void canUpload() throws Exception {
    this.deployment.assertExec("Failed to upload", new ContainerResultMatcher(ContainerResultMatcher.SUCCESS), "curl", "-X", "PUT", "--data-binary", "123", "http://artipie:8080/bin/test");
    this.deployment.assertArtipieContent("Bad content after upload", "/var/artipie/data/bin/test", Matchers.equalTo("123".getBytes()));
}
Also used : ContainerResultMatcher(com.artipie.test.ContainerResultMatcher) Test(org.junit.jupiter.api.Test)

Example 20 with ContainerResultMatcher

use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.

the class FileITCase method canDownload.

@Test
void canDownload() throws Exception {
    final byte[] target = new byte[] { 0, 1, 2, 3 };
    this.deployment.putBinaryToArtipie(target, "/var/artipie/data/bin/target");
    this.deployment.assertExec("Failed to download artifact", new ContainerResultMatcher(ContainerResultMatcher.SUCCESS), "curl", "-X", "GET", "http://artipie:8080/bin/target");
}
Also used : ContainerResultMatcher(com.artipie.test.ContainerResultMatcher) Test(org.junit.jupiter.api.Test)

Aggregations

ContainerResultMatcher (com.artipie.test.ContainerResultMatcher)34 Test (org.junit.jupiter.api.Test)27 IsEqual (org.hamcrest.core.IsEqual)20 StringContains (org.hamcrest.core.StringContains)14 TestResource (com.artipie.asto.test.TestResource)10 StringContainsInOrder (org.hamcrest.text.StringContainsInOrder)10 BeforeEach (org.junit.jupiter.api.BeforeEach)8 TestDeployment (com.artipie.test.TestDeployment)7 OS (org.junit.jupiter.api.condition.OS)7 RegisterExtension (org.junit.jupiter.api.extension.RegisterExtension)7 DisabledOnOs (org.junit.jupiter.api.condition.DisabledOnOs)6 IOException (java.io.IOException)4 UncheckedIOException (java.io.UncheckedIOException)4 List (java.util.List)4 BindMode (org.testcontainers.containers.BindMode)3 Pair (wtf.g4s8.tuples.Pair)3 MapEntry (org.cactoos.map.MapEntry)2 MapOf (org.cactoos.map.MapOf)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 CsvSource (org.junit.jupiter.params.provider.CsvSource)2