Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions base/centos-7/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ echo "
## Allows people in group sudo to run all commands
%sudo ALL=(ALL) ALL" >> /etc/sudoers

# Remove nproc limits
rm -rf /etc/security/limits.d/20-nproc.conf

# Clean
yum clean all
rm -rf /install.sh /anaconda-post.log /var/log/anaconda/*
58 changes: 48 additions & 10 deletions tests/test_single_splunk_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,31 @@ def test_splunk_scloud(self):
time.sleep(5)
# If the container is still running, we should be able to exec inside
# Check that the version returns successfully for multiple users
exec_command = self.client.exec_create(cid, "scloud version", user="splunk")
std_out = self.client.exec_start(exec_command)
assert "scloud version " in std_out
exec_command = self.client.exec_create(cid, "scloud version", user="ansible")
for user in ["splunk", "ansible"]:
exec_command = self.client.exec_create(cid, "scloud version", user=user)
std_out = self.client.exec_start(exec_command)
assert "scloud version " 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_splunk_ulimit(self):
cid = None
try:
# Run container
cid = self.client.create_container(self.SPLUNK_IMAGE_NAME, tty=True, command="no-provision")
cid = cid.get("Id")
self.client.start(cid)
# Wait a bit
time.sleep(5)
# If the container is still running, we should be able to exec inside
# Check that nproc limits are unlimited
exec_command = self.client.exec_create(cid, "sudo -u splunk bash -c 'ulimit -u'")
std_out = self.client.exec_start(exec_command)
assert "scloud version " in std_out
assert "unlimited" in std_out
except Exception as e:
self.logger.error(e)
raise e
Expand Down Expand Up @@ -2635,12 +2654,31 @@ def test_uf_scloud(self):
time.sleep(5)
# If the container is still running, we should be able to exec inside
# Check that the version returns successfully for multiple users
exec_command = self.client.exec_create(cid, "scloud version", user="splunk")
std_out = self.client.exec_start(exec_command)
assert "scloud version " in std_out
exec_command = self.client.exec_create(cid, "scloud version", user="ansible")
for user in ["splunk", "ansible"]:
exec_command = self.client.exec_create(cid, "scloud version", user=user)
std_out = self.client.exec_start(exec_command)
assert "scloud version " 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_uf_ulimit(self):
cid = None
try:
# Run container
cid = self.client.create_container(self.UF_IMAGE_NAME, tty=True, command="no-provision")
cid = cid.get("Id")
self.client.start(cid)
# Wait a bit
time.sleep(5)
# If the container is still running, we should be able to exec inside
# Check that nproc limits are unlimited
exec_command = self.client.exec_create(cid, "sudo -u splunk bash -c 'ulimit -u'")
std_out = self.client.exec_start(exec_command)
assert "scloud version " in std_out
assert "unlimited" in std_out
except Exception as e:
self.logger.error(e)
raise e
Expand Down