[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: Upload of our utilities to the main archive



On 2024-10-11 16:55, Christian Kastner wrote:
> There are three things that I'd appreciate feedback on before I proceed
> with an upload:
>   1. Scope
>   2. Naming/namespace
>   3. Interface of the autopkgtest helper

> 3. Interface of the autopkgtest helper
> ============

Here's a proposal for how this utility would look, in the form of its
--help message.

I suggest to look at the examples at the bottom first.

Best,
Christian


 $ rocm-autopkgtest-helper --help
usage: rocm-autopkgtest-helper [options] PATH [PATH ...]

Checks for availability of and access to an AMD GPU, runs each specified PATH,
and exits with the return code of the first non-zero-returning test, otherwise
zero. For any PATH that is a directory, runs all executables (chmod +x) in
that directory. If no (accessible) GPU was found, exits with 77 ("skipped").

Optionally exports some system data as autopkgtest artifacts.

Use this helper to skip tests on ci.debian.net (which doesn't support GPUs) but
have them run on ci.rocm.debian.net (which supports multiple AMD GPU
architectures). ci.rocm.debian.net automatically tests any package in the
Archive that depends on a package from the Debian ROCm Team.

To run these autopkgtests on your own system, you will need either a QEMU VM
image created by rocm-qemu-create(8), or a podman container image created by
rocm-podman-create(1).

Supported options:
  -h, --help
    Print this help
  --cd-tmp
    Change directory to AUTOPKGTEST_TMP before executing tests.

Supported environment variables (require needs-sudo):
  ROCM_AUTOPKGTEST_HELPER_WITH_DMESG
    If set, export dmesg before and after a test as an autopkgtest artifact.
    The testbed must have access to dmesg, so either the user needs to be
    privileged, or dmesg must not be restricted. Restriction can be lifted with
    sudo `sysctl kernel.dmesg_restrict=0.`
  ROCM_AUTOPKGTEST_HELPER_WITH_DRI[=PATH]
    If set, export firmware and possibly other GPU-specific information as an
    autopkgtest artifact. The testbed must have access to
    "/sys/kernel/debug/dri/", which requires privileges. Alternatively, one can
    bind-mount that directory to some user-readable path, eg:
    `mount --bind /sys/kernel/debug/dri /tmp/foo`, and pass that path as
    ROCM_AUTOPKGTEST_HELPER_WITH_DRI=/tmp/foo.

Examples for d/tests/control:
  Simple:
    Test-Command: rocm-autopkgtest-helper /path/to/test1 /path/to/test2
    Depends: @, rocm-autopkgtest-helper
    Restrictions: skippable, needs-sudo
    Architecture: amd64
 
  Write your own test runner/wrapper, have rocm-autopkgtest-helper call it:
    Test-Command: rocm-autopkgtest-helper debian/tests/my-runner
    Depends: @, rocm-autopkgtest-helper
    Restrictions: skippable, needs-sudo
    Architecture: amd64

  Note: you can actually leave out the needs-sudo restriction, but this
  disables certain features used on ci.rocm.debian.net. The Debian ROCm Team
  would appreciate it if you would specify needs-sudo.


Reply to: