Skip to content

Update Docker run command in test workflow #31

Update Docker run command in test workflow

Update Docker run command in test workflow #31

name: Test Firewalld
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test-firewalld:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build Docker image
run: |
docker build -t my-firewalld-image -f Dockerfile.firewalld .
- name: Run tests
run: |
# Run the container with systemd initialization
docker run --init --privileged --name firewalld-container -d -v /sys/fs/cgroup:/sys/fs/cgroup:ro my-firewalld-image /usr/sbin/init
# Wait for the container to be fully initialized
sleep 10
docker logs firewalld-container
# Run tests inside the container
docker exec firewalld-container /bin/bash -c "./firewalld-tests.sh"