use of org.opennms.netmgt.mock.MockNode in project opennms by OpenNMS.
the class PollerIT method testNodeOutageProcessingEnabled.
// test whole node down
@Test
public void testNodeOutageProcessingEnabled() throws Exception {
m_pollerConfig.setNodeOutageProcessingEnabled(true);
MockNode node = m_network.getNode(1);
// start the poller
startDaemons();
resetAnticipated();
anticipateDown(node);
// brind down the node (duh)
node.bringDown();
// make sure the correct events are recieved
verifyAnticipated(10000);
resetAnticipated();
anticipateUp(node);
// bring the node back up
node.bringUp();
// make sure the up events are received
verifyAnticipated(10000);
}
use of org.opennms.netmgt.mock.MockNode in project opennms by OpenNMS.
the class PollerQueryManagerDaoIT method testNodeOutageProcessingEnabled.
// test whole node down
@Test
public void testNodeOutageProcessingEnabled() throws Exception {
m_pollerConfig.setNodeOutageProcessingEnabled(true);
MockNode node = m_network.getNode(1);
// start the poller
startDaemons();
resetAnticipated();
anticipateDown(node);
// brind down the node (duh)
node.bringDown();
// make sure the correct events are recieved
verifyAnticipated(10000);
resetAnticipated();
anticipateUp(node);
// bring the node back up
node.bringUp();
// make sure the up events are received
verifyAnticipated(10000);
}
use of org.opennms.netmgt.mock.MockNode in project opennms by OpenNMS.
the class PollerQueryManagerDaoIT method testReparentCausesStatusChange.
// test open outages for unmanaged services
@Test
public void testReparentCausesStatusChange() {
m_pollerConfig.setNodeOutageProcessingEnabled(true);
MockNode node1 = m_network.getNode(1);
MockNode node2 = m_network.getNode(2);
MockInterface dotOne = m_network.getInterface(1, "192.168.1.1");
MockInterface dotTwo = m_network.getInterface(1, "192.168.1.2");
MockInterface dotThree = m_network.getInterface(2, "192.168.1.3");
//
// Plan to bring down both nodes except the reparented interface
// the node owning the interface should be up while the other is down
// after reparenting we should got the old owner go down while the other
// comes up.
//
anticipateDown(node2);
anticipateDown(dotOne);
// bring down both nodes but bring iface back up
node1.bringDown();
node2.bringDown();
dotTwo.bringUp();
Event reparentEvent = MockEventUtil.createReparentEvent("Test", "192.168.1.2", 1, 2);
startDaemons();
verifyAnticipated(2000);
m_db.reparentInterface(dotTwo.getIpAddr(), dotTwo.getNodeId(), node2.getNodeId());
dotTwo.moveTo(node2);
resetAnticipated();
anticipateDown(node1, true);
anticipateUp(node2, true);
anticipateDown(dotThree, true);
m_eventMgr.sendEventToListeners(reparentEvent);
verifyAnticipated(20000);
}
use of org.opennms.netmgt.mock.MockNode in project opennms by OpenNMS.
the class PollerIT method testNodeOutagesClosedOnDelete.
@Test
public void testNodeOutagesClosedOnDelete() {
MockNode element = m_network.getNode(1);
testOutagesClosedOnDelete(element);
}
use of org.opennms.netmgt.mock.MockNode in project opennms by OpenNMS.
the class PollerIT method testNodeDeleted.
// nodeDeleted: EventConstants.NODE_DELETED_EVENT_UEI
@Test
public void testNodeDeleted() {
MockNode node = m_network.getNode(1);
testElementDeleted(node);
}
Aggregations