autopkgtest触ってみた(らしい)

Sun, Jun 28, 2015 in debian

Perlパッケージのautopkgtestについてはサイトに記述がある。

Testsuite: autopkgtest-pkg-perl

をdebian/controlファイルに指定するだけで、debian/test以下で色々しなくても、/usr/share/pkg-perl-autopkgtest/*.d にあるテストを実行するそうな。このファイルはpkg-perl-autopkgtestパッケージにある(名前とテストスイートが一致してない…)

実施されるテストは

  • smoke
  • use.t
  • syntax.t で、どうしてもエラーになるようであれば debian/tests/pkg-perl/SKIP に記載すれば良いようだ。

実施についてはschrootを使った記述があるのだけれども、後述するようにうまくいかない。。。

$ sudo apt-get install sbuild
$ sudo mkdir -p /srv/chroot/sid
$ sudo sbuild-createchroot sid /srv/chroot/sid http://debian-mirror.sakura.ne.jp/debian
[sid-amd64-sbuild]
type=directory
description=Debian sid/amd64 autobuilder
directory=/srv/chroot/sid
groups=root,sbuild
root-groups=root,sbuild
profile=sbuild

users=henrich
root-users=henrich
$ adt-run libdbix-class-optimisticlocking-perl_0.02-1_amd64.changes --- schroot sid-amd64-sbuild
adt-run [20:22:46]: version 3.14.3
adt-run [20:22:46]: command line: /usr/bin/adt-run libdbix-class-optimisticlocking-perl_0.02-1_amd64.changes --- schroot sid-amd64-sbuild
adt-virt-schroot requires ephemeral schroot sessions. Set a "union-type" or use a tarball schroot
adt-run [20:22:46]: ERROR: testbed failed: cannot send to testbed: ['BrokenPipeError: [Errno 32] Broken pipe\n']

最初はunion-typeの指定エラーがでたのでこれを追加

#union-type=aufs
#union-mount-options=br:/srv/chroot/test:/srv/chroot/sid=ro

とやってみたのだけど、

$ adt-run libdbix-class-optimisticlocking-perl_0.02-1_amd64.changes --- schroot sid-amd64-sbuild
adt-run [20:23:06]: version 3.14.3
adt-run [20:23:06]: command line: /usr/bin/adt-run libdbix-class-optimisticlocking-perl_0.02-1_amd64.changes --- schroot sid-amd64-sbuild
Traceback (most recent call last):
  File "/usr/bin/adt-virt-schroot", line 190, in <module>
    parse_args()
  File "/usr/bin/adt-virt-schroot", line 96, in parse_args
    (key, val) = entry.split("=", 2)
ValueError: too many values to unpack (expected 2)
adt-run [20:23:06]: ERROR: testbed failed: cannot send to testbed: ['BrokenPipeError: [Errno 32] Broken pipe\n']

うまくいかなかったので、pbuilderで作成したbase.tgzを使うことにしてみた。/etc/schroot/chroot.d/testはこんな感じ。

[sid-test]
type=file
description=test
file=/srv/chroot/test/base.tgz
groups=root,sbuild
root-groups=root,sbuild
profile=sbuild

users=henrich
root-users=henrich
$ adt-run libdbix-class-optimisticlocking-perl_0.02-1_amd64.changes --- schroot sid-test
adt-run [18:52:38]: version 3.14.3
adt-run [18:52:38]: command line: /usr/bin/adt-run libdbix-class-optimisticlocking-perl_0.02-1_amd64.changes --- schroot sid-test
adt-run [18:52:41]: testbed dpkg architecture: amd64
adt-run [18:52:41]: @@@@@@@@@@@@@@@@@@@@ source libdbix-class-optimisticlocking-perl_0.02-1.dsc
+ gpg --homedir=/home/henrich/.cache/autopkgtest --batch --no-random-seed-file --gen-key key-gen-params
gpg: keyring `/home/henrich/.cache/autopkgtest/secring.gpg' created
gpg: keyring `/home/henrich/.cache/autopkgtest/pubring.gpg' created
++++++++++++++++++++.+++++++++++++++.++++++++++.+++++.++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....++++++++++>++++++++++...............+++++

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 188 more bytes)
gpg: /home/henrich/.cache/autopkgtest/trustdb.gpg: trustdb created
gpg: key 0FB272FB marked as ultimately trusted

初回だけこれでひたすら待つ羽目になったが、これは動いた。