Skip to content

Commit c57f07f

Browse files
committed
Add test upgrade for hec_ack connector
1 parent 40b72da commit c57f07f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

test/lib/commonsplunk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def _get_events(job_id, url="", user="", password=""):
227227
@param: job_id
228228
returns events
229229
'''
230-
event_url = '{0}/services/search/jobs/{1}/events?output_mode=json&count=3000'.format(
230+
event_url = '{0}/services/search/jobs/{1}/events?output_mode=json&count=0'.format(
231231
url, str(job_id))
232232
logger.debug('requesting: %s', event_url)
233233

test/lib/connector_upgrade.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ def generate_kafka_events(num):
5656
}
5757
}
5858
create_kafka_connector(config, connector_content)
59+
connector_content_ack = {
60+
"name": "kafka_connect_ack",
61+
"config": {
62+
"connector.class": "com.splunk.kafka.connect.SplunkSinkConnector",
63+
"tasks.max": "1",
64+
"splunk.indexes": config["splunk_index"],
65+
"topics": "kafka_data_gen",
66+
"splunk.hec.ack.enabled": "true",
67+
"splunk.hec.uri": config["splunk_hec_url"],
68+
"splunk.hec.ssl.validate.certs": "false",
69+
"splunk.hec.token": config["splunk_token_ack"]
70+
}
71+
}
72+
create_kafka_connector(config, connector_content_ack)
5973
create_kafka_topics(config, topics)
6074
producer = KafkaProducer(bootstrap_servers=config["kafka_broker_url"],
6175
value_serializer=lambda v: json.dumps(v).encode('utf-8'))
@@ -107,4 +121,4 @@ def upgrade_connector():
107121
query=["search {}".format(search_query)],
108122
password=config["splunk_password"])
109123
logger.info("Splunk received %s events in the last 15m", len(events))
110-
assert len(events) == 2000
124+
assert len(events) == 4000

0 commit comments

Comments
 (0)