Skip to content

Commit 9cda674

Browse files
9.x UF fix (#603)
* attempt to run tests; * debug changes: comment out splunk tests and only allow UF tests; * pin pytest to 4.4.0; * add more tests; * add more UF tests; * add all tests; * remove util-linux;
1 parent 0e987d0 commit 9cda674

File tree

3 files changed

+5
-47
lines changed

3 files changed

+5
-47
lines changed

tests/requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
pytest
1+
pytest==4.4.0
2+
pyrsistent==0.16.1
23
requests
34
docker
45
PyYAML
56
docker-compose
67
pyasn1
78
junit-xml
89
pytest-xdist
9-
pytest-rerunfailures
10+
pytest-rerunfailures==8.0

tests/test_single_splunk_image.py

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,6 @@ def test_splunk_entrypoint_help(self):
7070
assert "SPLUNK_HOME - home directory where Splunk gets installed (default: /opt/splunk)" in output
7171
assert "Examples:" in output
7272

73-
def test_splunk_scloud(self):
74-
cid = None
75-
try:
76-
# Run container
77-
cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="no-provision")
78-
cid = cid.get("Id")
79-
self.client.start(cid)
80-
# Wait a bit
81-
time.sleep(5)
82-
# If the container is still running, we should be able to exec inside
83-
# Check that the version returns successfully for multiple users
84-
for user in ["splunk", "ansible"]:
85-
exec_command = self.client.exec_create(cid, "scloud version", user=user)
86-
std_out = self.client.exec_start(exec_command)
87-
assert "scloud version " in std_out
88-
except Exception as e:
89-
self.logger.error(e)
90-
raise e
91-
finally:
92-
if cid:
93-
self.client.remove_container(cid, v=True, force=True)
94-
9573
def test_splunk_ulimit(self):
9674
cid = None
9775
try:
@@ -2662,28 +2640,6 @@ def test_adhoc_1uf_bind_mount_apps(self):
26622640
except OSError:
26632641
pass
26642642

2665-
def test_uf_scloud(self):
2666-
cid = None
2667-
try:
2668-
# Run container
2669-
cid = self.client.create_container(self.UF_IMAGE_NAME, tty=True, command="no-provision")
2670-
cid = cid.get("Id")
2671-
self.client.start(cid)
2672-
# Wait a bit
2673-
time.sleep(5)
2674-
# If the container is still running, we should be able to exec inside
2675-
# Check that the version returns successfully for multiple users
2676-
for user in ["splunk", "ansible"]:
2677-
exec_command = self.client.exec_create(cid, "scloud version", user=user)
2678-
std_out = self.client.exec_start(exec_command)
2679-
assert "scloud version " in std_out
2680-
except Exception as e:
2681-
self.logger.error(e)
2682-
raise e
2683-
finally:
2684-
if cid:
2685-
self.client.remove_container(cid, v=True, force=True)
2686-
26872643
def test_uf_ulimit(self):
26882644
cid = None
26892645
try:
@@ -2821,4 +2777,4 @@ def test_compose_1hf_splunk_add(self):
28212777
# Check Splunkd on all the containers
28222778
assert self.check_splunkd("admin", self.password)
28232779
# Check Splunkd using the new users
2824-
assert self.check_splunkd("jerry", "seinfeld")
2780+
assert self.check_splunkd("jerry", "seinfeld")

uf/common-files/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ USER root
9191

9292
# Setup users and groups
9393
RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL\nansible ALL=(splunk)NOPASSWD:ALL/g' /etc/sudoers \
94+
&& microdnf install systemd \
9495
&& echo 'Create the ansible user/group' \
9596
&& groupadd -r ${ANSIBLE_GROUP} \
9697
&& useradd -r -m -g ${ANSIBLE_GROUP} -s /bin/bash ${ANSIBLE_USER} \

0 commit comments

Comments
 (0)