예제 #1
0
    def test_reader(self):
        self.foo.phantom_start_time = time.time()
        reader = PhantomReader(AggregatorPlugin(self.foo.core), self.foo)
        reader.phout_file = 'data/phout_timeout_mix.txt'
        reader.check_open_files()

        data = reader.get_next_sample(False)
        while data:
            times_sum = 0
            for timing in data.overall.times_dist:
                times_sum += timing['count']
            # FIXME: kinda strange problem here
            #self.assertEquals(sum(data.overall.net_codes.values()), times_sum)
            data = reader.get_next_sample(False)
예제 #2
0
    def test_reader(self):
        self.phantom_plugin_instance.phantom_start_time = time.time()
        reader = PhantomReader(AggregatorPlugin(self.phantom_plugin_instance.core), self.phantom_plugin_instance)
        reader.phout_file = 'data/phout_timeout_mix.txt'
        reader.check_open_files()

        data = reader.get_next_sample(False)
        while data:
            times_sum = 0
            for timing in data.overall.times_dist:
                times_sum += timing['count']
            # FIXME: kinda strange problem here
            #self.assertEquals(sum(data.overall.net_codes.values()), times_sum)
            data = reader.get_next_sample(False)
예제 #3
0
    def test_run(self):
        self.phantom_plugin_instance.core.set_option(PhantomPlugin.SECTION, "config", '')
        self.phantom_plugin_instance.configure()
        self.phantom_plugin_instance.prepare_test()
        reader = PhantomReader(AggregatorPlugin(self.phantom_plugin_instance.core), self.phantom_plugin_instance)
        reader.phout_file = self.phantom_plugin_instance.phantom.phout_file
        self.phantom_plugin_instance.start_test()

        while self.phantom_plugin_instance.is_test_finished() < 0:
            self.phantom_plugin_instance.log.debug("Not finished")
            reader.check_open_files()
            reader.get_next_sample(False)
            time.sleep(1)
        if self.phantom_plugin_instance.is_test_finished() != 0:
            raise RuntimeError("RC: %s" % self.phantom_plugin_instance.is_test_finished())
        self.phantom_plugin_instance.end_test(0)
        reader.get_next_sample(True)
예제 #4
0
    def test_run(self):
        self.foo.core.set_option(PhantomPlugin.SECTION, "config", '')
        self.foo.configure()
        self.foo.prepare_test()
        reader = PhantomReader(AggregatorPlugin(self.foo.core), self.foo)
        reader.phout_file = self.foo.phantom.phout_file
        self.foo.start_test()

        while self.foo.is_test_finished() < 0:
            self.foo.log.debug("Not finished")
            reader.check_open_files()
            reader.get_next_sample(False)
            time.sleep(1)
        if self.foo.is_test_finished() != 0:
            raise RuntimeError("RC: %s" % self.foo.is_test_finished())
        self.foo.end_test(0)
        reader.get_next_sample(True)