def setUp(self): self.tmp_dir = tempfile.mkdtemp() self.host = '127.0.0.1' databus = conpot_core.get_databus() databus.initialize('conpot/templates/default.xml') self.snmp_server = SNMPServer(self.host, 0, 'conpot/templates/default.xml', [self.tmp_dir], [self.tmp_dir]) self.port = self.snmp_server.get_port() self.server_greenlet = gevent.spawn(self.snmp_server.start)
def setUp(self): self.tmp_dir = tempfile.mkdtemp() self.host = '127.0.0.1' databus = conpot_core.get_databus() databus.initialize('conpot/templates/default/template.xml') args = namedtuple('FakeArgs', 'mibpaths raw_mib') args.mibpaths = [self.tmp_dir] args.raw_mib = [self.tmp_dir] self.snmp_server = SNMPServer('conpot/templates/default/snmp/snmp.xml', 'none', args) self.server_greenlet = gevent.spawn(self.snmp_server.start, self.host, 0) gevent.sleep(1) self.port = self.snmp_server.get_port()
def setUp(self): self.tmp_dir = tempfile.mkdtemp() self.host = "127.0.0.1" databus = conpot_core.get_databus() # get the current directory self.dir_name = os.path.dirname(conpot.__file__) databus.initialize(self.dir_name + "/templates/default/template.xml") args = namedtuple("FakeArgs", "mibcache") args.mibcache = self.tmp_dir self.snmp_server = SNMPServer( self.dir_name + "/templates/default/snmp/snmp.xml", "none", args ) self.server_greenlet = gevent.spawn(self.snmp_server.start, self.host, 0) gevent.sleep(1) self.port = self.snmp_server.get_port()