diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8f198f..bae271a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,9 +6,9 @@ name: CI on: # Triggers the workflow on push or pull request events for any branch push: - branches: [ "**" ] + branches: ["**"] pull_request: - branches: [ "**" ] + branches: ["**"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -25,6 +25,7 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 + # NOTE: # Create a network namespace in the GitHub-hosted runner VM, # simulating a primary bridge network on TrueNAS SCALE - name: Set up networking resources @@ -33,12 +34,10 @@ jobs: sed -i -e 's/^#DNSStubListener=yes$/DNSStubListener=no/' /etc/systemd/resolved.conf systemctl stop systemd-resolved - systemctl status systemd-resolved rm /etc/resolv.conf echo 'nameserver 1.1.1.1' > /etc/resolv.conf - - apt-get install -qq -y \ - systemd-container + + apt-get install -qq -y systemd-container cat </etc/systemd/network/10-br1.network [Match] @@ -59,41 +58,34 @@ jobs: systemctl restart systemd-networkd ip link add name br1 type bridge + + iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE + iptables -I DOCKER-USER -i br1 -o eth0 -j ACCEPT END - # (temporary) - name: Examine the GitHub-hosted runner environment run: | uname -r cat /etc/os-release python3 --version - echo - for path in /etc/systemd/network* /etc/systemd/resolve* /etc/resolv.conf ; do - echo "✳️ $path" - [ -d "$path" ] && ls -la "$path" || cat "$path" - echo - done ip addr - # NOTE: + # # TODO: create zpool with virtual disks, create jailmaker dataset and test jlmkr.py from there + # # https://medium.com/@abaddonsd/zfs-usage-with-virtual-disks-62898064a29b + # - name: Create a parent ZFS dataset + # run: | + # sudo -s < jails/examiner/rootfs/root/debug.sh -for path in /etc/systemd/network* /etc/systemd/resolve* /etc/resolv.conf ; do - echo "✳️ \$path" - [ -d "\$path" ] && ls -la "\$path" || cat "\$path" - echo -done -netstat -n -r -sleep 3 -ip addr -resolvectl query deb.debian.org -EOF - -sleep 5 -./jlmkr.py exec examiner bash /root/debug.sh - # TODO: test jlmkr.py from inside another working directory, with a relative path to a config file to test if it uses the config file (and doesn't look for it relative to the jlmkr.py file itself) + ./jlmkr.py create --start --config=./templates/docker/config test ./jlmkr.py exec test docker run hello-world