Skip to content

Commit 3e6aeda

Browse files
authored
Merge pull request #214 from iExecBlockchainComputing/fix
Add encryption container logs to stdout
2 parents 0614e2e + 0fd5f62 commit 3e6aeda

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/java/com/iexec/worker/docker/ComputationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public Pair<ReplicateStatus, String> runTeeComputation(TaskDescription taskDescr
142142
}
143143

144144
// encrypt result
145-
customDockerClient.dockerRun(chainTaskId, sconeEncrypterConfig, maxExecutionTime);
145+
stdout += customDockerClient.dockerRun(chainTaskId, sconeEncrypterConfig, maxExecutionTime);
146146
return Pair.of(COMPUTED, stdout);
147147
}
148148
}

src/test/java/com/iexec/worker/docker/ComputationServiceTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ public void shouldComputeTeeTask() {
146146
TaskDescription task = getStubTaskDescription(false);
147147
ContributionAuthorization contributionAuth = getStubAuth(TEE_ENCLAVE_CHALLENGE);
148148
ContainerConfig containerConfig = mock(ContainerConfig.class);
149-
String expectedStdout = "Computed successfully 1 !";
149+
String expectedStdout1 = "Computed successfully 1 !";
150+
String expectedStdout2 = "Computed successfully 1 !";
150151
String awesomeSessionId = "awesomeSessionId";
151152
ArrayList<String> stubSconeEnv = new ArrayList<>();
152153
stubSconeEnv.add("fooBar");
@@ -157,12 +158,13 @@ public void shouldComputeTeeTask() {
157158
when(customDockerClient.buildSconeContainerConfig(any(), any(), any(), any()))
158159
.thenReturn(containerConfig);
159160
when(customDockerClient.dockerRun(CHAIN_TASK_ID, containerConfig, task.getMaxExecutionTime()))
160-
.thenReturn(expectedStdout);
161+
.thenReturn(expectedStdout1)
162+
.thenReturn(expectedStdout2);
161163

162164
Pair<ReplicateStatus, String> result = computationService.runTeeComputation(task, contributionAuth);
163165

164166
assertThat(result.getLeft()).isEqualTo(COMPUTED);
165-
assertThat(result.getRight()).isEqualTo(expectedStdout);
167+
assertThat(result.getRight()).isEqualTo(expectedStdout1 + expectedStdout2);
166168
}
167169

168170
@Test

0 commit comments

Comments
 (0)