[rb-general] Making autopkgtest code more reusable for other projects

Ximin Luo infinity0 at debian.org
Thu Jul 20 16:38:00 CEST 2017


Dear autopkgtest-devel:

As you might know, at the Reproducible Builds project we're developing a tool called reprotest. Originally written last summer by a GSoC student, it duplicated a significant chunk of autopkgtest code for various reasons, including needing to slightly patch some of the functionality.

It's been on our TODO list to deduplicate this code. Yesterday I managed to remove the need for all our earlier patches, so that now reprotest works with cleanly-imported autopkgtest 4.4 code (with some automated tweaks to import statements).

In order to complete the deduplication, all we need is for the lib/*.py parts of autopkgtest to be exposed as a public python module. Actually only a few modules (adt_testbed, VirtSubproc, adtlog) are used by reprotest, but it's probably easier for autopkgtest to treat the whole thing as a unit.

Would you be happy to do that? If not, what are the issues around doing so?

Now for a second topic: one aim of reprotest was to be distro-independent. Santiago Torres has an initial series of patches for achieving this, which I've reviewed and it looks good. However, these are patches only to specific parts of the aforementioned lib/*.py files that reprotest uses. The patches do not try to extend this support to the parts of those files that reprotest does not run through, nor autopkgtest files that were not imported into reprotest.

Ideally, I think it would be good to import these patches into autopkgtest. Given the previous issues I just mentioned however, it might require some refactoring of the autopkgtest code, to split it into Debian-specific vs non-Debian-specific parts. I'd be happy to work on this, but I'd also like to hear what the autopkgtest team thinks of this first.

Specific details: At the moment, reprotest uses mostly platform-agnostic parts of autopkgtest already. Only three things are Debian specific:

https://github.com/SantiagoTorres/reprotest/commit/dbda48694ffa6c79089f59786e2d547dbf4f9845#diff-24ae6133b5dc3ef13820be33f7af1637R42

OTOH, autopkgtest itself has a lot of Debian-specific stuff such as detecting and installing the dependencies of a package:

https://github.com/SantiagoTorres/reprotest/commit/06456d354ba5c0579cdf9ebd6e7621fac174033a#diff-c33f176eba5a51c08c3a3ecef4387474L479

reprotest is not actually using these at this time. It would make the effort of platform independence easier, if these things were pushed into a separate file in autopkgtest. Does this sort of approach sound reasonable? (That is, instead of deleting the code as Santiago did in the commit just linked, we could move it elsewhere in autopkgtest, which reprotest could then ignore or import as needed.)

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git


More information about the rb-general mailing list