testing individual autopkgtest tests

Martin Pitt mpitt at debian.org
Sun Jan 22 15:37:46 UTC 2017


Hello Paul,

Paul Gevers [2017-01-21 22:45 +0100]:
> Other question, have you ever thought about making python commands also
> work properly in the chroot during testing? Today I was bitten for the
> second time that if you do stuff with python commands instead of shell
> commands, you are not looking in the chroot, but on the host system.

I had to read this three times to (hopefully) understand this -- you are not
talking about running tests with the chroot runner, but about
"tests/autopkgtest ChrootRinner", right?

> E.g. I'd like to use "os.listdir('/etc/apt/sources.list.d') ..." instead
> of "self.check_exec(['sh', '-ec', 'ls /etc/apt/sources.list.d/*.list
> 2>/dev/null || true'], stdout=True).strip() ..."

What stops you from using

  os.listdir(os.path.join(self.chroot, 'etc/apt/sources.list.d'))

instead? You can of course also install python3 and its dependencies into the
chroot and call that using subprocess, but IMHO that's waaaay to complicated --
the charm of chroots is that they are just about as easy to access from the
outside than from the inside :-)

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20170122/8fcba8c4/attachment.sig>


More information about the autopkgtest-devel mailing list