Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'java-library'
id 'io.freefair.lombok' version '8.10.2'
id 'io.freefair.lombok' version '8.14.4'
id 'jacoco'
id 'org.sonarqube' version '5.1.0.4882'
id 'org.sonarqube' version '6.3.1.5724'
id 'maven-publish'
}

Expand All @@ -21,10 +21,10 @@ repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://docker-regis-adm.iex.ec/repository/maven-public/'
url = 'https://docker-regis-adm.iex.ec/repository/maven-public/'
credentials {
username nexusUser
password nexusPassword
username = nexusUser
password = nexusPassword
}
}
}
Expand Down Expand Up @@ -116,8 +116,8 @@ publishing {
repositories {
maven {
credentials {
username nexusUser
password nexusPassword
username = nexusUser
password = nexusPassword
}
url = project.hasProperty('nexusUrl') ? nexusUrl : ''
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
9 changes: 4 additions & 5 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 IEXEC BLOCKCHAIN TECH
* Copyright 2023-2026 IEXEC BLOCKCHAIN TECH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,13 +21,11 @@
import com.github.dockerjava.api.command.LogContainerCmd;
import com.github.dockerjava.api.command.PullImageCmd;
import com.github.dockerjava.api.command.PullImageResultCallback;
import com.github.dockerjava.api.exception.DockerException;
import com.iexec.commons.containers.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -68,7 +66,6 @@ class DockerClientInstanceTests extends AbstractDockerTests {
private static final String BLABLA_LATEST = "blabla:latest";
private static final String DOCKERHUB_USERNAME_ENV_NAME = "DOCKER_IO_USER";
private static final String DOCKERHUB_PASSWORD_ENV_NAME = "DOCKER_IO_PASSWORD";
private static final String PRIVATE_IMAGE_NAME = "iexechub/private-image:alpine-3.13";

private static final List<String> usedRandomNames = new ArrayList<>();
private static final List<String> usedImages = List.of(
Expand Down Expand Up @@ -127,19 +124,6 @@ void shouldGetAuthenticatedClientWithDockerIoRegistry() {
}
//endregion

/**
* This test is temporarily disabled because of this error:
* toomanyrequests: too many failed login attempts for
* username or IP address.
*/
@Test
@Disabled("toomanyrequests: too many failed login attempts for username or IP address")
void shouldFailToAuthenticateClientToRegistry() {
final DockerException e = assertThrows(DockerException.class, () -> DockerClientFactory
.getDockerClientInstance(DockerClientInstance.DEFAULT_DOCKER_REGISTRY, "badUsername", "badPassword"));
assertThat(e.getHttpStatus()).isEqualTo(401);
}

//region isImagePresent
@Test
void shouldFindImagePresent() {
Expand Down Expand Up @@ -234,26 +218,6 @@ void shouldNotPullImageSinceInterruptedException(CapturedOutput stdout) throws I
dockerClientInstance.pullImage(ALPINE_LATEST);
assertThat(stdout.getOut()).contains("Docker pull command was interrupted");
}

/**
* Try to pull a private image from iexechub, require valid login and permissions.
* The test will fail if Docker Hub credentials are missing or invalid.
*/
@Test
void shouldPullPrivateImage() {
final String username = getEnvValue(DOCKERHUB_USERNAME_ENV_NAME);
final String password = getEnvValue(DOCKERHUB_PASSWORD_ENV_NAME);
// Get an authenticated docker client
final DockerClientInstance authClientInstance =
new DockerClientInstance(DockerClientInstance.DEFAULT_DOCKER_REGISTRY,
username, password);
// clean to avoid previous tests collisions
authClientInstance.removeImage(PRIVATE_IMAGE_NAME);
// pull image and check
assertThat(authClientInstance.pullImage(PRIVATE_IMAGE_NAME)).isTrue();
// clean
authClientInstance.removeImage(PRIVATE_IMAGE_NAME);
}
//endregion

//region getImageId
Expand Down