Ejemplo n.º 1
0
 def testDelNoteFromInterfaceSYNC(self):
     interface = Interface('coco')
     note = ModelObjectNote("int_mock0")
     interface.addChild(note)
     self.genericDelTest(
         interface, note,
         controller.ModelController.delNoteFromInterfaceSYNC)
Ejemplo n.º 2
0
 def testInterfaceFromHostRemovedSYNC(self):
     service = Service('coco')
     interface = Interface("int_mock0")
     interface.addChild(service)
     self.genericDelTest(
         interface, service,
         controller.ModelController.delServiceFromInterfaceSYNC)
Ejemplo n.º 3
0
    def testAddServiceToInterface(self):
        interface = Interface('coco')
        serv = Service('cuca')
        interface.addChild(serv)

        self.assertIn(serv, interface.childs.values(), 'Service not in childs')
        self.assertIn(serv, interface.getAllServices(), 'Service not accessible')
Ejemplo n.º 4
0
    def testAddServiceToInterface(self):
        interface = Interface('coco')
        serv = Service('cuca')
        interface.addChild(serv)

        self.assertIn(serv, interface.childs.values(), 'Service not in childs')
        self.assertIn(serv, interface.getAllServices(),
                      'Service not accessible')
Ejemplo n.º 5
0
    def testInterfaceWithMultipleChildTypes(self):
        inter = Interface('coco')
        serv = Service('cuca')
        vuln = ModelObjectVuln('vuln')
        inter.addChild(serv) 
        inter.addChild(vuln)

        self.assertEquals(len(inter.getVulns()), 1, "Vulns added is not 1")
        self.assertIn(vuln, inter.getVulns(), "Vuln not accessible")
        self.assertEquals(len(inter.getAllServices()), 1, "Services added is not 1") 
Ejemplo n.º 6
0
    def testInterfaceWithMultipleChildTypes(self):
        inter = Interface('coco')
        serv = Service('cuca')
        vuln = ModelObjectVuln('vuln')
        inter.addChild(serv)
        inter.addChild(vuln)

        self.assertEquals(len(inter.getVulns()), 1, "Vulns added is not 1")
        self.assertIn(vuln, inter.getVulns(), "Vuln not accessible")
        self.assertEquals(len(inter.getAllServices()), 1,
                          "Services added is not 1")
Ejemplo n.º 7
0
 def testDelNoteFromInterfaceASYNC(self):
     interface = Interface('coco')
     note = ModelObjectNote("int_mock0") 
     interface.addChild(note.getID(), note)
     self.genericDelTest(interface, note, 
             controller.ModelController.delNoteFromInterfaceASYNC, process_pending=True)
Ejemplo n.º 8
0
 def testInterfaceFromHostRemovedASYNC(self):
     service = Service('coco')
     interface = Interface("int_mock0") 
     interface.addChild(service.getID(), service)
     self.genericDelTest(interface, service,
             controller.ModelController.delServiceFromInterfaceASYNC, process_pending=True)
 def testDelNoteFromInterfaceSYNC(self):
     interface = Interface('coco')
     note = ModelObjectNote("int_mock0") 
     interface.addChild(note)
     self.genericDelTest(interface, note, 
             controller.ModelController.delNoteFromInterfaceSYNC)
 def testInterfaceFromHostRemovedSYNC(self):
     service = Service('coco')
     interface = Interface("int_mock0") 
     interface.addChild(service)
     self.genericDelTest(interface, service,
             controller.ModelController.delServiceFromInterfaceSYNC)