Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions tests/test_docker_splunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,42 @@ def test_adhoc_1uf_password_from_file(self):
if cid:
self.client.remove_container(cid, v=True, force=True)

def test_adhoc_1so_reflexive_forwarding(self):
# Create a splunk container
cid = None
try:
splunk_container_name = generate_random_string()
# When adding SPLUNK_STANDALONE_URL to the standalone, we shouldn't have any situation where it starts forwarding/disables indexing
cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, ports=[8089], name=splunk_container_name,
environment={
"DEBUG": "true",
"SPLUNK_START_ARGS": "--accept-license",
"SPLUNK_PASSWORD": self.password,
"SPLUNK_STANDALONE_URL": splunk_container_name
},
host_config=self.client.create_host_config(port_bindings={8089: ("0.0.0.0",)})
)
cid = cid.get("Id")
self.client.start(cid)
# Poll for the container to be ready
assert self.wait_for_containers(1, name=splunk_container_name)
# Check splunkd
splunkd_port = self.client.port(cid, 8089)[0]["HostPort"]
url = "https://localhost:{}/services/server/info".format(splunkd_port)
kwargs = {"auth": ("admin", self.password), "verify": False}
status, content = self.handle_request_retry("GET", url, kwargs)
assert status == 200
# Check the decrypted pass4SymmKey
exec_command = self.client.exec_create(cid, "ls /opt/splunk/etc/system/local/", user="splunk")
std_out = self.client.exec_start(exec_command)
assert "outputs.conf" not in std_out
except Exception as e:
self.logger.error(e)
raise e
finally:
if cid:
self.client.remove_container(cid, v=True, force=True)

def test_adhoc_1so_splunk_pass4symmkey(self):
# Create a splunk container
cid = None
Expand Down