|
@@ -1958,16 +1958,16 @@ public class TestDockerContainerRuntime {
|
|
ArgumentCaptor<PrivilegedOperation> opCaptor = ArgumentCaptor.forClass(
|
|
ArgumentCaptor<PrivilegedOperation> opCaptor = ArgumentCaptor.forClass(
|
|
PrivilegedOperation.class);
|
|
PrivilegedOperation.class);
|
|
|
|
|
|
- //single invocation expected
|
|
|
|
|
|
+ //Three invocations expected (volume creation, volume check, run container)
|
|
//due to type erasure + mocking, this verification requires a suppress
|
|
//due to type erasure + mocking, this verification requires a suppress
|
|
// warning annotation on the entire method
|
|
// warning annotation on the entire method
|
|
- verify(mockExecutor, times(2))
|
|
|
|
|
|
+ verify(mockExecutor, times(3))
|
|
.executePrivilegedOperation(anyList(), opCaptor.capture(), any(
|
|
.executePrivilegedOperation(anyList(), opCaptor.capture(), any(
|
|
File.class), anyMap(), anyBoolean(), anyBoolean());
|
|
File.class), anyMap(), anyBoolean(), anyBoolean());
|
|
|
|
|
|
//verification completed. we need to isolate specific invications.
|
|
//verification completed. we need to isolate specific invications.
|
|
// hence, reset mock here
|
|
// hence, reset mock here
|
|
- Mockito.reset(mockExecutor);
|
|
|
|
|
|
+ //Mockito.reset(mockExecutor);
|
|
|
|
|
|
List<PrivilegedOperation> allCaptures = opCaptor.getAllValues();
|
|
List<PrivilegedOperation> allCaptures = opCaptor.getAllValues();
|
|
|
|
|
|
@@ -2070,10 +2070,8 @@ public class TestDockerContainerRuntime {
|
|
|
|
|
|
try {
|
|
try {
|
|
runtime.prepareContainer(containerRuntimeContext);
|
|
runtime.prepareContainer(containerRuntimeContext);
|
|
-
|
|
|
|
- checkVolumeCreateCommand();
|
|
|
|
-
|
|
|
|
runtime.launchContainer(containerRuntimeContext);
|
|
runtime.launchContainer(containerRuntimeContext);
|
|
|
|
+ checkVolumeCreateCommand();
|
|
} catch (ContainerExecutionException e) {
|
|
} catch (ContainerExecutionException e) {
|
|
if (expectFail) {
|
|
if (expectFail) {
|
|
// Expected
|
|
// Expected
|
|
@@ -2166,10 +2164,11 @@ public class TestDockerContainerRuntime {
|
|
ContainerRuntimeContext containerRuntimeContext = builder.build();
|
|
ContainerRuntimeContext containerRuntimeContext = builder.build();
|
|
|
|
|
|
runtime.prepareContainer(containerRuntimeContext);
|
|
runtime.prepareContainer(containerRuntimeContext);
|
|
- checkVolumeCreateCommand();
|
|
|
|
|
|
|
|
runtime.launchContainer(containerRuntimeContext);
|
|
runtime.launchContainer(containerRuntimeContext);
|
|
- List<String> dockerCommands = readDockerCommands();
|
|
|
|
|
|
+ checkVolumeCreateCommand();
|
|
|
|
+
|
|
|
|
+ List<String> dockerCommands = readDockerCommands(3);
|
|
|
|
|
|
int expected = 14;
|
|
int expected = 14;
|
|
int counter = 0;
|
|
int counter = 0;
|