예제 #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)
예제 #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()
예제 #3
0
 def test_multiload_parsing(self):
     core = self.get_core()
     foo = StepperWrapper(core, PhantomPlugin.SECTION)
     foo.core.set_option('phantom', 'rps_schedule',
                         'const(1,1) line(1,100,60)\nstep(1,10,1,10)')
     foo.read_config()
     self.assertEquals(['const(1,1)', 'line(1,100,60)', 'step(1,10,1,10)'],
                       foo.rps_schedule)
예제 #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)
예제 #5
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()
예제 #6
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)
예제 #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)
예제 #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)
예제 #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)
예제 #10
0
 def test_multiload_parsing(self):
     core = self.get_core()
     foo = StepperWrapper(core, PhantomPlugin.SECTION)
     foo.core.set_option('phantom', 'rps_schedule', 'const(1,1) line(1,100,60)\nstep(1,10,1,10)')
     foo.read_config()
     self.assertEquals(['const(1,1)', 'line(1,100,60)', 'step(1,10,1,10)'], foo.rps_schedule)