def test_widget_cloud_collection(self): obj = CloudProvisioning() obj.client = BlazeMeterClientEmul(logging.getLogger('')) obj.test = CloudCollectionTest(obj.client, None, None, None, None, logging.getLogger('')) obj.client.results.append({ "result": { "sessions": [{ "id": "session-id", "locationId": "loc-name", "readyStatus": { "servers": ["server" for _ in range(10)] }, }] } }) obj.client.results.append({ "result": { "sessions": [{ "id": "session-id", "name": "loc-name/scenario", "configuration": {} }] } }) obj.test.get_master_status() widget = obj.get_widget() widget.update() self.assertEqual("None #None\n scenario:\n Agents in loc-name: 10\n", widget.text.get_text()[0])
def test_widget_cloud_collection(self): obj = CloudProvisioning() obj.client = BlazeMeterClientEmul(logging.getLogger('')) obj.test = CloudCollectionTest({}, {}, obj.client, None, None, None, logging.getLogger('')) obj.client.results.append({"result": {"sessions": [ { "id": "session-id", "locationId": "loc-name", "readyStatus": { "servers": ["server" for _ in range(10)] }, } ]}}) obj.client.results.append({"result": {"sessions": [ { "id": "session-id", "name": "loc-name/scenario", "configuration": {} } ]}}) obj.test.get_master_status() widget = obj.get_widget() widget.update() self.assertEqual("None #None\n scenario:\n Agents in loc-name: 10\n", widget.text.get_text()[0])
def test_widget_cloud_test(self): obj = CloudProvisioning() obj.client = BlazeMeterClientEmul(logging.getLogger('')) obj.test = CloudTaurusTest({}, {}, obj.client, None, None, None, logging.getLogger('')) obj.client.results.append({"result": []}) obj.client.results.append({"result": {"sessions": [ { "name": "executor/scenario/location", "configuration": {} } ]}}) obj.client.results.append({"result": {"sessions": [ { "name": "executor/scenario/location", "configuration": { "location": "loc-name", "serversCount": "10" } } ]}}) widget = obj.get_widget() widget.update() widget.update() widget.update() widget.update() self.assertEqual("None #None\n executor scenario:\n Agents in loc-name: 10\n", widget.text.get_text()[0])
def test_cloud_config_cleanup(self): obj = CloudProvisioning() obj.engine = EngineEmul() obj.engine.config.merge({ ScenarioExecutor.EXEC: { "concurrency": { "local": 1, "cloud": 10, }, "locations": { "us-east-1": 1, "us-west": 2 } }, }) obj.parameters = obj.engine.config['execution'] obj.test = CloudTaurusTest(obj.engine.config['execution'], {}, obj.client, None, None, "name", logging.getLogger('')) cloud_config = obj.test.prepare_cloud_config(obj.engine.config) execution = cloud_config["execution"][0] self.assertNotIn("throughput", execution) self.assertNotIn("ramp-up", execution) self.assertNotIn("hold-for", execution) self.assertNotIn("steps", execution)
def test_widget_cloud_test(self): obj = CloudProvisioning() obj.client = BlazeMeterClientEmul(logging.getLogger('')) obj.test = CloudTaurusTest(obj.client, None, None, None, None, logging.getLogger('')) obj.client.results.append({"result": []}) obj.client.results.append({ "result": { "sessions": [{ "name": "executor/scenario/location", "configuration": {} }] } }) obj.client.results.append({ "result": { "sessions": [{ "name": "executor/scenario/location", "configuration": { "location": "loc-name", "serversCount": "10" } }] } }) widget = obj.get_widget() widget.update() widget.update() widget.update() widget.update() self.assertEqual( "None #None\n executor scenario:\n Agents in loc-name: 10\n", widget.text.get_text()[0])