Commit graph

930 commits

Author SHA1 Message Date
b385eb548a
only check first argument if we have one 2022-07-28 17:21:27 +02:00
d82afec5de
error out if stdout is a tty 2022-07-28 17:20:57 +02:00
117a1591c5
coverage.py: also output failed to stderr 2022-07-28 16:58:29 +02:00
3fcb125e3c
release 1.1.0 2022-07-26 22:29:09 +02:00
35dc676394
relax apt version regex to allow devuan apt versions like 2.5.0devuan1 2022-07-26 22:29:09 +02:00
0ae0adde26
document mmdebstrap hanging forever instead of ENOSPC in qemu as a comment 2022-07-26 22:29:09 +02:00
5e22e0bfc8
adjust message about file-mirror-automount hook 2022-07-26 22:29:09 +02:00
2021f6f7cd
README.md: add an example for running coverage.py 2022-07-26 22:29:09 +02:00
432170c68e
tests/check-against-debootstrap-dist: account for ordering differences in /var/lib/dpkg/triggers/File 2022-07-26 22:29:09 +02:00
15c7de4a3b
tests/check-against-debootstrap-dist: static group ids for crontab, systemd-journal, systemd-network and systemd-resolve 2022-07-26 22:29:09 +02:00
bf379f7e50
make_mirror.sh: bump DISK_SIZE to 10G because of gcc-defaults changing to gcc-12 2022-07-26 22:29:09 +02:00
d91a18a350
Adjust merged-/usr as it's done by debootstrap
- implements the same as debootstrap in
   https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/71
 - builds a temporary usr-is-merged package and upgrades to the real one
 - create merged-/usr chroots for unstable and testing (which will
   become Debian 12 Bookworm)
 - add a dedicated merged-/usr section to the manual page
2022-07-26 22:29:08 +02:00
7cec147b9e
tests/arm64-without-qemu-support: removing qemu-user disables binfmt support again since src:systemd 251.2-4
Closes: #1012163
2022-07-13 11:01:44 +02:00
009089ee8a
Mount a new instance of /dev/pts in the chroot
Before, we bind-mounted /dev/ptmx and /dev/pts from the host into the
chroot. This will make posix_openpt() fail with 'No such file or
directory'.  The ability to create pseudo terminals is important for apt
(which will throw a warning otherwise) or running script(1) or source
package testsuites like for src:util-linux. This functionality is
restored by mounting a new devpts instance to /dev/pts and making
/dev/ptmx a symlink to /dev/pts/ptmx. Mounting with ptmxmode=666 is
required such that also non-root users in unshare mode are able to
create pseudo terminals. See also:

https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
https://salsa.debian.org/debian/schroot/-/merge_requests/2
https://bugs.debian.org/856877
https://bugs.debian.org/817236
2022-06-14 08:26:48 +02:00
679f6cb2fc
coverage.py: allow passing tests by number 2022-06-13 16:01:39 +02:00
e9e9cec884
coverage.py: remove unused variable 2022-06-13 14:22:45 +02:00
b707676432
coverage.py: add --dist argument 2022-06-13 14:22:20 +02:00
b51b5b9e2a
coverage.py: set sensible defaults for SOURCE_DATE_EPOCH and CMD 2022-06-13 14:15:36 +02:00
793d8bb561
add forgotten test create-directory-dry-run 2022-06-13 14:00:44 +02:00
9ca613da0a
coverage.py: instead of printing the length of the skipped dictionary, print the sum of the length of lists of tests it references 2022-06-04 08:50:53 +02:00
51ad1426c3
hooks/file-mirror-automount/setup00.sh: instead of grepping for Repo-URI, only output REPO_URI 2022-06-04 08:49:44 +02:00
153d1fa969
tests/arm64-without-qemu-support: disable binfmt not by uninstalling but by writing to /proc/sys/fs/binfmt_misc/qemu-aarch64
Since 1:7.0+dfsg-3, binfmt.d from systemd is used as preferred
alternative to binfmt-support. And systemd does not provide an official
way to trigger binfmt (de)registration besides a reboot.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012163

Since we also have binfmt-support installed, systemd and binfmt-support
work in parallel so this test becomes flaky and sometimes removing the
qemu packages would have the desired effect and sometimes not.

To make the test deterministic again, we explicitly disable emulation by
writing a 0 to /proc/sys/fs/binfmt_misc/qemu-aarch64
2022-06-04 08:43:38 +02:00
c4962f9ab0
print value of SOURCE_DATE_EPOCH when creating and comparing debootstrap chroot to find bug only occurring when running autopkgtest around midnight 2022-06-04 08:42:23 +02:00
c37e5e6059
tests/custom-tmpdir: try running mmdebstrap in a TMPDIR with special shell characters in its path 2022-06-04 08:30:53 +02:00
28122a8b5c
coverage.py: instead of killing (and leaving temporary files undeleted) just send SIGTERM and wait 2022-06-04 08:26:39 +02:00
bf31355c62
run_qemu.sh: run timeout with --foreground so that qemu can receive sigint and quit immediately 2022-06-04 08:25:32 +02:00
b46149b851
release 1.0.1 2022-05-29 09:45:03 +02:00
7198ad50f6
coverage.py: actually count number of successes to print the correct number when ctrl+c was pressed 2022-05-29 09:43:41 +02:00
5ea760920d
coverage.py: fix typo successully -> successfully 2022-05-29 09:33:18 +02:00
86f616996d
coverage.py: strip off fractional seconds of time left 2022-05-29 09:32:58 +02:00
1b5d87c7cf
coverage.py: add --mode to only run tests with given mode 2022-05-29 09:32:02 +02:00
d96e85fddd
file-mirror-automount hook now supports modes that cannot mount (like fakechroot) by copying the repo into the chroot 2022-05-29 09:31:12 +02:00
c1c6297db7
move copying files into shared directory from coverage.sh to coverage.py 2022-05-29 09:28:34 +02:00
e4ef326b59
Only set up FAKECHROOT_CMD_SUBST for paths in PATH containing the original binary
If FAKECHROOT_CMD_SUBST sets up wrong substitutions, then binaries
cannot be found. For example if /usr/bin/chroot is listed in
FAKECHROOT_CMD_SUBST but /usr/sbin (the actual location of the chroot
binary) is not in PATH, the command fails
2022-05-29 08:11:43 +02:00
158956e213
release 1.0.0 2022-05-28 17:51:14 +02:00
4c3fddcd54
rewrite coverage.sh
- multiple individual shell scripts instead of one 3.5k line monster
 - tests driven by Python script allowing:
    * declarative test description in coverage.txt
    * collecting errors instead of aborting on first error
    * skipping tests
    * running specific tests
2022-05-28 17:49:05 +02:00
e71676e15c
use warning() instead of warn() when unmounting /sys and /proc fails 2022-05-28 17:47:51 +02:00
a238d90774
hooks/merged-usr: workaround not necessary anymore since debootstrap 1.0.125 2022-05-26 07:36:22 +02:00
790294ddca
hooks/merged-usr: acquire native architecture from apt-config
`dpkg --print-architecture` will be wrong when creating a foreign
architecture chroot and we cannot chroot() as the chroot directory is
still empty.
2022-05-26 07:36:22 +02:00
cffd47e087
drop /usr/sbin prefixes from executables 2022-05-26 07:36:22 +02:00
c6c9c27969
use DPkg::Path as default value for PATH 2022-05-26 07:36:22 +02:00
27926c75f9
unify checking if tools exist by running them with --version 2022-05-26 07:36:22 +02:00
0f9c6543c4
improve qemu-user
- rephrase info message to be less misleading
 - do not require qemu-$arch-static binary
 - check if /proc/sys/fs/binfmt_misc/qemu-$arch exists before reading it
2022-05-26 07:36:22 +02:00
b99f1d53d5
add file-mirror-automount hook-dir 2022-05-26 07:36:21 +02:00
cc3150ef04
Rework download stage to allow file:// mirrors
- factor out package downloading function
 - replace -oApt::Get::Download-Only=true by -oDebug::pkgDpkgPm=1
 - remove guessing of package names in /var/cache/apt/archives/
 - drop edsp parsing with proxysolver/mmdebstrap-dump-solution to obtain
   downloaded filenames in favour of -oDpkg::Pre-Install-Pkgs::=cat
 - /var/cache/apt/archives/ is now allowed to contain packages
 - drop --skip=download/empty
 - file:// mirrors are now supported if their path is available inside
   the chroot
2022-05-26 07:36:21 +02:00
c8835a6149
coverage.sh: make sure archives we copied into /var/cache/apt/archives are not deleted 2022-05-24 04:16:11 +02:00
dc8b09ed50
fix pod formatting typo 2022-05-24 04:15:25 +02:00
21b23ebb9f
set MMDEBSTRAP_VERBOSITY in hooks 2022-05-24 04:14:08 +02:00
0664792cd5
manually push option arguments to array instead of using s@
By mixing s@ for --$foo-hook options and manual pushing in --hook-dir,
it can happen that options get lost. Consider the following test:

use Getopt::Long;
my $arr = [];
GetOptions(
    'A=s@' => \$arr,
    'B=s' => sub { push @{$arr}, $_[1]; }
);
foreach my $hook (@{$arr}) { print "hook: $hook\n"; }

This works fine:

    perl test.pl --A=a1 --B=b1 --A=a2 --B=b2
    hook: a1
    hook: b1
    hook: a2
    hook: b2

This misses b1:

    perl test.pl --B=b1 --A=a2 --B=b2
    hook: a2
    hook: b2
2022-05-24 04:09:41 +02:00
26af846d0a
fix that cached debs were not returned if there was nothing to download 2022-05-23 23:30:29 +02:00