#1141092 sbuild: Please support specifying autopkgtest virt-server and virt-server options individually

#1141092#5
Date:
2026-06-29 16:08:28 UTC
From:
To:
Dear Maintainer,

I want to build Debian package and run their autopkgtests:

$ sbuild --run-autopkgtest

Sometimes the autopkgtest fail when using the unshare backend and I want
to easily run the same build but use a different autopkgtest
virt-server. Switching easily between the unshare, schroot, and qemu
backend per sbuild call would ease debugging and work around issues in
the test suites.

Setting --autopkgest-opts does not work, because those
options are added to the options configured in my config:

```
$ sbuild --run-autopkgtest --autopkgtest-opts="sbuild %r"
[...]
autopkgtest [17:53:33]: [...]; command line: /usr/bin/autopkgtest [...]/tzdata_2026b-1_amd64.changes -- unshare --release unstable --arch amd64 -b /dev/kvm /dev/kvm sbuild unstable
usage: autopkgtest-virt-unshare [-h] [-a ARCH] [-b OUTSIDE INSIDE] [-d]
                                [--bootstrapcmd BOOTSTRAPCMD] [-p PREFIX]
                                [-m MIRROR] [-r RELEASE] [-t TARBALL]
                                [-u UNPACK_DIR]
autopkgtest-virt-unshare: error: unrecognized arguments: sbuild unstable
```

Proposal
--------

Allow specifying and overriding the different parts of the autopkgtest
parameters. For the command line:

* --autopkgtest-opts for the options before --
* --autopkgtest-virt-server to specify the virt server
* --autopkgtest-virt-server-opt(s) for the virt server options

Then autopkgtest would be called via:

/usr/bin/autopkgtest $autopkgtest-opts -- $autopkgtest-virt-server $autopkgtest-virt-server-opt(s)

The sbuild config should have:

* autopkgtest_opts
* autopkgtest_virt_server
* per-virt-server options:
  - autopkgtest_unshare_virt_server_options
  - autopkgtest_schroot_virt_server_options
  - etc.

Then I could set this in my sbuild config:

```
autopkgtest_virt_server = 'unshare';
autopkgtest_unshare_virt_server_options = ['--release', '%r', '--arch', '%a', '-b', '/dev/kvm', '/dev/kvm'];
```

and select a different virt server without my unshare virt-server
options leaking in:

```
sbuild --run-autopkgtest --autopkgtest-virt-server=sbuild
```

What do you think? Do you have a different/better solution?