Add CI workflow and test script for CasaOS Docker fix (#68)

* Add CI workflow and test script for CasaOS Docker fix

Introduces a GitHub Actions workflow to automate testing of the CasaOS Docker API version fix script. Adds a comprehensive test-script.sh for simulating Docker upgrades, verifying the fix, and testing edge cases. Enhances run.sh with non-interactive mode support and colored output, and updates confirmation prompts to respect the NON_INTERACTIVE environment variable.

* Fix color variable typo and improve version check

Corrects the YIGHLIGHT variable to YELLOW for output coloring. Updates Docker API version comparison to use awk for proper numeric comparison. Also improves error reporting in test_fix_script by capturing and returning the actual exit code.

* Add CasaOS version check hang handling and tests

Introduces timeout handling for 'casaos -v' in run.sh to prevent script hangs if CasaOS is in a broken state. Updates test-script.sh to add a dedicated test for CasaOS version check hang handling and includes it in the bug fix test suite. Updates workflow to run the new bug fix tests. Script version updated to 2025.11.0.

* Fix local variable assignment in test-script.sh

Refactored the assignment of the 'output' variable to avoid combining declaration and command substitution, improving compatibility and clarity in the script.

* Fix local variable assignment in test-script.sh

Separated declaration and assignment of the 'output' variable to avoid issues with local scoping in subshells. This improves compatibility and reliability of the test script.
This commit is contained in:
Christopher
2025-11-27 15:45:15 -06:00
committed by GitHub
parent 5fd56bad46
commit 72ac7a3811
3 changed files with 1879 additions and 9 deletions

34
.github/workflows/test-casaos-fix.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Test CasaOS Fix Docker API Version
on:
push:
paths:
- 'casaos-fix-docker-api-version/**'
pull_request:
paths:
- 'casaos-fix-docker-api-version/**'
workflow_dispatch:
jobs:
test-fix-script:
runs-on: ubuntu-latest
env:
NON_INTERACTIVE: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Make scripts executable
run: |
chmod +x casaos-fix-docker-api-version/run.sh
chmod +x casaos-fix-docker-api-version/test-script.sh
- name: Run bug fix tests
working-directory: casaos-fix-docker-api-version
run: |
sudo -E ./test-script.sh test-bugfixes
- name: Run full test
working-directory: casaos-fix-docker-api-version
run: |
sudo -E ./test-script.sh full