@Test @JUnitSnmpAgents( value = {@JUnitSnmpAgent(host = Sluck001_IP, port = 161, resource = Sluck001_SNMP_RESOURCE)}) public void testNetworkLinksCiscoJuniperVlan() throws Exception { m_nodeDao.save(builder.getSluck001()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseIsisDiscovery(false); example1.setUseIpRouteDiscovery(false); example1.setUseOspfDiscovery(false); example1.setUseLldpDiscovery(false); example1.setUseCdpDiscovery(false); example1.setUseBridgeDiscovery(false); example1.setEnableVlanDiscovery(true); example1.setSaveStpNodeTable(false); example1.setSaveStpInterfaceTable(false); example1.setSaveRouteTable(false); final OnmsNode switchCisco = m_nodeDao.findByForeignId("linkd", Sluck001_NAME); assertTrue(m_linkd.scheduleNodeCollection(switchCisco.getId())); assertTrue(m_linkd.runSingleSnmpCollection(switchCisco.getId())); assertEquals(7, m_vlanDao.countAll()); }
/* * fixed a fake link found using cdp: * caused by duplicated ip address s * r-uk-nott-newt-103:Fa0:(1)<------>(4):Fa3:r-ro-suce-pict-001 */ @Test @JUnitSnmpAgents( value = { @JUnitSnmpAgent(host = RPict001_IP, port = 161, resource = RPict001_SNMP_RESOURCE), @JUnitSnmpAgent(host = RNewt103_IP, port = 161, resource = RNewt103_SNMP_RESOURCE) }) public void testCdpFakeLinkRoUk() throws Exception { m_nodeDao.save(builder.getRPict001()); m_nodeDao.save(builder.getRNewt103()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseIsisDiscovery(false); example1.setUseIpRouteDiscovery(false); example1.setUseOspfDiscovery(false); example1.setUseLldpDiscovery(false); example1.setUseCdpDiscovery(true); example1.setUseBridgeDiscovery(false); example1.setEnableVlanDiscovery(false); example1.setSaveStpNodeTable(false); example1.setSaveStpInterfaceTable(false); example1.setSaveRouteTable(false); final OnmsNode routerRo = m_nodeDao.findByForeignId("linkd", RPict001_NAME); final OnmsNode routerUk = m_nodeDao.findByForeignId("linkd", RNewt103_NAME); assertTrue(m_linkd.scheduleNodeCollection(routerRo.getId())); assertTrue(m_linkd.scheduleNodeCollection(routerUk.getId())); assertTrue(m_linkd.runSingleSnmpCollection(routerRo.getId())); assertTrue(m_linkd.runSingleSnmpCollection(routerUk.getId())); assertEquals(0, m_dataLinkInterfaceDao.countAll()); assertTrue(m_linkd.runSingleLinkDiscovery("example1")); assertEquals(0, m_dataLinkInterfaceDao.countAll()); }
/* * We want to test that the next hop router discovered * links can be discovered using the ospf neb table */ @Test @JUnitSnmpAgents( value = { @JUnitSnmpAgent(host = PENROSE_IP, port = 161, resource = PENROSE_SNMP_RESOURCE), @JUnitSnmpAgent(host = DELAWARE_IP, port = 161, resource = DELAWARE_SNMP_RESOURCE) }) public void testNetwork1055StpLinks() throws Exception { m_nodeDao.save(builder.getPenrose()); m_nodeDao.save(builder.getDelaware()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseBridgeDiscovery(true); example1.setUseLldpDiscovery(false); example1.setUseCdpDiscovery(false); example1.setUseIpRouteDiscovery(false); example1.setUseOspfDiscovery(false); example1.setUseIsisDiscovery(false); example1.setSaveRouteTable(false); example1.setSaveStpInterfaceTable(false); example1.setSaveStpNodeTable(false); final OnmsNode penrose = m_nodeDao.findByForeignId("linkd", PENROSE_NAME); final OnmsNode delaware = m_nodeDao.findByForeignId("linkd", DELAWARE_NAME); assertTrue(m_linkd.scheduleNodeCollection(penrose.getId())); assertTrue(m_linkd.scheduleNodeCollection(delaware.getId())); assertTrue(m_linkd.runSingleSnmpCollection(penrose.getId())); assertTrue(m_linkd.runSingleSnmpCollection(delaware.getId())); assertEquals(0, m_dataLinkInterfaceDao.countAll()); assertTrue(m_linkd.runSingleLinkDiscovery("example1")); assertEquals(1, m_dataLinkInterfaceDao.countAll()); }
@Test @JUnitSnmpAgents( value = { @JUnitSnmpAgent(host = RDeEssnBrue_IP, port = 161, resource = RDeEssnBrue_SNMP_RESOURCE), @JUnitSnmpAgent( host = SDeEssnBrue081_IP, port = 161, resource = SDeEssnBrue081_SNMP_RESOURCE), @JUnitSnmpAgent( host = SDeEssnBrue121_IP, port = 161, resource = SDeEssnBrue121_SNMP_RESOURCE), @JUnitSnmpAgent( host = SDeEssnBrue142_IP, port = 161, resource = SDeEssnBrue142_SNMP_RESOURCE), @JUnitSnmpAgent( host = SDeEssnBrue165_IP, port = 161, resource = SDeEssnBrue165_SNMP_RESOURCE) }) public void testCiscoAlcatelEssnBrueLldp() { m_nodeDao.save(builder.getRDeEssnBrue()); m_nodeDao.save(builder.getSDeEssnBrue081()); m_nodeDao.save(builder.getSDeEssnBrue121()); m_nodeDao.save(builder.getSDeEssnBrue142()); m_nodeDao.save(builder.getSDeEssnBrue165()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseIsisDiscovery(false); example1.setUseIpRouteDiscovery(false); example1.setUseOspfDiscovery(false); example1.setUseLldpDiscovery(true); example1.setUseCdpDiscovery(false); example1.setUseBridgeDiscovery(false); example1.setEnableVlanDiscovery(false); example1.setSaveStpNodeTable(false); example1.setSaveStpInterfaceTable(false); example1.setSaveRouteTable(false); HibernateEventWriter queryManager = (HibernateEventWriter) m_linkd.getQueryManager(); assertEquals( 107, queryManager.getFromSysnameIfName(RDeEssnBrue_NAME, "Gi1/3/11").getIfIndex().intValue()); assertEquals( 260, queryManager.getFromSysnameIfName(RDeEssnBrue_NAME, "Gi2/3/11").getIfIndex().intValue()); assertEquals( 1025, queryManager.getFromSysnameIfIndex(SDeEssnBrue165_NAME, 1025).getIfIndex().intValue()); assertEquals( 2025, queryManager.getFromSysnameIfName(SDeEssnBrue165_NAME, "2/25").getIfIndex().intValue()); final OnmsNode routerCisco = m_nodeDao.findByForeignId("linkd", RDeEssnBrue_NAME); final OnmsNode swicthAlu081 = m_nodeDao.findByForeignId("linkd", SDeEssnBrue081_NAME); final OnmsNode swicthAlu121 = m_nodeDao.findByForeignId("linkd", SDeEssnBrue121_NAME); final OnmsNode swicthAlu142 = m_nodeDao.findByForeignId("linkd", SDeEssnBrue142_NAME); final OnmsNode swicthAlu165 = m_nodeDao.findByForeignId("linkd", SDeEssnBrue165_NAME); assertTrue(m_linkd.scheduleNodeCollection(routerCisco.getId())); assertTrue(m_linkd.scheduleNodeCollection(swicthAlu081.getId())); assertTrue(m_linkd.scheduleNodeCollection(swicthAlu121.getId())); assertTrue(m_linkd.scheduleNodeCollection(swicthAlu142.getId())); assertTrue(m_linkd.scheduleNodeCollection(swicthAlu165.getId())); assertTrue(m_linkd.runSingleSnmpCollection(routerCisco.getId())); assertTrue(m_linkd.runSingleSnmpCollection(swicthAlu081.getId())); assertTrue(m_linkd.runSingleSnmpCollection(swicthAlu121.getId())); assertTrue(m_linkd.runSingleSnmpCollection(swicthAlu142.getId())); assertTrue(m_linkd.runSingleSnmpCollection(swicthAlu165.getId())); assertEquals(0, m_dataLinkInterfaceDao.countAll()); assertTrue(m_linkd.runSingleLinkDiscovery("example1")); for (DataLinkInterface link : m_dataLinkInterfaceDao.findAll()) { printLink(link); } assertEquals(6, m_dataLinkInterfaceDao.countAll()); }
@Test @JUnitSnmpAgents( value = { @JUnitSnmpAgent( host = DARWIN_10_8_IP, port = 161, resource = "classpath:linkd/nms7467/" + DARWIN_10_8_IP + "-walk.txt") }) public void testDarwin108Collection() throws Exception { m_nodeDao.save(builder.getDarwin108()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseLldpDiscovery(false); example1.setUseOspfDiscovery(false); example1.setUseIsisDiscovery(false); m_linkdConfig.update(); final OnmsNode mac = m_nodeDao.findByForeignId("linkd", DARWIN_10_8_NAME); assertTrue(m_linkd.scheduleNodeCollection(mac.getId())); assertTrue(m_linkd.runSingleSnmpCollection(mac.getId())); // linkd has 1 linkable node assertEquals(1, m_linkd.getLinkableNodesOnPackage("example1").size()); LinkableNode linkNode = m_linkd.getLinkableNodesOnPackage("example1").iterator().next(); // linkabble node is not null assertTrue(linkNode != null); // has 1 route (next hop must be valid!) no ip route table assertEquals(0, linkNode.getRouteInterfaces().size()); // has 0 vlan assertEquals(0, m_vlanDao.countAll()); String packageName = m_linkdConfig.getFirstPackageMatch(InetAddressUtils.addr(DARWIN_10_8_IP)).getName(); assertEquals("example1", packageName); assertEquals(false, linkNode.isBridgeNode()); assertEquals(0, linkNode.getBridgeIdentifiers().size()); // no cdp inteface also if the walk return several interfaces assertEquals("cdp not supported", 0, linkNode.getCdpInterfaces().size()); // This make shure that the ip/mac association is saved /* * nodelabel:ip:mac:ifindex:ifdescr * DARWIN_10_8:172.20.1.28:0026b0ed8fb8:4:en0 * */ final Set<String> macAddresses = m_linkd.getMacAddressesOnPackage(packageName); assertNotNull(macAddresses); assertEquals(1, macAddresses.size()); List<AtInterface> ats = m_linkd.getAtInterfaces(packageName, "0026b0ed8fb8"); assertNotNull(ats); assertEquals("should have saved 1 ip to mac", 1, ats.size()); for (AtInterface at : ats) { if (at.getIpAddress().getHostAddress().equals("172.20.1.28")) assertTrue(at.getIfIndex().intValue() == 4); else assertTrue( "ip: " + at.getIpAddress().getHostAddress() + "does not match any known ip address", false); } // Now Let's test the database // 0 atinterface in database assertEquals(0, m_atInterfaceDao.findAll().size()); final Criteria criteria = new Criteria(OnmsIpRouteInterface.class); criteria.setAliases(Arrays.asList(new Alias[] {new Alias("node", "node", JoinType.LEFT_JOIN)})); criteria.addRestriction(new EqRestriction("node.id", mac.getId())); final List<OnmsIpRouteInterface> iproutes = m_ipRouteInterfaceDao.findMatching(criteria); // 4 route entry in database for (OnmsIpRouteInterface iproute : iproutes) { System.out.println( iproute.getRouteDest() + "/" + iproute.getRouteMask() + "/" + iproute.getRouteNextHop() + "/" + iproute.getRouteIfIndex()); } assertEquals(20, iproutes.size()); // 0 entry in vlan assertEquals(0, m_vlanDao.findAll().size()); // 0 entry in stpnode assertEquals(0, m_stpNodeDao.countAll()); // 0 entry in stpinterface assertEquals(0, m_stpInterfaceDao.findAll().size()); }
@Test @JUnitSnmpAgents( value = { @JUnitSnmpAgent( host = CISCO_C870_IP, port = 161, resource = "classpath:linkd/nms7467/" + CISCO_C870_IP + "-walk.txt") }) public void testCiscoC870Collection() throws Exception { m_nodeDao.save(builder.getCiscoC870()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseLldpDiscovery(false); example1.setUseOspfDiscovery(false); example1.setUseIsisDiscovery(false); final OnmsNode ciscorouter = m_nodeDao.findByForeignId("linkd", CISCO_C870_NAME); assertTrue(m_linkd.scheduleNodeCollection(ciscorouter.getId())); assertTrue(m_linkd.runSingleSnmpCollection(ciscorouter.getId())); // linkd has 1 linkable node assertEquals(1, m_linkd.getLinkableNodesOnPackage("example1").size()); LinkableNode linkNode = m_linkd.getLinkableNodesOnPackage("example1").iterator().next(); // linkabble node is not null assertTrue(linkNode != null); // has 0 route (next hop must be valid!) assertEquals(0, linkNode.getRouteInterfaces().size()); // has 0 vlan assertEquals(0, m_vlanDao.countAll()); String packageName = m_linkdConfig.getFirstPackageMatch(InetAddressUtils.addr(CISCO_C870_IP)).getName(); assertEquals("example1", packageName); assertEquals(1, linkNode.getBridgeIdentifiers().size()); // has 1 stp node entry check the bridge identifier and protocol assertEquals(CISCO_C870_BRIDGEID, linkNode.getBridgeIdentifier(1)); // has 50 stp entry che ifIndex must be different then -1 // assertEquals(1, linkNode.getStpInterfaces().get(1).size()); // no cdp inteface also if the walk return several interfaces assertEquals( "No cdp interface because no other node is there", 0, linkNode.getCdpInterfaces().size()); for (OnmsStpInterface stpiface : linkNode.getStpInterfaces().get(1)) { assertTrue("should have a valid ifindex", stpiface.getIfIndex().intValue() > 0); assertTrue("should have a valid bridgeport", stpiface.getBridgePort().intValue() > 0); } // This make shure that the ip/mac association is saved /* * nodelabel:ip:mac:ifindex:ifdescr * * CISCO_C870:172.20.1.1:001f6cd034e7:12:Vlan1 * CISCO_C870:172.20.2.1:001f6cd034e7:13:Vlan2 * CISCO_C870:10.255.255.2:001f6cd034e7:12:Vlan1 * CISCO_C870:65.41.39.146:00000c03b09e:14:BVI1 */ final Set<String> macAddresses = m_linkd.getMacAddressesOnPackage(packageName); assertEquals(2, macAddresses.size()); List<AtInterface> ats = m_linkd.getAtInterfaces(packageName, "001f6cd034e7"); assertNotNull(ats); assertEquals(3, ats.size()); for (final AtInterface at : ats) { if (at.getIpAddress().getHostAddress().equals("172.20.1.1")) assertEquals(12, at.getIfIndex().intValue()); else if (at.getIpAddress().getHostAddress().equals("172.20.2.1")) assertEquals(13, at.getIfIndex().intValue()); else if (at.getIpAddress().getHostAddress().equals("10.255.255.2")) assertEquals(12, at.getIfIndex().intValue()); else assertTrue( "ip: " + at.getIpAddress().getHostAddress() + "does not match any known ip address", false); } ats = m_linkd.getAtInterfaces(packageName, "00000c03b09e"); assertEquals(1, ats.size()); for (AtInterface at : ats) { if (at.getIpAddress().getHostAddress().equals("65.41.39.146")) assertEquals(14, at.getIfIndex().intValue()); else assertTrue( "ip: " + at.getIpAddress().getHostAddress() + "does not match any known ip address", false); } // Now Let's test the database // 0 atinterface in database assertEquals(4, m_atInterfaceDao.countAll()); final Criteria criteria = new Criteria(OnmsIpRouteInterface.class); criteria.setAliases(Arrays.asList(new Alias[] {new Alias("node", "node", JoinType.LEFT_JOIN)})); criteria.addRestriction(new EqRestriction("node.id", ciscorouter.getId())); final List<OnmsIpRouteInterface> iproutes = m_ipRouteInterfaceDao.findMatching(criteria); // 7 route entry in database for (OnmsIpRouteInterface iproute : iproutes) { System.out.println( iproute.getRouteDest() + "/" + iproute.getRouteMask() + "/" + iproute.getRouteNextHop() + "/" + iproute.getRouteIfIndex()); } assertEquals(7, iproutes.size()); // 0 entry in vlan assertEquals(0, m_vlanDao.findAll().size()); // 1 entry in stpnode assertEquals(1, m_stpNodeDao.countAll()); OnmsStpNode stpnode = m_stpNodeDao.findByNodeAndVlan(ciscorouter.getId(), 1); assertTrue(CISCO_C870_BRIDGEID.equals(stpnode.getBaseBridgeAddress())); assertEquals(1, stpnode.getBaseNumPorts().intValue()); assertEquals(BridgeBaseType.SRT, stpnode.getBaseType()); assertEquals(StpProtocolSpecification.IEEE8021D, stpnode.getStpProtocolSpecification()); // 1 entry in stpinterface assertEquals(1, m_stpInterfaceDao.findAll().size()); }
@Test @JUnitSnmpAgents( value = { @JUnitSnmpAgent( host = CISCO_WS_C2948_IP, port = 161, resource = "classpath:linkd/nms7467/" + CISCO_WS_C2948_IP + "-walk.txt") }) public void testCiscoWsC2948Collection() throws Exception { m_nodeDao.save(builder.getCiscoWsC2948()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseLldpDiscovery(false); example1.setUseOspfDiscovery(false); example1.setUseIsisDiscovery(false); example1.setForceIpRouteDiscoveryOnEthernet(true); final OnmsNode ciscosw = m_nodeDao.findByForeignId("linkd", CISCO_WS_C2948_NAME); assertTrue(m_linkd.scheduleNodeCollection(ciscosw.getId())); assertTrue(m_linkd.runSingleSnmpCollection(ciscosw.getId())); // linkd has 1 linkable node assertEquals(1, m_linkd.getLinkableNodesOnPackage("example1").size()); LinkableNode linkNode = m_linkd.getLinkableNodesOnPackage("example1").iterator().next(); // linkabble node is not null assertTrue(linkNode != null); // has only one route with valid next hop must be valid but type is ethernet so skipped // but it is itself so 0 assertEquals(0, linkNode.getRouteInterfaces().size()); // has 5 assertEquals(2, m_ipRouteInterfaceDao.countAll()); assertEquals(5, m_vlanDao.countAll()); String packageName = m_linkdConfig.getFirstPackageMatch(InetAddressUtils.addr(CISCO_WS_C2948_IP)).getName(); assertEquals("example1", packageName); assertEquals(1, linkNode.getBridgeIdentifiers().size()); // has 1 stp node entry check the bridge identifier and protocol assertEquals(CISCO_WS_C2948_BRIDGEID, linkNode.getBridgeIdentifier(1)); // has 50 stp entry che ifIndex must be different then -1 // assertEquals(50, linkNode.getStpInterfaces().get(1).size()); // no cdp inteface also if the walk return several interfaces assertEquals( "No cdp interface because no other node is there", 0, linkNode.getCdpInterfaces().size()); for (OnmsStpInterface stpiface : linkNode.getStpInterfaces().get(1)) { assertTrue("should have a valid ifindex", stpiface.getIfIndex().intValue() > 0); assertTrue("should have a valid bridgeport", stpiface.getBridgePort().intValue() > 0); } // This make shure that the ip/mac association is saved /* * nodelabel:ip:mac:ifindex:ifdescr * * CISCO_WS_C2948_IP:172.20.1.7:0002baaacffe:3:me1 */ final List<AtInterface> atInterfaces = m_linkd.getAtInterfaces(packageName, "0002baaacffe"); assertNotNull(atInterfaces); assertEquals(1, atInterfaces.size()); AtInterface at = atInterfaces.get(0); assertEquals(CISCO_WS_C2948_IP, at.getIpAddress().getHostAddress()); assertEquals(3, at.getIfIndex().intValue()); // Now Let's test the database final Criteria criteria = new Criteria(OnmsIpRouteInterface.class); criteria.setAliases(Arrays.asList(new Alias[] {new Alias("node", "node", JoinType.LEFT_JOIN)})); criteria.addRestriction(new EqRestriction("node.id", ciscosw.getId())); // 2 route entry in database assertEquals(2, m_ipRouteInterfaceDao.findMatching(criteria).size()); // 0 atinterface in database assertEquals(0, m_atInterfaceDao.findAll().size()); // 5 entry in vlan assertEquals(5, m_vlanDao.findAll().size()); // 1 entry in stpnode assertEquals(1, m_stpNodeDao.countAll()); OnmsStpNode stpnode = m_stpNodeDao.findByNodeAndVlan(ciscosw.getId(), 1); assertTrue(CISCO_WS_C2948_BRIDGEID.equals(stpnode.getBaseBridgeAddress())); assertEquals(50, stpnode.getBaseNumPorts().intValue()); assertEquals(BridgeBaseType.TRANSPARENT_ONLY, stpnode.getBaseType()); assertEquals(StpProtocolSpecification.IEEE8021D, stpnode.getStpProtocolSpecification()); // 50 entry in stpinterface assertEquals(50, m_stpInterfaceDao.findAll().size()); }
/* * We want to test that the next hop router discovered * links can be discovered using the ospf neb table */ @Test @JUnitSnmpAgents( value = { @JUnitSnmpAgent(host = PENROSE_IP, port = 161, resource = PENROSE_SNMP_RESOURCE), @JUnitSnmpAgent(host = DELAWARE_IP, port = 161, resource = DELAWARE_SNMP_RESOURCE), @JUnitSnmpAgent(host = PHOENIX_IP, port = 161, resource = PHOENIX_SNMP_RESOURCE), @JUnitSnmpAgent(host = AUSTIN_IP, port = 161, resource = AUSTIN_SNMP_RESOURCE), @JUnitSnmpAgent(host = SANJOSE_IP, port = 161, resource = SANJOSE_SNMP_RESOURCE), @JUnitSnmpAgent(host = RIOVISTA_IP, port = 161, resource = RIOVISTA_SNMP_RESOURCE) }) public void testNetwork1055OspfLinks() throws Exception { m_nodeDao.save(builder.getPenrose()); m_nodeDao.save(builder.getDelaware()); m_nodeDao.save(builder.getPhoenix()); m_nodeDao.save(builder.getAustin()); m_nodeDao.save(builder.getSanjose()); m_nodeDao.save(builder.getRiovista()); m_nodeDao.flush(); Package example1 = m_linkdConfig.getPackage("example1"); example1.setUseBridgeDiscovery(false); example1.setUseLldpDiscovery(false); example1.setUseCdpDiscovery(false); example1.setUseIpRouteDiscovery(false); example1.setUseOspfDiscovery(true); example1.setUseIsisDiscovery(false); example1.setSaveRouteTable(false); example1.setSaveStpInterfaceTable(false); example1.setSaveStpNodeTable(false); m_linkdConfig.update(); final OnmsNode penrose = m_nodeDao.findByForeignId("linkd", PENROSE_NAME); final OnmsNode delaware = m_nodeDao.findByForeignId("linkd", DELAWARE_NAME); final OnmsNode phoenix = m_nodeDao.findByForeignId("linkd", PHOENIX_NAME); final OnmsNode austin = m_nodeDao.findByForeignId("linkd", AUSTIN_NAME); final OnmsNode sanjose = m_nodeDao.findByForeignId("linkd", SANJOSE_NAME); final OnmsNode riovista = m_nodeDao.findByForeignId("linkd", RIOVISTA_NAME); assertTrue(m_linkd.scheduleNodeCollection(penrose.getId())); assertTrue(m_linkd.scheduleNodeCollection(delaware.getId())); assertTrue(m_linkd.scheduleNodeCollection(phoenix.getId())); assertTrue(m_linkd.scheduleNodeCollection(austin.getId())); assertTrue(m_linkd.scheduleNodeCollection(sanjose.getId())); assertTrue(m_linkd.scheduleNodeCollection(riovista.getId())); assertTrue(m_linkd.runSingleSnmpCollection(penrose.getId())); assertTrue(m_linkd.runSingleSnmpCollection(delaware.getId())); assertTrue(m_linkd.runSingleSnmpCollection(phoenix.getId())); assertTrue(m_linkd.runSingleSnmpCollection(austin.getId())); assertTrue(m_linkd.runSingleSnmpCollection(sanjose.getId())); assertTrue(m_linkd.runSingleSnmpCollection(riovista.getId())); assertEquals(0, m_dataLinkInterfaceDao.countAll()); assertTrue(m_linkd.runSingleLinkDiscovery("example1")); assertEquals(5, m_dataLinkInterfaceDao.countAll()); final List<DataLinkInterface> links = m_dataLinkInterfaceDao.findAll(); final int start = getStartPoint(links); for (final DataLinkInterface datalinkinterface : links) { Integer linkid = datalinkinterface.getId(); if (linkid == start) { // penrose -> delaware --ip route next hop checkLink(delaware, penrose, 598, 535, datalinkinterface); } else if (linkid == start + 1) { // penrose -> phoenix --ip route next hop checkLink(phoenix, penrose, 564, 644, datalinkinterface); } else if (linkid == start + 2) { // phoenix -> austin --ip route next hop checkLink(austin, phoenix, 554, 565, datalinkinterface); } else if (linkid == start + 3) { // phoenix -> sanjose --ip route next hop checkLink(sanjose, phoenix, 564, 566, datalinkinterface); } else if (linkid == start + 4) { // austin -> sanjose --ip route next hop checkLink(sanjose, austin, 8562, 586, datalinkinterface); } else { // error checkLink(penrose, penrose, -1, -1, datalinkinterface); } } }