Esempio n. 1
0
 def test_stepper_no_steps(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule', '')
     self.phantom_plugin_instance.core.set_option('phantom', 'instances_schedule', '')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
     wrapper.ammo_file = 'data/dummy.ammo'
     wrapper.prepare_stepper()
     wrapper.prepare_stepper()
Esempio n. 2
0
 def test_cached_stpd_info(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'stpd_file', 'data/dummy.ammo.stpd')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(10, wrapper.instances)
     self.assertEqual(60, wrapper.duration)
Esempio n. 3
0
 def test_stepper_no_steps(self):
     self.foo.core.set_option('phantom', 'rps_schedule', '')
     self.foo.core.set_option('phantom', 'instances_schedule', '')
     wrapper = StepperWrapper(self.foo.core, PhantomPlugin.SECTION)
     wrapper.ammo_file = 'data/dummy.ammo'
     wrapper.prepare_stepper()
     wrapper.prepare_stepper()
Esempio n. 4
0
    def test_cached_stepper_instances_sched(self):
        # Making cache file
        self.phantom_plugin_instance.core.set_option('phantom', 'instances',
                                                     '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule',
                                                     '')
        self.phantom_plugin_instance.core.set_option('phantom',
                                                     'instances_schedule',
                                                     'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file',
                                                     'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                                 PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.tearDown()

        self.setUp()
        self.phantom_plugin_instance.core.set_option('phantom', 'instances',
                                                     '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule',
                                                     '')
        self.phantom_plugin_instance.core.set_option('phantom',
                                                     'instances_schedule',
                                                     'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file',
                                                     'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                                 PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.assertEqual(100, wrapper.instances)
Esempio n. 5
0
 def test_stepper_instances_sched(self):
     self.foo.core.set_option('phantom', 'instances', '1000')
     self.foo.core.set_option('phantom', 'rps_schedule', '')
     self.foo.core.set_option('phantom', 'instances_schedule', 'line(1,100,1m)')
     wrapper = StepperWrapper(self.foo.core, PhantomPlugin.SECTION)
     wrapper.ammo_file = 'data/dummy.ammo'
     wrapper.prepare_stepper()
     self.assertEqual(100, wrapper.instances)
Esempio n. 6
0
 def test_stepper_instances_override(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'instances', '20000')
     self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule', 'line(1,100,1m)')
     self.phantom_plugin_instance.core.set_option('phantom', 'use_caching', '0')
     self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file', 'data/dummy.ammo')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(20000, wrapper.instances)
Esempio n. 7
0
 def test_cached_stpd_info(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'stpd_file',
                                                  'data/dummy.ammo.stpd')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                              PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(10, wrapper.instances)
     self.assertEqual(60, wrapper.duration)
Esempio n. 8
0
 def test_stepper_instances_override(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'instances',
                                                  '20000')
     self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule',
                                                  'line(1,100,1m)')
     self.phantom_plugin_instance.core.set_option('phantom', 'use_caching',
                                                  '0')
     self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file',
                                                  'data/dummy.ammo')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                              PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(20000, wrapper.instances)
Esempio n. 9
0
    def test_cached_stepper_instances_sched(self):
        # Making cache file
        self.phantom_plugin_instance.core.set_option('phantom', 'instances', '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule', '')
        self.phantom_plugin_instance.core.set_option('phantom', 'instances_schedule', 'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file', 'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.tearDown()

        self.setUp()
        self.phantom_plugin_instance.core.set_option('phantom', 'instances', '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule', '')
        self.phantom_plugin_instance.core.set_option('phantom', 'instances_schedule', 'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file', 'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.assertEqual(100, wrapper.instances)