Skip to content

Commit 29a811c

Browse files
authored
Adding new test assertions (#342)
1 parent ca5c882 commit 29a811c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tests/fixtures/splunk_app_example/local/savedsearches.conf

Whitespace-only changes.

tests/test_docker_splunk.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ def test_compose_1deployment1so(self):
19241924
self.check_common_keys(inventory_json, container_mapping[container])
19251925
# Check Splunkd on all the containers
19261926
assert self.check_splunkd("admin", self.password)
1927-
# Make sure apps are installed, and shcluster is setup properly
1927+
# Make sure apps are installed and certain subdirectories are excluded
19281928
containers = self.client.containers(filters={"label": "com.docker.compose.project={}".format(self.project_name)})
19291929
assert len(containers) == 3
19301930
for container in containers:
@@ -1939,6 +1939,14 @@ def test_compose_1deployment1so(self):
19391939
resp = requests.get(url, auth=("admin", self.password), verify=False)
19401940
# Deployment server should *not* install the app
19411941
assert resp.status_code == 404
1942+
# Check that the app exists in etc/apps
1943+
exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/apps/splunk_app_example/local/", user="splunk")
1944+
std_out = self.client.exec_start(exec_command)
1945+
assert "savedsearches.conf" in std_out
1946+
# Check that the app exists in etc/deployment-apps
1947+
exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/deployment-apps/splunk_app_example/local/", user="splunk")
1948+
std_out = self.client.exec_start(exec_command)
1949+
assert "savedsearches.conf" not in std_out
19421950
if container_name == "so1":
19431951
RETRIES = 5
19441952
for i in range(RETRIES):
@@ -2002,6 +2010,14 @@ def test_compose_1deployment1uf(self):
20022010
resp = requests.get(url, auth=("admin", self.password), verify=False)
20032011
# Deployment server should *not* install the app
20042012
assert resp.status_code == 404
2013+
# Check that the app exists in etc/apps
2014+
exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/apps/splunk_app_example/local/", user="splunk")
2015+
std_out = self.client.exec_start(exec_command)
2016+
assert "savedsearches.conf" in std_out
2017+
# Check that the app exists in etc/deployment-apps
2018+
exec_command = self.client.exec_create(container["Id"], "ls /opt/splunk/etc/deployment-apps/splunk_app_example/local/", user="splunk")
2019+
std_out = self.client.exec_start(exec_command)
2020+
assert "savedsearches.conf" not in std_out
20052021
if container_name == "uf1":
20062022
RETRIES = 5
20072023
for i in range(RETRIES):

0 commit comments

Comments
 (0)