Exemple #1
0
 def test_hold(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),
     })
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {
             "headers": {
                 'h1': 'value1',
                 'h2': 'value2'
             },
             "variables": {
                 'v1': 1,
                 'v2': 'TWO'
             },
             "script": get_res_path('url-file')
         }
     })
     obj.prepare()
     obj.prepare()
     self.assertNotEqual(len(obj.resource_files()), 0)
     obj.get_widget()
     obj.startup()
Exemple #2
0
 def test_url_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}})
     self.assertRaises(TaurusConfigError, obj.prepare)
Exemple #3
0
 def test_check_install_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": '*',})
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}})
     self.assertRaises(RuntimeError, obj.prepare)
Exemple #4
0
 def test_check_install_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": '*',})
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}})
     self.assertRaises(ToolError, obj.prepare)
Exemple #5
0
 def test_url_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}})
     self.assertRaises(ValueError, obj.prepare)
Exemple #6
0
 def test_repetition_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "scenario": {
             "requests": ["http://blazedemo.com",
                          "http://ya.ru"]}})
     obj.prepare()
     self.assertEqual(len(obj.resource_files()), 0)
     self.assertRaises(TaurusConfigError, obj.startup)
Exemple #7
0
 def test_repetition_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "scenario": {
             "requests": ["http://blazedemo.com",
                          "http://ya.ru"]}})
     obj.prepare()
     self.assertEqual(len(obj.resource_files()), 0)
     self.assertRaises(ValueError, obj.startup)
Exemple #8
0
 def test_check_install_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": '*',})
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}})
     try:
         obj.prepare()
     except RuntimeError:
         return
     self.fail()
Exemple #9
0
 def test_url_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}})
     try:
         obj.prepare()
     except ValueError:
         return
     self.fail()
Exemple #10
0
 def test_repetition_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "scenario": {
             "requests": ["http://blazedemo.com",
                          "http://ya.ru"]}})
     obj.prepare()
     try:
         obj.startup()
     except ValueError:
         return
     self.fail()
Exemple #11
0
 def test_iter(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "iterations": 3,
         "scenario": {
             "think-time": "1s",
             "requests": ["http://blazedemo.com",
                          "http://ya.ru"]}
     })
     obj.prepare()
     obj.get_widget()
     obj.startup()
Exemple #12
0
 def test_iter(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "iterations": 3,
         "scenario": {
             "think-time": "1s",
             "requests": ["http://blazedemo.com",
                          "http://ya.ru"]}
     })
     obj.prepare()
     obj.get_widget()
     obj.startup()
Exemple #13
0
 def test_check_install_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": '*',
     })
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}
     })
     try:
         obj.prepare()
     except RuntimeError:
         return
     self.fail()
Exemple #14
0
 def test_url_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),
     })
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {}
     })
     try:
         obj.prepare()
     except ValueError:
         return
     self.fail()
Exemple #15
0
 def test_repetition_exceptions(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),
     })
     obj.execution.merge({
         "concurrency": 2,
         "scenario": {
             "requests": ["http://blazedemo.com", "http://ya.ru"]
         }
     })
     obj.prepare()
     try:
         obj.startup()
     except ValueError:
         return
     self.fail()
Exemple #16
0
 def test_hold(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "hold-for": '2s',
         "scenario": {
             "headers": {
                 'h1': 'value1',
                 'h2': 'value2'},
             "variables": {
                 'v1': 1,
                 'v2': 'TWO'},
             "script": get_res_path('url-file')}})
     obj.prepare()
     obj.get_widget()
     obj.startup()
Exemple #17
0
 def test_diagnostics(self):
     obj = SiegeExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),
     })
     obj.execution.merge({
         "iterations": 1,
         "scenario": {
             "requests": ["http://blazedemo.com"]
         }
     })
     obj.prepare()
     try:
         obj.startup()
         while not obj.check():
             time.sleep(obj.engine.check_interval)
     finally:
         obj.shutdown()
     obj.post_process()
     self.assertIsNotNone(obj.get_error_diagnostics())
Exemple #18
0
    def test_full_execution(self):
        obj = SiegeExecutor()
        obj.engine = EngineEmul()
        obj.settings.merge({
            "path": get_res_path(TOOL_NAME),})
        obj.execution.merge({
            "concurrency": 2,
            "iterations": 3,
            "scenario": {
                "requests": ["http://blazedemo.com",
                             "http://ya.ru"]}
        })
        obj.prepare()
        obj.startup()
        try:
            while not obj.check():
                time.sleep(obj.engine.check_interval)
        finally:
            obj.shutdown()

        obj.post_process()
        self.assertNotEquals(obj.process, None)
Exemple #19
0
    def test_full_execution(self):
        obj = SiegeExecutor()
        obj.engine = EngineEmul()
        obj.settings.merge({
            "path": get_res_path(TOOL_NAME),})
        obj.execution.merge({
            "concurrency": 2,
            "iterations": 3,
            "scenario": {
                "requests": ["http://blazedemo.com",
                             "http://ya.ru"]}
        })
        obj.prepare()
        try:
            obj.startup()
            while not obj.check():
                time.sleep(obj.engine.check_interval)
        finally:
            obj.shutdown()

        obj.post_process()
        self.assertNotEquals(obj.process, None)