示例#1
0
 def setUpClass(cls):
     # pylint: disable=unsubscriptable-object
     cls.init_failed = False
     os.environ['JAVA_MIN_MEM'] = '1024M'
     os.environ['JAVA_MAX_MEM'] = '4096M'
     cls.processes = test_utils.start_tpce()
     # TAPI feature is not installed by default in Karaf
     if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
         print("installing tapi feature...")
         result = test_utils.install_karaf_feature("odl-transportpce-tapi")
         if result.returncode != 0:
             cls.init_failed = True
         print("Restarting OpenDaylight...")
         test_utils.shutdown_process(cls.processes[0])
         cls.processes[0] = test_utils.start_karaf()
         test_utils.process_list[0] = cls.processes[0]
         cls.init_failed = not test_utils.wait_until_log_contains(
             test_utils.KARAF_LOG,
             test_utils.KARAF_OK_START_MSG,
             time_to_wait=60)
     if cls.init_failed:
         print("tapi installation feature failed...")
         test_utils.shutdown_process(cls.processes[0])
         sys.exit(2)
     cls.processes = test_utils.start_sims([('spdra', cls.NODE_VERSION),
                                            ('roadma', cls.NODE_VERSION),
                                            ('roadmc', cls.NODE_VERSION),
                                            ('spdrc', cls.NODE_VERSION)])
 def setUpClass(cls):
     # pylint: disable=unsubscriptable-object
     # TODO: for lighty manage the activation of NBI notification feature
     cls.init_failed = False
     cls.processes = test_utils.start_tpce()
     # NBI notification feature is not installed by default in Karaf
     if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
         print("installing NBI notification feature...")
         result = test_utils.install_karaf_feature(
             "odl-transportpce-nbinotifications")
         if result.returncode != 0:
             cls.init_failed = True
         print("Restarting OpenDaylight...")
         test_utils.shutdown_process(cls.processes[0])
         cls.processes[0] = test_utils.start_karaf()
         test_utils.process_list[0] = cls.processes[0]
         cls.init_failed = not test_utils.wait_until_log_contains(
             test_utils.KARAF_LOG,
             test_utils.KARAF_OK_START_MSG,
             time_to_wait=60)
     if cls.init_failed:
         print("NBI notification installation feature failed...")
         test_utils.shutdown_process(cls.processes[0])
         sys.exit(2)
     cls.processes = test_utils.start_sims([('xpdra', cls.NODE_VERSION),
                                            ('roadma', cls.NODE_VERSION),
                                            ('roadmc', cls.NODE_VERSION),
                                            ('xpdrc', cls.NODE_VERSION)])
示例#3
0
    def setUpClass(cls):
        cls.init_failed = False

        print("starting opendaylight...")
        cls.odl_process = test_utils.start_tpce()
        if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
            karaf_log = os.path.join(
                os.path.dirname(os.path.realpath(__file__)), "..", "..", "..",
                "karaf", "target", "assembly", "data", "log", "karaf.log")
            searched_expr = re.escape("Blueprint container for bundle "
                                      "org.opendaylight.netconf.restconf"
                                      ) + ".* was successfully created"
            found = test_utils.wait_until_log_contains(karaf_log,
                                                       searched_expr,
                                                       time_to_wait=60)
            cls.init_failed = not found
            if not cls.init_failed:
                print("opendaylight started")
                print("installing tapi feature...")
                result = test_utils.install_karaf_feature(
                    "odl-transportpce-tapi")
                if result.returncode != 0:
                    cls.init_failed = True
                print("Restarting opendaylight...")
                test_utils.shutdown_process(cls.odl_process)
                cls.odl_process = test_utils.start_tpce()
                found = test_utils.wait_until_log_contains(karaf_log,
                                                           searched_expr,
                                                           time_to_wait=60)
                cls.init_failed = not found
        if not cls.init_failed:
            print("starting XPDRA...")
            cls.honeynode_process1 = test_utils.start_xpdra_honeynode()

            print("starting ROADMA...")
            cls.honeynode_process2 = test_utils.start_roadma_honeynode()

            print("starting ROADMC...")
            cls.honeynode_process3 = test_utils.start_roadmc_honeynode()

            print("starting XPDRC...")
            cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()

            print("starting SPDRA...")
            cls.honeynode_process5 = test_utils.start_spdra_honeynode()
            print("all honeynodes started")
 def tearDownClass(cls):
     # pylint: disable=not-an-iterable
     for process in cls.processes:
         test_utils.shutdown_process(process)
     print("all processes killed")
示例#5
0
 def tearDownClass(cls):
     for process in cls.processes:
         test_utils.shutdown_process(process)
     print("all processes killed")
示例#6
0
 def tearDownClass(cls):
     test_utils.shutdown_process(cls.odl_process)
     test_utils.shutdown_process(cls.honeynode_process1)
     test_utils.shutdown_process(cls.honeynode_process2)
     test_utils.shutdown_process(cls.honeynode_process3)
     test_utils.shutdown_process(cls.honeynode_process4)
     test_utils.shutdown_process(cls.honeynode_process5)
     print("all processes killed")