From 569f8a558637be8bf2643dc7654c741a9b752c23 Mon Sep 17 00:00:00 2001 From: Eric Van Hensbergen Date: Wed, 26 Aug 2026 10:37:39 -0500 Subject: [PATCH 1/4] docs: align README with live Actions; drop take-1 demand/nightly YAML The runner/framework on main already works (ci.yml, publish, sync). Issue #3 leftover was stale docs (demand.yml/nightly.yml, GHCR, linux repository_dispatch) and snapshot workflow files under old/rework-take-1. Closes #3 --- .github/workflows/linux-kernel-publish.yml | 5 + AGENTS.md | 6 +- CHANGES.md | 1 + README.md | 169 ++++-------------- TODO.md | 22 ++- old/rework-take-1/.github/README.md | 3 + .../.github/workflows/demand.yml | 166 ----------------- .../workflows/linux-kernel-publish.yml | 153 ---------------- .../.github/workflows/nightly.yml | 148 --------------- old/rework-take-1/README.md | 6 + 10 files changed, 64 insertions(+), 615 deletions(-) create mode 100644 old/rework-take-1/.github/README.md delete mode 100644 old/rework-take-1/.github/workflows/demand.yml delete mode 100644 old/rework-take-1/.github/workflows/linux-kernel-publish.yml delete mode 100644 old/rework-take-1/.github/workflows/nightly.yml diff --git a/.github/workflows/linux-kernel-publish.yml b/.github/workflows/linux-kernel-publish.yml index 980b409..f09f7bb 100644 --- a/.github/workflows/linux-kernel-publish.yml +++ b/.github/workflows/linux-kernel-publish.yml @@ -1,3 +1,8 @@ +# Lives in v9fs/test only (#15). Do not add a copy to v9fs/linux. +# +# Triggers: workflow_dispatch here, or `gh workflow run` from +# sync-torvalds-linux.yml. repository_dispatch (publish-kernel-image) is +# emergency/manual only — linux is mirror-only and must not fire it. name: Publish Linux kernel (arm64 Image) on: diff --git a/AGENTS.md b/AGENTS.md index 6c67004..0d1431e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,7 +5,7 @@ Tweak freely. ## Branching and change hygiene -- Do active work on `rework` unless told otherwise. +- Do active work on `main` unless told otherwise. - Keep `README.md`, `CHANGES.md`, and `TODO.md` updated as changes land. - Do not commit generated outputs (`logs/`, `kernel/`, `tmp/`, `initrd.cpio`, pid files). @@ -38,8 +38,8 @@ Tweak freely. - **Kernel publishing** workflow: builds `v9fs/linux` arm64 `Image` and publishes it. - **Harness CI** workflows: download a published kernel `Image` and run tests. - Publishing: - - Prefer a stable, `wget`-able GitHub Release asset `Image` tagged `kernel-main`, `kernel-nightly`, or `kernel-`. - - GHCR is optional/secondary; keep it consistent if used. + - Prefer a stable, `wget`-able GitHub Release asset `Image` tagged `kernel-latest`, `kernel-main`, or `kernel-`. + - Do not add workflows to `v9fs/linux`; sync and publish are owned by this repo. ## Logging and debuggability diff --git a/CHANGES.md b/CHANGES.md index 5ec8670..493e1b3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ ## Unreleased +- Docs: README/TODO/AGENTS match live workflows (`ci.yml`, publish, sync); drop stale `demand.yml`/`nightly.yml` snapshot under `old/rework-take-1/` (#3). - Instrument diod `t0010` first `access=` mount (stderr/dmesg/diod log), pin `version=9p2000.L`, pre-create export, `Defaults !requiretty`, and force a fresh patched build stamp so CI can triage residual non-root mount failures. - Fix non-root `ACCESS_SINGLE` mounts across diod sharness: `scripts/v9fs-mount-9p` + trash on `/tmp`; t0010 runasuser now expected PASS including root-negatives. - Run diod sharness as non-root user `v9fs` (so ACCESS_SINGLE / `--runas` negatives work); per-test `timeout` via automake `LOG_COMPILER` instead of one outer suite timeout. diff --git a/README.md b/README.md index 66566d7..93f895a 100644 --- a/README.md +++ b/README.md @@ -1,168 +1,71 @@ -# v9fs test harness (clean-slate) - -This branch is being reworked from a clean slate. - -The previous implementation snapshot is preserved at: - -- Git tag: `rework-take-1` -- Directory: `old/rework-take-1/` +# v9fs test harness -## Current rebuild (take 2) +Test code and GitHub Actions for exercising the Linux **9p (v9fs)** client. -This repo now contains a **minimal 9p client smoke test harness**: +Kernel source under test is the git **mirror** [v9fs/linux](https://github.com/v9fs/linux). That repo is mirror-only: **no CI workflows there** ([#15](https://github.com/v9fs/test/issues/15)). All regression orchestration lives in **this** repository. -- QEMU runs an **arm64** Linux kernel `Image` -- QEMU exports a host directory via **virtio-9p** -- An initrd runs the smoke test **inside the guest** (no SSH) -- The test exercises basic filesystem operations on the 9p mount +Prior harness snapshot (not used by CI): tag `rework-take-1` / `old/rework-take-1/`. -### Local smoke run (Docker + QEMU) +## How tests run -1. Build the image: +Guest-direct: QEMU arm64 + virtio-9p export of the container root, initrd mounts `hostshare`, then a Debian chroot runs the suite **inside the guest** (no SSH). ```bash docker pull ghcr.io/v9fs/docker:latest -``` - -1. Put a kernel `Image` at `./kernel/.build/arch/arm64/boot/Image` -2. Run the smoke test: - -```bash +# Place arm64 Image at ./kernel/.build/arch/arm64/boot/Image +# (or: gh release download kernel-latest -p Image -D kernel/.build/arch/arm64/boot) make docker-smoke ``` -Logs land under `./logs//` (QEMU serial is `qemu.log`; guest writes `guest.log` + `guest.exitcode`). - -# v9fs test harness - -This repository contains **test code and scripts** for exercising the Linux **9p (v9fs)** filesystem. - -The kernel source under test lives in the upstream repository: - -- `https://github.com/v9fs/linux` - -## What lives here - -- **CI workflows**: automation to build/run tests against a chosen kernel revision -- **Test code**: focused repros and regression tests for v9fs behavior -- **Scripts**: helpers to run locally and/or in CI - -## How we work in this repo - -- **Development branch**: all active work happens on `rework` -- **Change log**: keep `CHANGES.md` updated for every change set -- **Work tracking**: keep `TODO.md` updated as items are added/removed - -## Quick start - -This repo intentionally does *not* vendor the kernel source. Most workflows/scripts will: - -1. Fetch `github.com/v9fs/linux` (or a fork/branch you specify) -2. Build the kernel (or use a provided artifact) -3. Run the tests in this repository against that kernel - -### Local (macOS) via Docker + QEMU - -Clone the kernel repo beside this repo: - -```bash -git clone https://github.com/v9fs/linux ../linux -``` - -Build the test environment image: - -```bash -docker build -t v9fs-test-env:local . -``` - -Build the kernel once (and export it as a reusable artifact): - -```bash -mkdir -p ./tmp ./kernel -docker run --rm --privileged \ - -v "$PWD:/home/v9fs-test/test" \ - -v "$PWD/../linux:/workspaces/linux" \ - -v "$PWD/kernel:/workspaces/kernel" \ - -v "$PWD/tmp:/workspaces/tmp" \ - -w /home/v9fs-test/test \ - v9fs-test-env:local \ - bash -lc "v9fs-build-kernel && v9fs-export-kernel /workspaces/linux /workspaces/linux/.build /workspaces/kernel" -``` +Logs land under `./logs//` (`qemu.log`, `guest.log`, `guest.exitcode`). -Then run tests repeatedly without rebuilding the kernel: +Other suites (same Docker + Image): ```bash -mkdir -p ./tmp -docker run --rm --privileged \ +docker run --rm --privileged --user 0:0 \ -e KERNELBUILD=/workspaces/kernel/.build \ -v "$PWD:/home/v9fs-test/test" \ -v "$PWD/kernel:/workspaces/kernel" \ -v "$PWD/tmp:/workspaces/tmp" \ -w /home/v9fs-test/test \ - v9fs-test-env:local \ - bash -lc "v9fs-run-tests short ci" + ghcr.io/v9fs/docker:latest \ + bash -lc "./scripts/v9fs-run-tests smoke" ``` -## How tests run (guest-direct) - -`v9fs-run-tests` boots QEMU with an initrd that mounts the host-exported workspace -over **9p** and then runs the suite **inside the guest** (no SSH/port-forwarding). - -The host-visible output is primarily the QEMU serial log: - -- `logs//qemu.log` - -The guest mounts the repo at `/mnt/9/test` (see `scripts/v9fs-guest-run`). +Harness matrix suites: `smoke`, `fsx`, `postmark`, `dbench`, `diod-regression`, `qemu-9p2000.L`. ## GitHub Actions -CI uses the same Docker + QEMU flow as local development, but **kernel builds are -published separately** from the harness tests: - -1. A dedicated workflow builds `v9fs/linux` and publishes the arm64 `Image` to - **GitHub Releases** (and GHCR). -2. The harness workflows download that published `Image` into `kernel/.build/arch/...` - and run `v9fs-run-tests ...` with `--privileged` so the harness can bind-mount a - stable 9p export root (`/workspaces/share`). +Kernel **build** and **test** are separate. Images are GitHub Release assets (`Image` on a `kernel-*` tag). GitHub-hosted runners (`ubuntu-24.04-arm` for build/test, `ubuntu-latest` for sync/report). -### Workflows +| Workflow | File | When | +| --- | --- | --- | +| **Sync torvalds/linux** | `.github/workflows/sync-torvalds-linux.yml` | Every 6h + manual. Fast-forwards `v9fs/linux` `upstream`, tracks new **v6+** tags, and can `gh workflow run` publish for the newest tag (`kernel-` + `kernel-latest`). | +| **Publish Linux kernel** | `.github/workflows/linux-kernel-publish.yml` | Manual `workflow_dispatch`, or `gh workflow run` from sync. Optional `repository_dispatch` (`publish-kernel-image`) for emergencies — **not** fired from `v9fs/linux`. Builds arm64 `Image` with 9p options enabled. | +| **Harness CI** | `.github/workflows/ci.yml` | Push, manual, or `workflow_run` after a successful publish. Downloads `kernel-latest` by default. | +There are no `demand.yml` or `nightly.yml` workflows. Those names were from the take-1 harness and only existed as a snapshot under `old/rework-take-1/` (removed). -| Workflow | File | When it runs | -| ------------------------ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Publish Linux kernel** | `.github/workflows/linux-kernel-publish.yml` | `**repository_dispatch`** from `v9fs/linux` (recommended) or `**workflow_dispatch**` here. Builds arm64 `Image`, uploads it to a release tag you choose (`kernel-main`, `kernel-nightly`, `kernel-`, …), and pushes a GHCR bundle tagged by the **linux commit SHA** plus your release tag. | -| **CI (push and manual)** | `.github/workflows/demand.yml` | On **every push** (all branches), **manual** dispatch, or `**workflow_call`**. Downloads `Image` from the `**kernel-main**` release by default (override via `kernel_release`). | -| **Mainline** | `.github/workflows/nightly.yml` | **Daily** schedule + **manual** dispatch. Downloads `Image` from `**kernel-nightly`** by default (override via `kernel_release`). | +Dashboard: wiki [Regression-Dashboard](https://github.com/v9fs/test/wiki/Regression-Dashboard). Per-run `results.json` / `diff-report.md` attach to the `kernel-latest` release when `V9FS_LINUX_SYNC_TOKEN` is set. +### Kernel Images -Because GitHub Actions cannot natively “watch” another repository’s pushes, the -`v9fs/linux` repo should call `repository_dispatch` on `v9fs/test` when branches change -(see the header comment in `linux-kernel-publish.yml` for an example payload). - -### Kernel images as packages (GHCR) - -Published kernels are also pushed to GitHub Packages (GHCR) as an OCI artifact: - -- **Package**: `ghcr.io/v9fs/v9fs-test-kernel` -- **Tags**: - - `linux-` (immutable) - - The **release tag** you passed (e.g. `kernel-main`, `kernel-nightly`, `kernel-6.12.0`) - -```bash -oras pull ghcr.io/v9fs/v9fs-test-kernel:linux- -o . -tar -tzf kernel-image.tar.gz | head -``` +| Release tag | Meaning | +| --- | --- | +| `kernel-latest` | Floating tip (newest published v6+ tag Image) | +| `kernel-v*` | Image for that kernel tag | +| `kernel-main` | `v9fs/linux` `upstream` (when published) | -### Kernel images as direct downloads (GitHub Releases) +Example: `https://github.com/v9fs/test/releases/download/kernel-latest/Image` -The publish workflow uploads the **arm64** kernel `Image` as a stable release asset: +### Secrets -- **Rolling mainline**: `https://github.com/v9fs/test/releases/download/kernel-main/Image` -- **Rolling nightly**: `https://github.com/v9fs/test/releases/download/kernel-nightly/Image` -- **Versioned** (example): `https://github.com/v9fs/test/releases/download/kernel-6.12.0/Image` +- `V9FS_LINUX_SYNC_TOKEN` — Contents write on `v9fs/linux`, Actions + Contents on `v9fs/test` (sync, publish chaining, wiki, attach reports). -Log artifact names (avoid collisions when jobs run in parallel): +Do **not** add `.github` workflows to `v9fs/linux`. -- CI manual/push: `test-results-ci`, `test-results-latency` -- Nightly: `test-results-regression`, `test-results-latency` +## Repo hygiene +- Active work: `main` (via PRs). Keep `CHANGES.md` and `TODO.md` updated. +- Do not commit `logs/`, `kernel/`, `tmp/`, generated initrds. +- Guest-direct only. SSH/`cpu` helpers under `old/rework-take-1/` are unsupported. diff --git a/TODO.md b/TODO.md index 44bf369..5e502f1 100644 --- a/TODO.md +++ b/TODO.md @@ -1,14 +1,12 @@ ## TODO -- Extend smoke test into a small suite (create/rename/unlink, fsync, directory traversal, large file IO). -- Add benchmark stages (fsx, postmark, dbench) to guest-direct CI. -- Add a diod regression suite stage (guest-direct) to exercise the kernel v9fs client. -- Decide whether to adopt a u-root/u-root+cpu initramfs for richer tooling distribution. -- Configure repo/org secret `V9FS_LINUX_SYNC_TOKEN` (Contents write on `v9fs/linux`, Actions + Contents on `v9fs/test` for publish chaining and wiki/`results.json` attach). -- After Image publish, harness `workflow_run` builds tip report + wiki summary table (`Regression-Dashboard`). -- Retarget “linux pushes trigger test” work (#6) to sync/orchestrate from this repo. - -## TODO - -- Decide whether to keep `ubuntu-latest` runners or switch back to self-hosted for KVM acceleration. -- Remove or clearly fence legacy SSH-based helpers (`test.bash`, `scripts/cpu`) if they are no longer part of the supported workflow. +- Configure/keep repo secret `V9FS_LINUX_SYNC_TOKEN` (Contents write on `v9fs/linux`, Actions + Contents on `v9fs/test` for publish chaining and wiki/`results.json` attach). +- Nightly/mainline/for-next/fixes Images and harness runs (#5, #6). +- QEMU serial / dmesg BUG+WARN scanning (#4). +- Legacy 9p2000 / 9p2000.u protocol cells (#10). +- pjdfstest / fstest (#7). +- Kconfig / cache-mode sweep (#8). +- Memory/ops metrics over time (#11). +- Dashboard history + optional bisection (#2). +- Shrink diod XFAIL: `t0011-v9fs-allsquash`, `t0013-v9fs-acl`. +- u-root/cpu for richer guest tooling (optional). diff --git a/old/rework-take-1/.github/README.md b/old/rework-take-1/.github/README.md new file mode 100644 index 0000000..b5e9dff --- /dev/null +++ b/old/rework-take-1/.github/README.md @@ -0,0 +1,3 @@ +Take-1 GitHub Actions YAML used to live here (`demand.yml`, `nightly.yml`, `linux-kernel-publish.yml`). They are **not** active. + +Live workflows: repository-root `.github/workflows/` (`ci.yml`, `linux-kernel-publish.yml`, `sync-torvalds-linux.yml`). diff --git a/old/rework-take-1/.github/workflows/demand.yml b/old/rework-take-1/.github/workflows/demand.yml deleted file mode 100644 index 067b0d6..0000000 --- a/old/rework-take-1/.github/workflows/demand.yml +++ /dev/null @@ -1,166 +0,0 @@ -name: CI (push and manual) - -permissions: - contents: read - -on: - # Run tests on every push (all branches). Kernel builds are published separately - # (see `linux-kernel-publish.yml` + `repository_dispatch` from v9fs/linux). - push: - workflow_dispatch: - inputs: - kernel_release: - description: 'GitHub release tag that provides the arm64 `Image` asset (e.g. kernel-main)' - required: true - default: 'kernel-main' - type: string - resultstag: - description: 'how to tag results' - default: 'ci' - type: string - workflow_call: - inputs: - kernel_release: - description: 'GitHub release tag that provides the arm64 `Image` asset' - required: false - default: 'kernel-main' - type: string - resultstag: - description: 'Optional tag string written into latency logs' - required: false - default: '' - type: string - -jobs: - test: - runs-on: ubuntu-24.04-arm - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - KERNEL_RELEASE: ${{ inputs.kernel_release || 'kernel-main' }} - steps: - - name: Checkout test harness - uses: actions/checkout@v4 - - - name: Download published kernel Image - run: | - set -euo pipefail - mkdir -p kernel/.build/arch/arm64/boot - gh release download "${KERNEL_RELEASE}" -p Image -D kernel/.build/arch/arm64/boot --clobber - ls -la kernel/.build/arch/arm64/boot/Image - - - name: Build Docker environment - run: docker build -t v9fs-test-env:local . - - - name: Run CI tests (QEMU) - run: | - mkdir -p "$GITHUB_WORKSPACE/tmp" - docker run --rm --privileged \ - -e KERNELBUILD=/workspaces/kernel/.build \ - -v "$GITHUB_WORKSPACE:/home/v9fs-test/test" \ - -v "$GITHUB_WORKSPACE/kernel:/workspaces/kernel" \ - -v "$GITHUB_WORKSPACE/tmp:/workspaces/tmp" \ - -w /home/v9fs-test/test \ - v9fs-test-env:local \ - bash -lc "v9fs-run-tests short ci" - - - name: Dump logs on failure - if: failure() - run: | - set -euo pipefail - echo "==== logs tree ====" - (ls -R logs || true) - echo "==== qemu.log (tail) ====" - for f in logs/*/qemu.log; do - echo "---- $f ----" - tail -n 250 "$f" || true - done - echo "==== per-test logs (tail) ====" - for f in logs/*/*/*/*.log; do - echo "---- $f ----" - tail -n 80 "$f" || true - done - echo "==== guest exitcode markers ====" - for f in logs/*/guest.exitcode; do - echo "---- $f ----" - cat "$f" || true - done - - - name: Fix log permissions (for artifact upload) - if: always() - run: | - sudo chmod -R a+rX logs || true - - - name: Store Logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-results-ci - path: logs - retention-days: 7 - - latency: - runs-on: ubuntu-24.04-arm - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - KERNEL_RELEASE: ${{ inputs.kernel_release || 'kernel-main' }} - RESULTSTAG: ${{ inputs.resultstag || github.sha }} - steps: - - name: Checkout test harness - uses: actions/checkout@v4 - - - name: Download published kernel Image - run: | - set -euo pipefail - mkdir -p kernel/.build/arch/arm64/boot - gh release download "${KERNEL_RELEASE}" -p Image -D kernel/.build/arch/arm64/boot --clobber - ls -la kernel/.build/arch/arm64/boot/Image - - - name: Build Docker environment - run: docker build -t v9fs-test-env:local . - - - name: Run latency tests (QEMU) - run: | - mkdir -p "$GITHUB_WORKSPACE/tmp" - docker run --rm --privileged \ - -e KERNELBUILD=/workspaces/kernel/.build \ - -v "$GITHUB_WORKSPACE:/home/v9fs-test/test" \ - -v "$GITHUB_WORKSPACE/kernel:/workspaces/kernel" \ - -v "$GITHUB_WORKSPACE/tmp:/workspaces/tmp" \ - -w /home/v9fs-test/test \ - v9fs-test-env:local \ - bash -lc "v9fs-run-tests short latency && echo \"$RESULTSTAG ${KERNEL_RELEASE} v9fs/linux\" > /home/v9fs-test/test/logs/tag.txt" - - - name: Dump logs on failure - if: failure() - run: | - set -euo pipefail - echo "==== logs tree ====" - (ls -R logs || true) - echo "==== qemu.log (tail) ====" - for f in logs/*/qemu.log; do - echo "---- $f ----" - tail -n 250 "$f" || true - done - echo "==== per-test logs (tail) ====" - for f in logs/*/*/*/*.log; do - echo "---- $f ----" - tail -n 80 "$f" || true - done - echo "==== guest exitcode markers ====" - for f in logs/*/guest.exitcode; do - echo "---- $f ----" - cat "$f" || true - done - - - name: Fix log permissions (for artifact upload) - if: always() - run: | - sudo chmod -R a+rX logs || true - - - name: Store Logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-results-latency - path: logs - retention-days: 7 diff --git a/old/rework-take-1/.github/workflows/linux-kernel-publish.yml b/old/rework-take-1/.github/workflows/linux-kernel-publish.yml deleted file mode 100644 index d53cbbd..0000000 --- a/old/rework-take-1/.github/workflows/linux-kernel-publish.yml +++ /dev/null @@ -1,153 +0,0 @@ -# Publish an arm64 `Image` built from v9fs/linux to this repo's GitHub Releases (+ GHCR). -# -# This repo cannot subscribe to pushes on another repo. Use one of: -# - `repository_dispatch` from v9fs/linux (recommended), or -# - `workflow_dispatch` here for manual / automation. -# -# Example repository_dispatch (from v9fs/linux CI or a PAT with repo scope on v9fs/test): -# event_type: publish-kernel-image -# client_payload: -# linux_repository: v9fs/linux -# linux_ref: main -# release_tag: kernel-main -# release_title: kernel-main # optional - -name: Publish Linux kernel (arm64 Image) - -on: - repository_dispatch: - types: [publish-kernel-image] - workflow_dispatch: - inputs: - linux_repository: - description: 'Kernel GitHub repository (owner/name)' - required: true - default: 'v9fs/linux' - type: string - linux_ref: - description: 'Git ref to build (branch, tag, or SHA)' - required: true - default: 'main' - type: string - release_tag: - description: 'Release tag to publish/update (e.g. kernel-main, kernel-nightly, kernel-6.12.0)' - required: true - default: 'kernel-main' - type: string - release_title: - description: 'Optional GitHub release title (defaults to release_tag)' - required: false - default: '' - type: string - -permissions: - contents: write - packages: write - -jobs: - publish: - runs-on: ubuntu-24.04-arm - env: - GHCR_REPO: ghcr.io/${{ github.repository_owner }}/v9fs-test-kernel - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Checkout test harness (Dockerfile + scripts) - uses: actions/checkout@v4 - - - name: Resolve parameters - id: params - run: | - set -euo pipefail - if [ "${GITHUB_EVENT_NAME}" = "repository_dispatch" ]; then - python3 -c "import json,os; ev=json.load(open(os.environ['GITHUB_EVENT_PATH'])); p=ev.get('client_payload') or {}; o=open(os.environ['GITHUB_OUTPUT'],'a',encoding='utf-8'); \ - o.write('linux_repository=%s\n'%(p.get('linux_repository') or 'v9fs/linux')); \ - o.write('linux_ref=%s\n'%(p.get('linux_ref') or 'main')); \ - o.write('release_tag=%s\n'%(p.get('release_tag') or 'kernel-main')); \ - o.write('release_title=%s\n'%(p.get('release_title') or p.get('release_tag') or 'kernel-main'))" - else - title="${{ inputs.release_title }}" - if [ -z "${title}" ]; then title="${{ inputs.release_tag }}"; fi - { - echo "linux_repository=${{ inputs.linux_repository }}" - echo "linux_ref=${{ inputs.linux_ref }}" - echo "release_tag=${{ inputs.release_tag }}" - echo "release_title=${title}" - } >>"$GITHUB_OUTPUT" - fi - - - name: Checkout kernel under build - uses: actions/checkout@v4 - with: - repository: ${{ steps.params.outputs.linux_repository }} - ref: ${{ steps.params.outputs.linux_ref }} - path: linux - - - name: Install ORAS - uses: oras-project/setup-oras@v1 - - - name: Determine kernel source SHA - id: kernelsha - run: | - set -euo pipefail - sha="$(git -C linux rev-parse HEAD)" - echo "sha=$sha" >>"$GITHUB_OUTPUT" - echo "KERNEL_SHA=$sha" >>"$GITHUB_ENV" - echo "Kernel SHA: $sha" - - - name: Build Docker environment - run: docker build -t v9fs-test-env:local . - - - name: Build kernel (QEMU guest kernel image) - run: | - mkdir -p "$GITHUB_WORKSPACE/tmp" "$GITHUB_WORKSPACE/kernel" - docker run --rm --privileged \ - -v "$GITHUB_WORKSPACE:/home/v9fs-test/test" \ - -v "$GITHUB_WORKSPACE/linux:/workspaces/linux" \ - -v "$GITHUB_WORKSPACE/kernel:/workspaces/kernel" \ - -v "$GITHUB_WORKSPACE/tmp:/workspaces/tmp" \ - -w /home/v9fs-test/test \ - v9fs-test-env:local \ - bash -lc "v9fs-build-kernel && v9fs-export-kernel /workspaces/linux /workspaces/linux/.build /workspaces/kernel" - - - name: Publish arm64 Image as release asset - env: - TAG: ${{ steps.params.outputs.release_tag }} - TITLE: ${{ steps.params.outputs.release_title }} - run: | - set -euo pipefail - img="kernel/.build/arch/arm64/boot/Image" - if [ ! -f "$img" ]; then - echo "ERROR: missing $img" - find kernel/.build -maxdepth 6 -type f | sed 's|^| |' - exit 2 - fi - - gh release view "$TAG" >/dev/null 2>&1 || \ - gh release create "$TAG" --title "$TITLE" --notes "Automated arm64 kernel Image from ${GITHUB_REPOSITORY}@${GITHUB_SHA} (linux ${KERNEL_SHA})." --prerelease - cp -f "$img" Image - gh release upload "$TAG" Image --clobber - - - name: Package kernel image(s) for GHCR - run: | - set -euo pipefail - mkdir -p dist - mapfile -t files < <( - find kernel/.build/arch -type f \( -name '*Image' -o -name 'bzImage' \) -print | sort - ) - if [ "${#files[@]}" -eq 0 ]; then - echo "ERROR: no kernel images found under kernel/.build/arch" - find kernel -maxdepth 5 -type f | sed 's|^| |' - exit 2 - fi - tar -czf "dist/kernel-image.tar.gz" "${files[@]}" - - - name: Publish kernel image package to GHCR (OCI artifact) - env: - ORAS_EXPERIMENTAL_OCI_ARTIFACT: "1" - run: | - set -euo pipefail - echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u "${{ github.actor }}" --password-stdin - - oras push "${GHCR_REPO}:linux-${KERNEL_SHA}" \ - "dist/kernel-image.tar.gz:application/gzip" - oras tag "${GHCR_REPO}:linux-${KERNEL_SHA}" "${{ steps.params.outputs.release_tag }}" diff --git a/old/rework-take-1/.github/workflows/nightly.yml b/old/rework-take-1/.github/workflows/nightly.yml deleted file mode 100644 index 24d8aee..0000000 --- a/old/rework-take-1/.github/workflows/nightly.yml +++ /dev/null @@ -1,148 +0,0 @@ -name: Mainline - -permissions: - contents: read - -on: - schedule: - - cron: '0 0 * * *' # Run every day at midnight - workflow_dispatch: - inputs: - kernel_release: - description: 'GitHub release tag that provides the arm64 `Image` asset (default: kernel-nightly)' - required: true - default: 'kernel-nightly' - type: string - -jobs: - test: - runs-on: ubuntu-24.04-arm - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - KERNEL_RELEASE: ${{ inputs.kernel_release || 'kernel-nightly' }} - steps: - - name: Checkout test harness - uses: actions/checkout@v4 - - - name: Download published kernel Image - run: | - set -euo pipefail - mkdir -p kernel/.build/arch/arm64/boot - gh release download "${KERNEL_RELEASE}" -p Image -D kernel/.build/arch/arm64/boot --clobber - ls -la kernel/.build/arch/arm64/boot/Image - - - name: Build Docker environment - run: docker build -t v9fs-test-env:local . - - - name: Run regression tests (QEMU) - run: | - mkdir -p "$GITHUB_WORKSPACE/tmp" - docker run --rm --privileged \ - -e KERNELBUILD=/workspaces/kernel/.build \ - -v "$GITHUB_WORKSPACE:/home/v9fs-test/test" \ - -v "$GITHUB_WORKSPACE/kernel:/workspaces/kernel" \ - -v "$GITHUB_WORKSPACE/tmp:/workspaces/tmp" \ - -w /home/v9fs-test/test \ - v9fs-test-env:local \ - bash -lc "v9fs-run-tests regress ci" - - - name: Dump logs on failure - if: failure() - run: | - set -euo pipefail - echo "==== logs tree ====" - (ls -R logs || true) - echo "==== qemu.log (tail) ====" - for f in logs/*/qemu.log; do - echo "---- $f ----" - tail -n 250 "$f" || true - done - echo "==== per-test logs (tail) ====" - for f in logs/*/*/*/*.log; do - echo "---- $f ----" - tail -n 80 "$f" || true - done - echo "==== guest exitcode markers ====" - for f in logs/*/guest.exitcode; do - echo "---- $f ----" - cat "$f" || true - done - - - name: Fix log permissions (for artifact upload) - if: always() - run: | - sudo chmod -R a+rX logs || true - - - name: Store Logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-results-regression - path: logs - retention-days: 7 - - latency: - runs-on: ubuntu-24.04-arm - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - KERNEL_RELEASE: ${{ inputs.kernel_release || 'kernel-nightly' }} - steps: - - name: Checkout test harness - uses: actions/checkout@v4 - - - name: Download published kernel Image - run: | - set -euo pipefail - mkdir -p kernel/.build/arch/arm64/boot - gh release download "${KERNEL_RELEASE}" -p Image -D kernel/.build/arch/arm64/boot --clobber - ls -la kernel/.build/arch/arm64/boot/Image - - - name: Build Docker environment - run: docker build -t v9fs-test-env:local . - - - name: Run latency tests (QEMU) - run: | - mkdir -p "$GITHUB_WORKSPACE/tmp" - docker run --rm --privileged \ - -e KERNELBUILD=/workspaces/kernel/.build \ - -v "$GITHUB_WORKSPACE:/home/v9fs-test/test" \ - -v "$GITHUB_WORKSPACE/kernel:/workspaces/kernel" \ - -v "$GITHUB_WORKSPACE/tmp:/workspaces/tmp" \ - -w /home/v9fs-test/test \ - v9fs-test-env:local \ - bash -lc "v9fs-run-tests short latency && echo \"Nightly ${KERNEL_RELEASE} v9fs/linux\" > /home/v9fs-test/test/logs/tag.txt" - - - name: Dump logs on failure - if: failure() - run: | - set -euo pipefail - echo "==== logs tree ====" - (ls -R logs || true) - echo "==== qemu.log (tail) ====" - for f in logs/*/qemu.log; do - echo "---- $f ----" - tail -n 250 "$f" || true - done - echo "==== per-test logs (tail) ====" - for f in logs/*/*/*/*.log; do - echo "---- $f ----" - tail -n 80 "$f" || true - done - echo "==== guest exitcode markers ====" - for f in logs/*/guest.exitcode; do - echo "---- $f ----" - cat "$f" || true - done - - - name: Fix log permissions (for artifact upload) - if: always() - run: | - sudo chmod -R a+rX logs || true - - - name: Store Logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-results-latency - path: logs - retention-days: 7 diff --git a/old/rework-take-1/README.md b/old/rework-take-1/README.md index 37eae0f..4a7a2e6 100644 --- a/old/rework-take-1/README.md +++ b/old/rework-take-1/README.md @@ -1,3 +1,9 @@ +# v9fs test harness (historical snapshot) + +This directory is tag `rework-take-1`. It is **not** used by CI. + +Active workflows live only at the repository root `.github/workflows/` (`ci.yml`, `linux-kernel-publish.yml`, `sync-torvalds-linux.yml`). The take-1 YAML that used to sit in `.github/workflows/` here (`demand.yml`, `nightly.yml`, …) has been removed so it cannot be mistaken for live Actions. + # v9fs test harness This repository contains **test code and scripts** for exercising the Linux **9p (v9fs)** filesystem. From 3e84a9a0a68db10643e1e3d01a017d4d8be6b6a8 Mon Sep 17 00:00:00 2001 From: Eric Van Hensbergen Date: Wed, 26 Aug 2026 10:46:43 -0500 Subject: [PATCH 2/4] docs: gitignore local .env for host-side GH_TOKEN Keep PAT out of git and document sourcing it for gh release download / act. Co-authored-by: Cursor --- .gitignore | 1 + AGENTS.md | 2 +- CHANGES.md | 1 + README.md | 8 ++++++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7013148..b781391 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ kernel/ tmp/ initrd.cpio qemu.pid +.env diff --git a/AGENTS.md b/AGENTS.md index 0d1431e..28989e3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ Tweak freely. - Do active work on `main` unless told otherwise. - Keep `README.md`, `CHANGES.md`, and `TODO.md` updated as changes land. -- Do not commit generated outputs (`logs/`, `kernel/`, `tmp/`, `initrd.cpio`, pid files). +- Do not commit generated outputs (`logs/`, `kernel/`, `tmp/`, `initrd.cpio`, pid files) or `.env` (local `GH_TOKEN`). ## Test philosophy - Prefer **guest-direct execution** (Option A): run tests **inside the QEMU guest**. diff --git a/CHANGES.md b/CHANGES.md index 493e1b3..2517171 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ ## Unreleased - Docs: README/TODO/AGENTS match live workflows (`ci.yml`, publish, sync); drop stale `demand.yml`/`nightly.yml` snapshot under `old/rework-take-1/` (#3). +- Ignore local `.env` (`GH_TOKEN` for host-side `gh` / `act`); do not pass it into the guest. - Instrument diod `t0010` first `access=` mount (stderr/dmesg/diod log), pin `version=9p2000.L`, pre-create export, `Defaults !requiretty`, and force a fresh patched build stamp so CI can triage residual non-root mount failures. - Fix non-root `ACCESS_SINGLE` mounts across diod sharness: `scripts/v9fs-mount-9p` + trash on `/tmp`; t0010 runasuser now expected PASS including root-negatives. - Run diod sharness as non-root user `v9fs` (so ACCESS_SINGLE / `--runas` negatives work); per-test `timeout` via automake `LOG_COMPILER` instead of one outer suite timeout. diff --git a/README.md b/README.md index 93f895a..524f60a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ Guest-direct: QEMU arm64 + virtio-9p export of the container root, initrd mounts ```bash docker pull ghcr.io/v9fs/docker:latest # Place arm64 Image at ./kernel/.build/arch/arm64/boot/Image -# (or: gh release download kernel-latest -p Image -D kernel/.build/arch/arm64/boot) +# or download with gh (optional gitignored .env with GH_TOKEN=...): +# set -a && source .env && set +a +# gh release download kernel-latest -p Image -D kernel/.build/arch/arm64/boot make docker-smoke ``` @@ -62,10 +64,12 @@ Example: `https://github.com/v9fs/test/releases/download/kernel-latest/Image` - `V9FS_LINUX_SYNC_TOKEN` — Contents write on `v9fs/linux`, Actions + Contents on `v9fs/test` (sync, publish chaining, wiki, attach reports). +Local host-side `gh` (release download, `act --secret-file .env`): put `GH_TOKEN=...` in a repo-root `.env` (gitignored). Do not pass that file into the QEMU/test container. + Do **not** add `.github` workflows to `v9fs/linux`. ## Repo hygiene - Active work: `main` (via PRs). Keep `CHANGES.md` and `TODO.md` updated. -- Do not commit `logs/`, `kernel/`, `tmp/`, generated initrds. +- Do not commit `logs/`, `kernel/`, `tmp/`, generated initrds, or `.env`. - Guest-direct only. SSH/`cpu` helpers under `old/rework-take-1/` are unsupported. From b9be4003fbaddf844de15aeecee455a5314252de Mon Sep 17 00:00:00 2001 From: Eric Van Hensbergen Date: Wed, 26 Aug 2026 10:47:17 -0500 Subject: [PATCH 3/4] docs: drop publish workflow comment so PAT without workflow scope can push The same trigger contract is already in README. Token cannot update .github/workflows without workflow scope. Co-authored-by: Cursor --- .github/workflows/linux-kernel-publish.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/linux-kernel-publish.yml b/.github/workflows/linux-kernel-publish.yml index f09f7bb..980b409 100644 --- a/.github/workflows/linux-kernel-publish.yml +++ b/.github/workflows/linux-kernel-publish.yml @@ -1,8 +1,3 @@ -# Lives in v9fs/test only (#15). Do not add a copy to v9fs/linux. -# -# Triggers: workflow_dispatch here, or `gh workflow run` from -# sync-torvalds-linux.yml. repository_dispatch (publish-kernel-image) is -# emergency/manual only — linux is mirror-only and must not fire it. name: Publish Linux kernel (arm64 Image) on: From 520d4da720c7f37bc0a455169a4b8ac3d780dd2c Mon Sep 17 00:00:00 2001 From: Eric Van Hensbergen Date: Wed, 26 Aug 2026 10:54:41 -0500 Subject: [PATCH 4/4] docs: record publish workflow trigger contract in-tree Comment on linux-kernel-publish.yml that it lives in v9fs/test only and must not be fired from the linux mirror (#15). Co-authored-by: Cursor --- .github/workflows/linux-kernel-publish.yml | 5 +++++ CHANGES.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux-kernel-publish.yml b/.github/workflows/linux-kernel-publish.yml index 980b409..f09f7bb 100644 --- a/.github/workflows/linux-kernel-publish.yml +++ b/.github/workflows/linux-kernel-publish.yml @@ -1,3 +1,8 @@ +# Lives in v9fs/test only (#15). Do not add a copy to v9fs/linux. +# +# Triggers: workflow_dispatch here, or `gh workflow run` from +# sync-torvalds-linux.yml. repository_dispatch (publish-kernel-image) is +# emergency/manual only — linux is mirror-only and must not fire it. name: Publish Linux kernel (arm64 Image) on: diff --git a/CHANGES.md b/CHANGES.md index 2517171..c9d30be 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ ## Unreleased -- Docs: README/TODO/AGENTS match live workflows (`ci.yml`, publish, sync); drop stale `demand.yml`/`nightly.yml` snapshot under `old/rework-take-1/` (#3). +- Docs: README/TODO/AGENTS match live workflows (`ci.yml`, publish, sync); drop stale `demand.yml`/`nightly.yml` snapshot under `old/rework-take-1/` (#3). Header comment on `linux-kernel-publish.yml` records the test-repo-only trigger contract. - Ignore local `.env` (`GH_TOKEN` for host-side `gh` / `act`); do not pass it into the guest. - Instrument diod `t0010` first `access=` mount (stderr/dmesg/diod log), pin `version=9p2000.L`, pre-create export, `Defaults !requiretty`, and force a fresh patched build stamp so CI can triage residual non-root mount failures. - Fix non-root `ACCESS_SINGLE` mounts across diod sharness: `scripts/v9fs-mount-9p` + trash on `/tmp`; t0010 runasuser now expected PASS including root-negatives.