Exemplo n.º 1
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)
Exemplo n.º 2
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()
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
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()
Exemplo n.º 7
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)
Exemplo n.º 8
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)