Exemplo n.º 1
0
 def setUp(self):
     self.__scenarios_dir = '/tmp/scenarios'
     if os.path.exists(self.__scenarios_dir):
         shutil.rmtree(self.__scenarios_dir)
     os.makedirs(self.__scenarios_dir)
     test_helper.setupScenario(
         test_helper.SCENARIO1,
         self.__scenarios_dir + '/' + test_helper.SCENARIO1,
         test_helper.SENARIO_SPEC_1)
     test_helper.setupScenario(
         test_helper.SCENARIO2,
         self.__scenarios_dir + '/' + test_helper.SCENARIO2,
         test_helper.SENARIO_SPEC_1)
     self.scenarios = Scenarios(scenario_directory=self.__scenarios_dir)
Exemplo n.º 2
0
def start():
    global s, server, output, bind_point, _scenario, _eps, _eps_wave, port
    s = Scenarios(ROOTDIR + '/scenarios/', eps=_eps, eps_wave=_eps_wave, output=output, port=port)
    if output == "syslog":
        s.setProcessor(processor_syslog)
    elif output == "zeromq":
        zeromq.init_sockets(bind_point)
        s.setProcessor(zeromq.send)
    elif output == "es":
        s.setProcessor(processor_es)
    else:
        s.setProcessor(processor_stdout)

    s.start(_scenario)

    while 1:
        time.sleep(1)