Search in sources :

Example 1 with PingTestCommand

use of com.cloud.legacymodel.communication.command.PingTestCommand in project cosmic by MissionCriticalCloud.

the class LibvirtComputingResourceTest method testPingOnlyOneIpCommand.

@Test
public void testPingOnlyOneIpCommand() {
    final PingTestCommand command = new PingTestCommand("127.0.0.1", null);
    final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
    assertNotNull(wrapper);
    final Answer answer = wrapper.execute(command, this.libvirtComputingResource);
    assertFalse(answer.getResult());
}
Also used : Answer(com.cloud.legacymodel.communication.answer.Answer) CheckRouterAnswer(com.cloud.legacymodel.communication.answer.CheckRouterAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) LibvirtRequestWrapper(com.cloud.agent.resource.kvm.wrapper.LibvirtRequestWrapper) PingTestCommand(com.cloud.legacymodel.communication.command.PingTestCommand) Test(org.junit.Test)

Example 2 with PingTestCommand

use of com.cloud.legacymodel.communication.command.PingTestCommand in project cosmic by MissionCriticalCloud.

the class NotAValidCommand method testPingTestCommandRouterPvtIps.

@Test
public void testPingTestCommandRouterPvtIps() {
    final PingTestCommand pingTestCommand = new PingTestCommand("127.0.0.1", "127.0.0.1");
    final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
    assertNotNull(wrapper);
    final Answer answer = wrapper.execute(pingTestCommand, this.citrixResourceBase);
    verify(this.citrixResourceBase, times(1)).getConnection();
    assertFalse(answer.getResult());
}
Also used : RebootAnswer(com.cloud.legacymodel.communication.answer.RebootAnswer) Answer(com.cloud.legacymodel.communication.answer.Answer) CreateAnswer(com.cloud.legacymodel.communication.answer.CreateAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) PingTestCommand(com.cloud.legacymodel.communication.command.PingTestCommand) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 3 with PingTestCommand

use of com.cloud.legacymodel.communication.command.PingTestCommand in project cosmic by MissionCriticalCloud.

the class NotAValidCommand method testPingTestCommandHostIp.

@Test
public void testPingTestCommandHostIp() {
    final PingTestCommand pingTestCommand = new PingTestCommand("127.0.0.1");
    final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
    assertNotNull(wrapper);
    final Answer answer = wrapper.execute(pingTestCommand, this.citrixResourceBase);
    verify(this.citrixResourceBase, times(1)).getConnection();
    assertFalse(answer.getResult());
}
Also used : RebootAnswer(com.cloud.legacymodel.communication.answer.RebootAnswer) Answer(com.cloud.legacymodel.communication.answer.Answer) CreateAnswer(com.cloud.legacymodel.communication.answer.CreateAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) PingTestCommand(com.cloud.legacymodel.communication.command.PingTestCommand) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 4 with PingTestCommand

use of com.cloud.legacymodel.communication.command.PingTestCommand in project cosmic by MissionCriticalCloud.

the class LibvirtComputingResourceTest method testPingTestHostIpCommand.

@Test
public void testPingTestHostIpCommand() {
    final PingTestCommand command = new PingTestCommand("127.0.0.1");
    final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
    assertNotNull(wrapper);
    final Answer answer = wrapper.execute(command, this.libvirtComputingResource);
    assertFalse(answer.getResult());
}
Also used : Answer(com.cloud.legacymodel.communication.answer.Answer) CheckRouterAnswer(com.cloud.legacymodel.communication.answer.CheckRouterAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) LibvirtRequestWrapper(com.cloud.agent.resource.kvm.wrapper.LibvirtRequestWrapper) PingTestCommand(com.cloud.legacymodel.communication.command.PingTestCommand) Test(org.junit.Test)

Example 5 with PingTestCommand

use of com.cloud.legacymodel.communication.command.PingTestCommand in project cosmic by MissionCriticalCloud.

the class LibvirtComputingResourceTest method testPingTestPvtIpCommand.

@Test
public void testPingTestPvtIpCommand() {
    final PingTestCommand command = new PingTestCommand("127.0.0.1", "127.0.0.1");
    final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
    assertNotNull(wrapper);
    final Answer answer = wrapper.execute(command, this.libvirtComputingResource);
    assertFalse(answer.getResult());
}
Also used : Answer(com.cloud.legacymodel.communication.answer.Answer) CheckRouterAnswer(com.cloud.legacymodel.communication.answer.CheckRouterAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) LibvirtRequestWrapper(com.cloud.agent.resource.kvm.wrapper.LibvirtRequestWrapper) PingTestCommand(com.cloud.legacymodel.communication.command.PingTestCommand) Test(org.junit.Test)

Aggregations

Answer (com.cloud.legacymodel.communication.answer.Answer)6 PingTestCommand (com.cloud.legacymodel.communication.command.PingTestCommand)6 AttachAnswer (com.cloud.legacymodel.communication.answer.AttachAnswer)5 Test (org.junit.Test)5 LibvirtRequestWrapper (com.cloud.agent.resource.kvm.wrapper.LibvirtRequestWrapper)3 CheckRouterAnswer (com.cloud.legacymodel.communication.answer.CheckRouterAnswer)3 CreateAnswer (com.cloud.legacymodel.communication.answer.CreateAnswer)2 RebootAnswer (com.cloud.legacymodel.communication.answer.RebootAnswer)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 ArrayList (java.util.ArrayList)1