def test_connection_id(platform="MK", distributed=False): # generate the filter code result = generate_filter("connection_id.cql", [], distributed) assert result == util.EXIT_SUCCESS # bootstrap the filter storage_proc = bootstrap(distributed) # first request log.info("Sending request #1") requests.send_request(platform) storage_content = storage.query_storage() text = storage_content.text result_set = process_response(text) assert len(result_set) != 0 storage.kill_storage_mon(storage_proc) log.info("connection_id test succeeded.") return util.EXIT_SUCCESS
def test_height(platform="MK", distributed=False): # generate the filter code result = generate_filter("height.cql", ["height.rs"], distributed) assert result == util.EXIT_SUCCESS # bootstrap the filter storage_proc = bootstrap(distributed) # first request log.info("Sending request #1") requests.send_request(platform) storage_content = storage.query_storage() text = storage_content.text result_set = process_response(text) assert "2" in result_set, "expected 2 received %s" % result_set storage.kill_storage_mon(storage_proc) log.info("height test succeeded.") return util.EXIT_SUCCESS
def test_get_service_name(platform="MK", distributed=False): # generate the filter code result = generate_filter("get_service_name.cql", [], distributed) assert result == util.EXIT_SUCCESS # bootstrap the filter storage_proc = bootstrap(distributed) # first request log.info("Sending request #1") requests.send_request(platform) log.info("Querying storage") storage_content = storage.query_storage() text = storage_content.text result_set = process_response(text) assert "productpage-v1" in result_set, ( "Expected productpage-v1 received %s" % result_set) storage.kill_storage_mon(storage_proc) log.info("get_service_name test succeeded.") return util.EXIT_SUCCESS
def test_request_time(platform="MK", distributed=False): # generate the filter code result = generate_filter("request_time.cql", [], distributed) assert result == util.EXIT_SUCCESS # bootstrap the filter storage_proc = bootstrap(distributed) # first request send_time = time.time_ns() log.info("Sending request #1") requests.send_request(platform) storage_content = storage.query_storage() text = storage_content.text result_set = process_response(text) assert len(result_set) == 1 for result in result_set: assert int(result) > send_time assert int(result) < time.time_ns() storage.kill_storage_mon(storage_proc) log.info("request_time test succeeded.") return util.EXIT_SUCCESS