Skip to content

Commit

Permalink
TestAdd GitHub Actions workflow for testing Firewalld. It adds a chec…
Browse files Browse the repository at this point in the history
…k to ensure that the Docker container needed for testing is running correctly. If the container has failed to start, the commit now instructs the workflow to output corresponding logs and docker inspect outputs for debugging, and then exits the workflow with an error status.
  • Loading branch information
dvershinin committed Jul 11, 2024
1 parent 6fd8d3b commit 4b6dea8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-firewalld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
# Wait for the container to be fully initialized
sleep 10
# Check if the container is running
# Capture and print logs if the container is not running
if [ "$(sudo docker inspect -f '{{.State.Running}}' firewalld-container)" != "true" ]; then
echo "Container failed to start. Logs:"
sudo docker logs firewalld-container
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile.firewalld
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == system
rm -f /lib/systemd/system/anaconda.target.wants/*; \
systemctl set-default multi-user.target

# Override systemd defaults
RUN mkdir -p /etc/systemd/system/service.d
RUN echo '[Service]' > /etc/systemd/system/service.d/override.conf
RUN echo 'ExecStart=' >> /etc/systemd/system/service.d/override.conf
RUN echo 'ExecStart=/usr/lib/systemd/systemd' >> /etc/systemd/system/service.d/override.conf

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/sbin/init"]

0 comments on commit 4b6dea8

Please sign in to comment.