예제 #1
0
 def test_full_execution(self):
     obj = ApacheBenchmarkExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "concurrency": 2,
         "iterations": 3,
         "headers": {
             "Content-Type": "text/plain"
         },
         "scenario": {
             "keepalive": True,
             "requests": [
                 {
                     "url": "http://blazedemo.com",
                     "headers": [
                         {"X-Answer": "42"},
                     ],
                     "keepalive": False,
                     "method": "GET",
                 }
             ],
         }
     })
     obj.prepare()
     obj.get_widget()
     try:
         obj.startup()
         while not obj.check():
             time.sleep(obj.engine.check_interval)
     finally:
         obj.shutdown()
     obj.post_process()
     self.assertNotEquals(obj.process, None)
예제 #2
0
 def test_iter(self):
     "Ensures that executor doesn't fail with minimal configuration."
     obj = ApacheBenchmarkExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),
     })
     obj.execution.merge(
         {"scenario": {
             "requests": ["http://blazedemo.com"]
         }})
     obj.prepare()
     obj.get_widget()
     try:
         obj.startup()
         while not obj.check():
             time.sleep(obj.engine.check_interval)
     finally:
         obj.shutdown()
     obj.post_process()
     self.assertNotEquals(obj.process, None)
예제 #3
0
 def test_iter(self):
     "Ensures that executor doesn't fail with minimal configuration."
     obj = ApacheBenchmarkExecutor()
     obj.engine = EngineEmul()
     obj.settings.merge({
         "path": get_res_path(TOOL_NAME),})
     obj.execution.merge({
         "scenario": {
             "requests": ["http://blazedemo.com"]
         }
     })
     obj.prepare()
     obj.get_widget()
     try:
         obj.startup()
         while not obj.check():
             time.sleep(obj.engine.check_interval)
     finally:
         obj.shutdown()
     obj.post_process()
     self.assertNotEquals(obj.process, None)