def test_2(self):
        obj = ConsoleStatusReporter()
        obj.engine = EngineEmul()
        obj.engine.provisioning = Local()
        obj.engine.config[Provisioning.PROV] = ''
        jmeter = JMeterExecutor()
        jmeter.engine = obj.engine
        jmeter.start_time = time.time()
        jmeter.execution[ScenarioExecutor.HOLD_FOR] = 10
        obj.engine.provisioning.executors = [jmeter]
        obj.settings["disable"] = False
        obj.settings['dummy_cols'] = 160
        obj.settings['dummy_rows'] = 40
        obj.prepare()
        obj.startup()

        for n in range(0, 10):
            point = self.__get_datapoint(0)
            obj.aggregated_second(point)
            obj.check()
            self.assertTrue(obj.screen.started)

        obj.check()
        obj.shutdown()
        obj.post_process()
    def test_disabled(self):
        obj = ConsoleStatusReporter()
        obj.engine = EngineEmul()
        obj.engine.provisioning = Local()
        obj.engine.config[Provisioning.PROV] = ''
        jmeter = JMeterExecutor()
        jmeter.engine = obj.engine
        jmeter.start_time = time.time()
        jmeter.execution[ScenarioExecutor.HOLD_FOR] = 10
        obj.engine.provisioning.executors = [jmeter]
        obj.settings["disable"] = True
        obj.settings['dummy_cols'] = 160
        obj.settings['dummy_rows'] = 40
        obj.prepare()
        obj.startup()

        for n in range(0, 10):
            point = self.__get_datapoint(0)
            obj.aggregated_second(point)
            obj.check()
            self.assertFalse(obj.screen.started)

        obj.check()
        obj.shutdown()
        obj.post_process()
Exemple #3
0
    def test_log_messages_duration(self):
        """
        Test duration report
        :return:
        """
        executor_obj = JMeterExecutor()
        executor_obj.engine = EngineEmul()
        executor_obj.engine.provisioning = Provisioning()
        executor_obj.engine.provisioning.executors.append(executor_obj)
        executor_obj.start_time = time.time()
        executor_obj.end_time = executor_obj.start_time + 120005

        obj = FinalStatus()
        obj.parameters = BetterDict()
        obj.engine = executor_obj.engine
        obj.log = logger_mock()
        obj.post_process()
        self.assertEqual("Test duration: 1 day, 9:20:05\n", obj.log.info_buf.getvalue())