Fix issue with log destroyed error message on mount and extra logs on unmount #138
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Fuzz Tests | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| schedule: | |
| # Run extended fuzzing weekly on Sunday at 2am UTC | |
| - cron: "0 2 * * 0" | |
| workflow_dispatch: | |
| inputs: | |
| fuzz_time: | |
| description: "Fuzz duration per test (e.g., 30s, 5m)" | |
| type: string | |
| required: false | |
| default: "1m" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| fuzz-tests: | |
| name: Fuzz Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| go: "1.26" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version: ${{ env.go }} | |
| check-latest: true | |
| - name: Restore fuzz corpus | |
| uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: | | |
| ~/.cache/go-build/fuzz | |
| **/testdata/fuzz | |
| key: fuzz-corpus-${{ runner.os }}-${{ hashFiles('**/*_fuzz_test.go') }} | |
| restore-keys: | | |
| fuzz-corpus-${{ runner.os }}- | |
| - name: Set fuzz duration | |
| id: fuzz-config | |
| env: | |
| INPUT_FUZZ_TIME: ${{ github.event.inputs.fuzz_time }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| REF: ${{ github.ref }} | |
| run: | | |
| if [ -n "$INPUT_FUZZ_TIME" ]; then | |
| echo "FUZZ_TIME=$INPUT_FUZZ_TIME" >> $GITHUB_ENV | |
| elif [ "$EVENT_NAME" = "schedule" ]; then | |
| echo "FUZZ_TIME=2m" >> $GITHUB_ENV | |
| elif [ "$EVENT_NAME" = "push" ] && [ "$REF" = "refs/heads/main" ]; then | |
| echo "FUZZ_TIME=30s" >> $GITHUB_ENV | |
| else | |
| # For PRs, just validate seed corpus (no extended fuzzing) | |
| echo "FUZZ_TIME=0" >> $GITHUB_ENV | |
| fi | |
| - name: Validate seed corpus (PRs only) | |
| if: env.FUZZ_TIME == '0' | |
| run: | | |
| echo "Validating fuzz test seed corpus..." | |
| go test -run='^Fuzz' -tags=unittest ./common/ | |
| - name: Run fuzz tests | |
| if: env.FUZZ_TIME != '0' | |
| run: | | |
| echo "Running fuzz tests for $FUZZ_TIME per target..." | |
| # Run encryption fuzz tests (security-critical) | |
| echo "=== FuzzEncryptDecryptRoundTrip ===" | |
| go test -run='^$' -fuzz=FuzzEncryptDecryptRoundTrip -fuzztime="$FUZZ_TIME" -tags=unittest ./common/ | |
| echo "=== FuzzDecryptMalformed ===" | |
| go test -run='^$' -fuzz=FuzzDecryptMalformed -fuzztime="$FUZZ_TIME" -tags=unittest ./common/ | |
| # Run path fuzz tests | |
| echo "=== FuzzNormalizeObjectName ===" | |
| go test -run='^$' -fuzz=FuzzNormalizeObjectName -fuzztime="$FUZZ_TIME" -tags=unittest ./common/ | |
| echo "=== FuzzJoinUnixFilepath ===" | |
| go test -run='^$' -fuzz=FuzzJoinUnixFilepath -fuzztime="$FUZZ_TIME" -tags=unittest ./common/ | |
| - name: Save fuzz corpus | |
| if: always() && github.event_name != 'pull_request' | |
| uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: | | |
| ~/.cache/go-build/fuzz | |
| **/testdata/fuzz | |
| key: fuzz-corpus-${{ runner.os }}-${{ hashFiles('**/*_fuzz_test.go') }}-${{ github.run_id }} | |
| - name: Upload crash artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: fuzz-crash-artifacts-${{ github.sha }} | |
| path: | | |
| **/testdata/fuzz/*/crash-* | |
| **/testdata/fuzz/*/leak-* | |
| if-no-files-found: ignore | |
| retention-days: 30 |