コード例 #1
0
    def test_disabled(self):
        obj = ConsoleStatusReporter()
        obj.engine = EngineEmul()
        obj.engine.provisioning = Local()
        obj.engine.config[Provisioning.PROV] = ''
        jmeter = self.get_jmeter()
        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()
コード例 #2
0
    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()
コード例 #3
0
 def test_disabled_0(self):
     obj = ConsoleStatusReporter()
     obj.engine = EngineEmul()
     obj.engine.provisioning = Local()
     obj.engine.config[Provisioning.PROV] = ''
     obj.settings["disable"] = 0
     obj.prepare()
     self.assertEquals(False, obj.disabled)
コード例 #4
0
 def test_disabled_0(self):
     obj = ConsoleStatusReporter()
     obj.engine = EngineEmul()
     obj.engine.provisioning = Local()
     obj.engine.config[Provisioning.PROV] = ''
     obj.settings["disable"] = 0
     obj.prepare()
     self.assertEquals(False, obj.disabled)
コード例 #5
0
    def test_1(self):
        obj = ConsoleStatusReporter()
        handler = RecordingHandler()
        obj.log.addHandler(handler)
        obj.engine = EngineEmul()
        obj.engine.provisioning = Local()
        obj.engine.provisioning.start_time = time.time()
        obj.engine.config[Provisioning.PROV] = ''
        jmeter = self.get_jmeter()
        jmeter.engine = obj.engine
        jmeter.execution[ScenarioExecutor.HOLD_FOR] = 10
        jmeter.execution.merge({'hold-for': 0, 'ramp-up': 0})
        jmeter.delay = 10
        jmeter.prepare()
        widget = jmeter.get_widget()
        widget.update()
        jmeter.startup()
        widget.update()
        obj.engine.provisioning.executors = [jmeter]
        obj.settings["disable"] = False
        obj.settings['dummy_cols'] = 160
        obj.settings['dummy_rows'] = 40
        obj.settings['disable'] = False
        obj.prepare()
        obj.startup()

        obj.check()
        obj.temp_stream.write("test1\n")
        obj.temp_stream.flush()
        obj.temp_stream.write("test1\n")
        obj.temp_stream.flush()
        obj.check()

        for n in range(0, 10):
            point = self.__get_datapoint(n)
            obj.aggregated_second(point)
            obj.temp_stream.write("test %s\n" % n)
            obj.temp_stream.flush()
            obj.check()
            self.assertTrue(obj.screen.started)

        point = self.__get_datapoint(11)
        point[DataPoint.CURRENT][''][KPISet.RESP_CODES][''] = 1
        obj.aggregated_second(point)

        obj.check()
        obj.shutdown()
        obj.post_process()
        obj.log.removeHandler(handler)
        self.assertNotIn('Failed', handler.warn_buff.getvalue())
コード例 #6
0
    def test_1(self):
        obj = ConsoleStatusReporter()
        self.sniff_log(obj.log)
        obj.engine = EngineEmul()
        obj.engine.provisioning = Local()
        obj.engine.provisioning.start_time = time.time()
        obj.engine.config[Provisioning.PROV] = ''
        jmeter = self.get_jmeter()
        jmeter.engine = obj.engine
        jmeter.execution[ScenarioExecutor.HOLD_FOR] = 10
        jmeter.execution.merge({'hold-for': 0, 'ramp-up': 0})
        jmeter.delay = 10
        jmeter.prepare()
        widget = jmeter.get_widget()
        widget.update()
        jmeter.startup()
        widget.update()
        obj.engine.provisioning.executors = [jmeter]
        obj.settings["disable"] = False
        obj.settings['dummy_cols'] = 160
        obj.settings['dummy_rows'] = 40
        obj.settings['disable'] = False
        obj.prepare()
        obj.startup()

        obj.check()
        obj.temp_stream.write("test1\n")
        obj.temp_stream.flush()
        obj.temp_stream.write("test1\n")
        obj.temp_stream.flush()
        obj.check()

        for n in range(0, 10):
            point = self.__get_datapoint(n)
            obj.aggregated_second(point)
            obj.temp_stream.write("test %s\n" % n)
            obj.temp_stream.flush()
            obj.check()
            self.assertTrue(obj.screen.started)

        point = self.__get_datapoint(11)
        point[DataPoint.CURRENT][''][KPISet.RESP_CODES][''] = 1
        obj.aggregated_second(point)

        obj.check()
        obj.shutdown()
        obj.post_process()
        self.assertNotIn('Failed', self.log_recorder.warn_buff.getvalue())
コード例 #7
0
    def test_1(self):
        obj = ConsoleStatusReporter()
        obj.engine = EngineEmul()
        obj.engine.provisioning = Local()
        obj.engine.provisioning.start_time = time.time()
        obj.engine.config[Provisioning.PROV] = ''
        jmeter = self.get_jmeter()
        jmeter.engine = obj.engine
        jmeter.execution[ScenarioExecutor.HOLD_FOR] = 10
        jmeter.execution.merge({'hold-for': 0, 'ramp-up': 0})
        jmeter.delay = 10
        jmeter.prepare()
        widget = jmeter.get_widget()
        widget.update()
        jmeter.startup()
        widget.update()
        obj.engine.provisioning.executors = [jmeter]
        obj.settings["disable"] = False
        obj.settings['dummy_cols'] = 160
        obj.settings['dummy_rows'] = 40
        obj.settings['disable'] = False
        obj.prepare()
        obj.startup()

        obj.check()
        obj.temp_stream.write("test1\n")
        obj.temp_stream.flush()
        obj.temp_stream.write("test1\n")
        obj.temp_stream.flush()
        obj.check()

        for n in range(0, 10):
            point = self.__get_datapoint(n)
            obj.aggregated_second(point)
            obj.temp_stream.write("test %s\n" % n)
            obj.temp_stream.flush()
            obj.check()
            self.assertTrue(obj.screen.started)

        obj.check()
        obj.shutdown()
        obj.post_process()