Skip to content

Commit

Permalink
Move other preliminary setup out of test script
Browse files Browse the repository at this point in the history
  • Loading branch information
jonct committed Jul 7, 2024
1 parent 741e47c commit d64ff6f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
# (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"
Expand Down Expand Up @@ -62,6 +66,21 @@ jobs:
systemctl restart dnsmasq.service
# NOTE: <https://github.com/marketplace/actions/tune-github-hosted-runner-network>

# # 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: |
# apt-get install -y -qq zfsutils-linux
# modinfo zfs | grep version
# zfs --version
# zpool --version

# Runs a single command using the runners shell
- name: Run a one-line script
run: sudo ./test/test.sh
- name: Run the test script
env:
PYTHONUNBUFFERED: 1
run: |
chown 0:0 jlmkr.py test/test.sh
chmod +x jlmkr.py test/test.sh
sudo ./test/test.sh
18 changes: 1 addition & 17 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

export PYTHONUNBUFFERED=1

uname -r
cat /etc/os-release
python3 --version

# # 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
# apt-get install -y -qq zfsutils-linux
# modinfo zfs | grep version
# zfs --version
# zpool --version

# TODO: create a path and/or zfs pool with a space in it to test if jlmkr.py still works properly when ran from inside
# mkdir -p "/tmp/path with space/jailmaker"

chown 0:0 jlmkr.py
chmod +x jlmkr.py

# 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 --network-veth --system-call-filter='add_key' --system-call-filter='bpf' --system-call-filter='keyctl'
./jlmkr.py exec test docker run hello-world

# TODO: many more test cases and checking if actual output (text, files on disk etc.) is correct instead of just a 0 exit code
# TODO: many more test cases and checking if actual output (text, files on disk etc.) is correct instead of just a 0 exit code

0 comments on commit d64ff6f

Please sign in to comment.