Skip to content

Commit 14c123e

Browse files
Merge branch 'fix/libvirt_unittests_timeout' of https://github.com/schubergphilis/cloudstack
This closes #270
2 parents 1c112ce + 982a023 commit 14c123e

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ public void testRebootRouterCommand() {
857857
final LibvirtUtilitiesHelper libvirtUtilitiesHelper = Mockito.mock(LibvirtUtilitiesHelper.class);
858858

859859
final String vmName = "Test";
860-
final RebootRouterCommand command = new RebootRouterCommand(vmName, "192.168.0.10");
860+
final RebootRouterCommand command = new RebootRouterCommand(vmName, "127.0.0.1");
861861

862862
when(libvirtComputingResource.getVirtRouterResource()).thenReturn(routingResource);
863863
when(libvirtComputingResource.getLibvirtUtilitiesHelper()).thenReturn(libvirtUtilitiesHelper);
@@ -890,7 +890,7 @@ public void testRebootRouterCommandConnect() {
890890
final LibvirtUtilitiesHelper libvirtUtilitiesHelper = Mockito.mock(LibvirtUtilitiesHelper.class);
891891

892892
final String vmName = "Test";
893-
final RebootRouterCommand command = new RebootRouterCommand(vmName, "192.168.0.10");
893+
final RebootRouterCommand command = new RebootRouterCommand(vmName, "127.0.0.1");
894894

895895
when(libvirtComputingResource.getVirtRouterResource()).thenReturn(routingResource);
896896
when(libvirtComputingResource.getLibvirtUtilitiesHelper()).thenReturn(libvirtUtilitiesHelper);
@@ -1235,7 +1235,7 @@ public void testMigrateCommand() {
12351235
try {
12361236
when(conn.domainLookupByName(vmName)).thenReturn(dm);
12371237

1238-
when(libvirtComputingResource.getPrivateIp()).thenReturn("192.168.1.10");
1238+
when(libvirtComputingResource.getPrivateIp()).thenReturn("127.0.0.1");
12391239
when(dm.getXMLDesc(0)).thenReturn("host_domain");
12401240
when(dm.isPersistent()).thenReturn(1);
12411241
doNothing().when(dm).undefine();
@@ -1271,7 +1271,7 @@ public void testMigrateCommand() {
12711271

12721272
@Test
12731273
public void testPingTestHostIpCommand() {
1274-
final PingTestCommand command = new PingTestCommand("172.1.10.10");
1274+
final PingTestCommand command = new PingTestCommand("127.0.0.1");
12751275

12761276
final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
12771277
assertNotNull(wrapper);
@@ -1282,7 +1282,7 @@ public void testPingTestHostIpCommand() {
12821282

12831283
@Test
12841284
public void testPingTestPvtIpCommand() {
1285-
final PingTestCommand command = new PingTestCommand("169.17.1.10", "192.168.10.10");
1285+
final PingTestCommand command = new PingTestCommand("127.0.0.1", "127.0.0.1");
12861286

12871287
final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
12881288
assertNotNull(wrapper);
@@ -1293,7 +1293,7 @@ public void testPingTestPvtIpCommand() {
12931293

12941294
@Test
12951295
public void testPingOnlyOneIpCommand() {
1296-
final PingTestCommand command = new PingTestCommand("169.17.1.10", null);
1296+
final PingTestCommand command = new PingTestCommand("127.0.0.1", null);
12971297

12981298
final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
12991299
assertNotNull(wrapper);
@@ -1632,7 +1632,7 @@ public void testWatchConsoleProxyLoadCommand() {
16321632
final int interval = 0;
16331633
final long proxyVmId = 0l;
16341634
final String proxyVmName = "host";
1635-
final String proxyManagementIp = "169.172.15.16";
1635+
final String proxyManagementIp = "127.0.0.1";
16361636
final int proxyCmdPort = 0;
16371637

16381638
final WatchConsoleProxyLoadCommand command = new WatchConsoleProxyLoadCommand(interval, proxyVmId, proxyVmName, proxyManagementIp, proxyCmdPort);
@@ -1648,7 +1648,7 @@ public void testWatchConsoleProxyLoadCommand() {
16481648
public void testCheckConsoleProxyLoadCommand() {
16491649
final long proxyVmId = 0l;
16501650
final String proxyVmName = "host";
1651-
final String proxyManagementIp = "169.172.15.16";
1651+
final String proxyManagementIp = "127.0.0.1";
16521652
final int proxyCmdPort = 0;
16531653

16541654
final CheckConsoleProxyLoadCommand command = new CheckConsoleProxyLoadCommand(proxyVmId, proxyVmName, proxyManagementIp, proxyCmdPort);
@@ -2440,7 +2440,7 @@ public void testCleanupNetworkRulesCmd() {
24402440
public void testNetworkRulesVmSecondaryIpCommand() {
24412441
final String vmName = "Test";
24422442
final String vmMac = "00:00:00:00";
2443-
final String secondaryIp = "172.168.25.25";
2443+
final String secondaryIp = "127.0.0.1";
24442444
final boolean action = true;
24452445

24462446
final NetworkRulesVmSecondaryIpCommand command = new NetworkRulesVmSecondaryIpCommand(vmName, vmMac, secondaryIp, action );
@@ -2476,7 +2476,7 @@ public void testNetworkRulesVmSecondaryIpCommand() {
24762476
public void testNetworkRulesVmSecondaryIpCommandFailure() {
24772477
final String vmName = "Test";
24782478
final String vmMac = "00:00:00:00";
2479-
final String secondaryIp = "172.168.25.25";
2479+
final String secondaryIp = "127.0.0.1";
24802480
final boolean action = true;
24812481

24822482
final NetworkRulesVmSecondaryIpCommand command = new NetworkRulesVmSecondaryIpCommand(vmName, vmMac, secondaryIp, action );
@@ -2570,7 +2570,7 @@ public void testNetworkRulesSystemVmCommandFailure() {
25702570
@Test
25712571
public void testCheckSshCommand() {
25722572
final String instanceName = "Test";
2573-
final String ip = "172.16.16.16";
2573+
final String ip = "127.0.0.1";
25742574
final int port = 22;
25752575

25762576
final CheckSshCommand command = new CheckSshCommand(instanceName, ip, port);
@@ -2596,7 +2596,7 @@ public void testCheckSshCommand() {
25962596
@Test
25972597
public void testCheckSshCommandFailure() {
25982598
final String instanceName = "Test";
2599-
final String ip = "172.16.16.16";
2599+
final String ip = "127.0.0.1";
26002600
final int port = 22;
26012601

26022602
final CheckSshCommand command = new CheckSshCommand(instanceName, ip, port);
@@ -2787,12 +2787,12 @@ public void testCheckOnHostCommand() {
27872787

27882788
@Test
27892789
public void testOvsCreateTunnelCommand() {
2790-
final String remoteIp = "172.16.16.16";
2790+
final String remoteIp = "127.0.0.1";
27912791
final Integer key = 1;
27922792
final Long from = 1l;
27932793
final Long to = 2l;
27942794
final long networkId = 1l;
2795-
final String fromIp = "172.15.15.15";
2795+
final String fromIp = "127.0.0.1";
27962796
final String networkName = "eth";
27972797
final String networkUuid = "8edb1156-a851-4914-afc6-468ee52ac861";
27982798

@@ -2817,12 +2817,12 @@ public void testOvsCreateTunnelCommand() {
28172817

28182818
@Test
28192819
public void testOvsCreateTunnelCommandFailure1() {
2820-
final String remoteIp = "172.16.16.16";
2820+
final String remoteIp = "127.0.0.1";
28212821
final Integer key = 1;
28222822
final Long from = 1l;
28232823
final Long to = 2l;
28242824
final long networkId = 1l;
2825-
final String fromIp = "172.15.15.15";
2825+
final String fromIp = "127.0.0.1";
28262826
final String networkName = "eth";
28272827
final String networkUuid = "8edb1156-a851-4914-afc6-468ee52ac861";
28282828

@@ -2848,12 +2848,12 @@ public void testOvsCreateTunnelCommandFailure1() {
28482848
@SuppressWarnings("unchecked")
28492849
@Test
28502850
public void testOvsCreateTunnelCommandFailure2() {
2851-
final String remoteIp = "172.16.16.16";
2851+
final String remoteIp = "127.0.0.1";
28522852
final Integer key = 1;
28532853
final Long from = 1l;
28542854
final Long to = 2l;
28552855
final long networkId = 1l;
2856-
final String fromIp = "172.15.15.15";
2856+
final String fromIp = "127.0.0.1";
28572857
final String networkName = "eth";
28582858
final String networkUuid = "8edb1156-a851-4914-afc6-468ee52ac861";
28592859

@@ -2991,7 +2991,7 @@ public void testFenceCommand() {
29912991

29922992
@Test
29932993
public void testSecurityGroupRulesCmdFalse() {
2994-
final String guestIp = "172.16.16.16";
2994+
final String guestIp = "127.0.0.1";
29952995
final String guestMac = "00:00:00:00";
29962996
final String vmName = "Test";
29972997
final Long vmId = 1l;
@@ -3043,7 +3043,7 @@ public void testSecurityGroupRulesCmdFalse() {
30433043

30443044
@Test
30453045
public void testSecurityGroupRulesCmdTrue() {
3046-
final String guestIp = "172.16.16.16";
3046+
final String guestIp = "127.0.0.1";
30473047
final String guestMac = "00:00:00:00";
30483048
final String vmName = "Test";
30493049
final Long vmId = 1l;
@@ -3105,7 +3105,7 @@ public void testSecurityGroupRulesCmdTrue() {
31053105
@SuppressWarnings("unchecked")
31063106
@Test
31073107
public void testSecurityGroupRulesCmdException() {
3108-
final String guestIp = "172.16.16.16";
3108+
final String guestIp = "127.0.0.1";
31093109
final String guestMac = "00:00:00:00";
31103110
final String vmName = "Test";
31113111
final Long vmId = 1l;
@@ -3625,7 +3625,7 @@ public void testCreatePrivateTemplateFromVolumeCommand() {
36253625
//The code is way to big and complex. Will finish the refactor and come back to this to add more cases.
36263626

36273627
final StoragePool pool = Mockito.mock(StoragePool.class);;
3628-
final String secondaryStorageUrl = "nfs:/192.168.2.2/storage/secondary";
3628+
final String secondaryStorageUrl = "nfs:/127.0.0.1/storage/secondary";
36293629
final long templateId = 1l;
36303630
final long accountId = 1l;
36313631
final String userSpecifiedName = "User";
@@ -3762,7 +3762,7 @@ public void testBackupSnapshotCommandLibvirtException() {
37623762
//The code is way to big and complex. Will finish the refactor and come back to this to add more cases.
37633763

37643764
final StoragePool pool = Mockito.mock(StoragePool.class);;
3765-
final String secondaryStorageUrl = "nfs:/192.168.2.2/storage/secondary";
3765+
final String secondaryStorageUrl = "nfs:/127.0.0.1/storage/secondary";
37663766
final long accountId = 1l;
37673767
final String volumePath = "/123/vol";
37683768
final String vmName = "Test";
@@ -3809,7 +3809,7 @@ public void testBackupSnapshotCommandLibvirtException() {
38093809
@Test
38103810
public void testCreatePrivateTemplateFromSnapshotCommand() {
38113811
final StoragePool pool = Mockito.mock(StoragePool.class);
3812-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
3812+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
38133813
final Long dcId = 1l;
38143814
final Long accountId = 1l;
38153815
final Long volumeId = 1l;
@@ -3883,7 +3883,7 @@ public void testCreatePrivateTemplateFromSnapshotCommand() {
38833883
@Test
38843884
public void testCreatePrivateTemplateFromSnapshotCommandConfigurationException() {
38853885
final StoragePool pool = Mockito.mock(StoragePool.class);
3886-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
3886+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
38873887
final Long dcId = 1l;
38883888
final Long accountId = 1l;
38893889
final Long volumeId = 1l;
@@ -3957,7 +3957,7 @@ public void testCreatePrivateTemplateFromSnapshotCommandConfigurationException()
39573957
@Test
39583958
public void testCreatePrivateTemplateFromSnapshotCommandInternalErrorException() {
39593959
final StoragePool pool = Mockito.mock(StoragePool.class);
3960-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
3960+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
39613961
final Long dcId = 1l;
39623962
final Long accountId = 1l;
39633963
final Long volumeId = 1l;
@@ -4030,7 +4030,7 @@ public void testCreatePrivateTemplateFromSnapshotCommandInternalErrorException()
40304030
@Test
40314031
public void testCreatePrivateTemplateFromSnapshotCommandIOException() {
40324032
final StoragePool pool = Mockito.mock(StoragePool.class);
4033-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
4033+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
40344034
final Long dcId = 1l;
40354035
final Long accountId = 1l;
40364036
final Long volumeId = 1l;
@@ -4109,7 +4109,7 @@ public void testCreatePrivateTemplateFromSnapshotCommandIOException() {
41094109
@Test
41104110
public void testCreatePrivateTemplateFromSnapshotCommandCloudRuntime() {
41114111
final StoragePool pool = Mockito.mock(StoragePool.class);
4112-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
4112+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
41134113
final Long dcId = 1l;
41144114
final Long accountId = 1l;
41154115
final Long volumeId = 1l;
@@ -4156,7 +4156,7 @@ public void testCreatePrivateTemplateFromSnapshotCommandCloudRuntime() {
41564156
@Test
41574157
public void testCopyVolumeCommand() {
41584158
final StoragePool storagePool = Mockito.mock(StoragePool.class);
4159-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
4159+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
41604160
final Long volumeId = 1l;
41614161
final int wait = 0;
41624162
final String volumePath = "/vol/path";
@@ -4203,7 +4203,7 @@ public void testCopyVolumeCommand() {
42034203
@Test
42044204
public void testCopyVolumeCommandToSecFalse() {
42054205
final StoragePool storagePool = Mockito.mock(StoragePool.class);
4206-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
4206+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
42074207
final Long volumeId = 1l;
42084208
final int wait = 0;
42094209
final String volumePath = "/vol/path";
@@ -4247,7 +4247,7 @@ public void testCopyVolumeCommandToSecFalse() {
42474247
@Test
42484248
public void testCopyVolumeCommandCloudRuntime() {
42494249
final StoragePool storagePool = Mockito.mock(StoragePool.class);
4250-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
4250+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
42514251
final Long volumeId = 1l;
42524252
final int wait = 0;
42534253
final String volumePath = "/vol/path";
@@ -4288,7 +4288,7 @@ public void testCopyVolumeCommandCloudRuntime() {
42884288
@Test
42894289
public void testCopyVolumeCommandCloudRuntime2() {
42904290
final StoragePool storagePool = Mockito.mock(StoragePool.class);
4291-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
4291+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
42924292
final Long volumeId = 1l;
42934293
final int wait = 0;
42944294
final String volumePath = "/vol/path";
@@ -4316,7 +4316,7 @@ public void testCopyVolumeCommandCloudRuntime2() {
43164316
@Test
43174317
public void testCopyVolumeCommandPrimaryNotFound() {
43184318
final StoragePool storagePool = Mockito.mock(StoragePool.class);
4319-
final String secondaryStoragePoolURL = "nfs:/192.168.2.2/storage/secondary";
4319+
final String secondaryStoragePoolURL = "nfs:/127.0.0.1/storage/secondary";
43204320
final Long volumeId = 1l;
43214321
final int wait = 0;
43224322
final String volumePath = "/vol/path";
@@ -4367,7 +4367,7 @@ public void testPvlanSetupCommandDhcpAdd() {
43674367
final String networkTag = "/105";
43684368
final String dhcpName = "dhcp";
43694369
final String dhcpMac = "00:00:00:00";
4370-
final String dhcpIp = "172.10.10.10";
4370+
final String dhcpIp = "127.0.0.1";
43714371

43724372
final PvlanSetupCommand command = PvlanSetupCommand.createDhcpSetup(op, uri, networkTag, dhcpName, dhcpMac, dhcpIp);
43734373

@@ -4440,7 +4440,7 @@ public void testPvlanSetupCommandDhcpException() {
44404440
final String networkTag = "/105";
44414441
final String dhcpName = "dhcp";
44424442
final String dhcpMac = "00:00:00:00";
4443-
final String dhcpIp = "172.10.10.10";
4443+
final String dhcpIp = "127.0.0.1";
44444444

44454445
final PvlanSetupCommand command = PvlanSetupCommand.createDhcpSetup(op, uri, networkTag, dhcpName, dhcpMac, dhcpIp);
44464446

@@ -4482,7 +4482,7 @@ public void testPvlanSetupCommandDhcpDelete() {
44824482
final String networkTag = "/105";
44834483
final String dhcpName = "dhcp";
44844484
final String dhcpMac = "00:00:00:00";
4485-
final String dhcpIp = "172.10.10.10";
4485+
final String dhcpIp = "127.0.0.1";
44864486

44874487
final PvlanSetupCommand command = PvlanSetupCommand.createDhcpSetup(op, uri, networkTag, dhcpName, dhcpMac, dhcpIp);
44884488

@@ -4506,7 +4506,7 @@ public void testPvlanSetupCommandDhcpDelete() {
45064506

45074507
@Test
45084508
public void testResizeVolumeCommand() {
4509-
final String path = "nfs:/192.168.2.2/storage/secondary";
4509+
final String path = "nfs:/127.0.0.1/storage/secondary";
45104510
final StorageFilerTO pool = Mockito.mock(StorageFilerTO.class);
45114511
final Long currentSize = 100l;
45124512
final Long newSize = 200l;
@@ -4559,7 +4559,7 @@ public void testResizeVolumeCommand() {
45594559

45604560
@Test
45614561
public void testResizeVolumeCommandSameSize() {
4562-
final String path = "nfs:/192.168.2.2/storage/secondary";
4562+
final String path = "nfs:/127.0.0.1/storage/secondary";
45634563
final StorageFilerTO pool = Mockito.mock(StorageFilerTO.class);
45644564
final Long currentSize = 100l;
45654565
final Long newSize = 100l;
@@ -4577,7 +4577,7 @@ public void testResizeVolumeCommandSameSize() {
45774577

45784578
@Test
45794579
public void testResizeVolumeCommandShrink() {
4580-
final String path = "nfs:/192.168.2.2/storage/secondary";
4580+
final String path = "nfs:/127.0.0.1/storage/secondary";
45814581
final StorageFilerTO pool = Mockito.mock(StorageFilerTO.class);
45824582
final Long currentSize = 100l;
45834583
final Long newSize = 200l;
@@ -4606,7 +4606,7 @@ public void testResizeVolumeCommandShrink() {
46064606
@SuppressWarnings("unchecked")
46074607
@Test
46084608
public void testResizeVolumeCommandException() {
4609-
final String path = "nfs:/192.168.2.2/storage/secondary";
4609+
final String path = "nfs:/127.0.0.1/storage/secondary";
46104610
final StorageFilerTO pool = Mockito.mock(StorageFilerTO.class);
46114611
final Long currentSize = 100l;
46124612
final Long newSize = 200l;
@@ -4654,7 +4654,7 @@ public void testResizeVolumeCommandException() {
46544654
@SuppressWarnings("unchecked")
46554655
@Test
46564656
public void testResizeVolumeCommandException2() {
4657-
final String path = "nfs:/192.168.2.2/storage/secondary";
4657+
final String path = "nfs:/127.0.0.1/storage/secondary";
46584658
final StorageFilerTO pool = Mockito.mock(StorageFilerTO.class);
46594659
final Long currentSize = 100l;
46604660
final Long newSize = 200l;

0 commit comments

Comments
 (0)