def test_count(platform="MK", distributed=False): # generate the filter code result = generate_filter("count.cql", ["count.cc"], 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 "1" in result_set, "Expected 1 received %s" % result_set # second request log.info("Sending request #2") 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 # third request log.info("Sending request #3") requests.send_request(platform) storage_content = storage.query_storage() text = storage_content.text result_set = process_response(text) assert "3" in result_set, "Expected 3 received %s" % result_set storage.kill_storage_mon(storage_proc) log.info("count test succeeded.") return util.EXIT_SUCCESS
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_avg(platform="MK", distributed=False): # generate the filter code result = generate_filter("height.cql", ["height.rs", "avg.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_request_size(platform="MK", distributed=False): # generate the filter code result = generate_filter("request_size.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 "productpage-v1" in result_set, ( "Expected productpage-v1 received %s" % result_set) storage.kill_storage_mon(storage_proc) log.info("request_size 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