Skip to content

Commit 21b8b1a

Browse files
committed
review comments
1 parent 22eb362 commit 21b8b1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapperTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public void testExecuteWithRsyncFailure() throws Exception {
373373
.thenAnswer(invocation -> {
374374
String command = invocation.getArgument(0);
375375
if (command.contains("mount")) {
376-
return 0; // File exists
376+
return 0; // mount success
377377
} else if (command.contains("rsync")) {
378378
return 1; // Rsync failure
379379
}
@@ -429,7 +429,7 @@ public void testExecuteWithAttachVolumeFailure() throws Exception {
429429
.thenAnswer(invocation -> {
430430
String command = invocation.getArgument(0);
431431
if (command.contains("mount")) {
432-
return 0; // File exists
432+
return 0; // Mount success
433433
} else if (command.contains("rsync")) {
434434
return 0; // Rsync success
435435
}
@@ -522,6 +522,8 @@ public void testExecuteWithMultipleVolumes() throws Exception {
522522
filesMock.when(() -> Files.createTempDirectory(anyString())).thenReturn(tempPath);
523523

524524
try (MockedStatic<Script> scriptMock = mockStatic(Script.class)) {
525+
scriptMock.when(() -> Script.runSimpleBashScriptForExitValue(anyString()))
526+
.thenReturn(0); // All commands success
525527
scriptMock.when(() -> Script.runSimpleBashScriptForExitValue(anyString(), anyInt(), any(Boolean.class)))
526528
.thenReturn(0); // All commands success
527529

0 commit comments

Comments
 (0)