testing individual autopkgtest tests
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
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 Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: not available