-
Notifications
You must be signed in to change notification settings - Fork 0
V2: Add BitLocker support + modular refactor + tests #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
43af7da
23372bd
49816d0
8550285
6020b9b
415f596
789a2a7
ba3b530
10b000b
d138198
e6b6b23
440e336
adef8b4
3d655f9
510fc21
3b2eec5
23af156
40e7978
6a2e39e
6bfa6b5
5c46060
53c391f
3122b40
9934ec7
a226fc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install ShellCheck | ||
| run: sudo apt-get update && sudo apt-get install -y shellcheck | ||
|
|
||
| - name: Check syntax | ||
| run: bash -n srv-ctl.sh lib/os-utils.sh lib/storage.sh | ||
|
|
||
| - name: Run ShellCheck | ||
| run: | | ||
| cp tests/fixtures/config.local.test config.local | ||
| shellcheck -x srv-ctl.sh lib/os-utils.sh lib/storage.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: E2E Tests (VM) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| vm: | ||
| name: ${{ matrix.os }} | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # Only test OSes with cryptsetup >=2.4.0 (BitLocker support): Debian 12+, Ubuntu 22.04+ | ||
| os: [debian-12, debian-13, ubuntu-22.04, ubuntu-24.04] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Enable KVM | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
|
|
||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y qemu-system-x86 qemu-utils cloud-image-utils | ||
|
|
||
| - name: Cache VM images | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/vm-images | ||
| key: vm-image-${{ matrix.os }} | ||
|
|
||
| - name: Download cloud image | ||
| run: | | ||
| mkdir -p ~/.cache/vm-images | ||
| ./tests/vm/download-image.sh ${{ matrix.os }} | ||
|
|
||
| - name: Run E2E tests (${{ matrix.os }}) | ||
| timeout-minutes: 15 | ||
| run: ./tests/vm/run-e2e-tests.sh ${{ matrix.os }} | ||
|
|
||
| - name: Upload results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: e2e-results-${{ matrix.os }} | ||
| path: tests/vm/results/ | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: ./tests/vm/cleanup.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Integration Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| vm: | ||
| name: ${{ matrix.os }} | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # Only test OSes with cryptsetup >=2.4.0 (BitLocker support): Debian 12+, Ubuntu 22.04+ | ||
| os: [debian-12, debian-13, ubuntu-22.04, ubuntu-24.04] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Enable KVM | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
|
|
||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y qemu-system-x86 qemu-utils cloud-image-utils | ||
|
|
||
| - name: Cache VM images | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/vm-images | ||
| key: vm-image-${{ matrix.os }} | ||
|
|
||
| - name: Download cloud image | ||
| run: | | ||
| mkdir -p ~/.cache/vm-images | ||
| ./tests/vm/download-image.sh ${{ matrix.os }} | ||
|
|
||
| - name: Run integration tests (${{ matrix.os }}) | ||
| timeout-minutes: 15 | ||
| run: ./tests/vm/run-tests.sh ${{ matrix.os }} | ||
|
|
||
| - name: Upload results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: results-${{ matrix.os }} | ||
| path: tests/vm/results/ | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: ./tests/vm/cleanup.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Unit Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| unit: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install bats | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y git curl | ||
| git clone --branch v1.13.0 --depth 1 https://github.com/bats-core/bats-core.git /tmp/bats-core | ||
| sudo /tmp/bats-core/install.sh /usr/local | ||
|
|
||
| - name: Run unit tests | ||
| run: bats tests/unit/*.bats |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,6 @@ | ||
| config.local | ||
| config.local.* | ||
|
|
||
| # Test artifacts | ||
| tests/vm/results/ | ||
| tests/vm/work/ |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,9 +9,9 @@ readonly CRYPTSETUP_MIN_VERSION="2.4.0" | |||||||||||||||||||||||||||
| readonly ST_USER_1="none" # Set to username to enable (e.g., "alice") | ||||||||||||||||||||||||||||
| readonly ST_USER_2="none" # Set to username to enable (e.g., "bob") | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Service names (automatically constructed) | ||||||||||||||||||||||||||||
| readonly ST_SERVICE_1="${ST_USER_1:+syncthing@${ST_USER_1}.service}" | ||||||||||||||||||||||||||||
| readonly ST_SERVICE_2="${ST_USER_2:+syncthing@${ST_USER_2}.service}" | ||||||||||||||||||||||||||||
| # Service names (automatically constructed from user names) | ||||||||||||||||||||||||||||
| readonly ST_SERVICE_1=$([ "$ST_USER_1" != "none" ] && echo "syncthing@${ST_USER_1}.service" || echo "none") | ||||||||||||||||||||||||||||
| readonly ST_SERVICE_2=$([ "$ST_USER_2" != "none" ] && echo "syncthing@${ST_USER_2}.service" || echo "none") | ||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+14
|
||||||||||||||||||||||||||||
| readonly ST_SERVICE_1=$([ "$ST_USER_1" != "none" ] && echo "syncthing@${ST_USER_1}.service" || echo "none") | |
| readonly ST_SERVICE_2=$([ "$ST_USER_2" != "none" ] && echo "syncthing@${ST_USER_2}.service" || echo "none") | |
| if [ "$ST_USER_1" != "none" ]; then | |
| readonly ST_SERVICE_1="syncthing@${ST_USER_1}.service" | |
| else | |
| readonly ST_SERVICE_1="none" | |
| fi | |
| if [ "$ST_USER_2" != "none" ]; then | |
| readonly ST_SERVICE_2="syncthing@${ST_USER_2}.service" | |
| else | |
| readonly ST_SERVICE_2="none" | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VM tests workflow references "debian-13" on line 16, which corresponds to an unreleased version. While the download-image.sh script has a URL for it, this should be documented as experimental/testing. Consider adding a comment to clarify this is a testing/daily build and may be unstable, or exclude it from the standard test matrix and only run it manually.