docs: document testing with containers
parent
de0c0872fc
commit
5a04bd2dd3
117
docs/HACKING.md
117
docs/HACKING.md
|
@ -225,64 +225,31 @@ init has the following hook points to inject scripts:
|
|||
|
||||
## Testsuite
|
||||
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
### Rootless in a container with podman
|
||||
|
||||
Fedora:
|
||||
|
||||
```
|
||||
dash \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
dmraid \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
scsi-target-utils \
|
||||
iscsi-initiator-utils \
|
||||
strace \
|
||||
syslinux \
|
||||
python-imgcreate \
|
||||
genisoimage \
|
||||
btrfs-progs \
|
||||
kmod-devel \
|
||||
gcc \
|
||||
bzip2 \
|
||||
xz \
|
||||
tar \
|
||||
wget \
|
||||
rpm-build \
|
||||
${NULL}
|
||||
```console
|
||||
$ cd <DRACUT_SOURCE>
|
||||
$ podman pull [CONTAINER]
|
||||
$ podman run --rm -it \
|
||||
--cap-add=SYS_PTRACE --user 0 \
|
||||
-v /dev:/dev -v ./:/dracut:z \
|
||||
[CONTAINER] \
|
||||
bash -l
|
||||
# cd /dracut
|
||||
# ./configure
|
||||
# make -j $(getconf _NPROCESSORS_ONLN)
|
||||
# cd test
|
||||
# make V=1 SKIP="16 60 61" clean check
|
||||
```
|
||||
|
||||
Arch Linux:
|
||||
with `[CONTAINER]` being one of the
|
||||
[github `dracutdevs` containers](https://github.com/orgs/dracutdevs/packages),
|
||||
e.g. `ghcr.io/dracutdevs/fedora:latest`.
|
||||
|
||||
```
|
||||
linux \
|
||||
dash \
|
||||
strace \
|
||||
gcc \
|
||||
dhclient \
|
||||
asciidoc \
|
||||
make \
|
||||
dracut \
|
||||
qemu \
|
||||
jack \
|
||||
btrfs-progs \
|
||||
mdadm \
|
||||
dmraid \
|
||||
nfs-utils \
|
||||
nfsidmap \
|
||||
lvm2 \
|
||||
nbd \
|
||||
dhcp \
|
||||
networkmanager \
|
||||
multipath-tools \
|
||||
${NULL}
|
||||
```
|
||||
### On bare metal
|
||||
|
||||
### How to run the testsuite on bare metal:
|
||||
For the testsuite to pass, you will have to install at least the software packages
|
||||
mentioned in the `test/container` Dockerfiles.
|
||||
|
||||
```
|
||||
$ sudo make clean check
|
||||
|
@ -304,48 +271,8 @@ debug a specific test case:
|
|||
$ cd TEST-01-BASIC
|
||||
$ sudo make clean setup run
|
||||
```
|
||||
... change some kernel parameters ...
|
||||
... change some kernel parameters in `test.sh` ...
|
||||
```
|
||||
$ sudo make run
|
||||
```
|
||||
to run the test without doing the setup
|
||||
|
||||
### Rootless in a container with podman
|
||||
|
||||
```console
|
||||
podman run -it \
|
||||
--cap-add=SYS_PTRACE --user 0 \
|
||||
-v /dev:/dev -v ./:/dracut \
|
||||
[CONTAINER] \
|
||||
bash
|
||||
```
|
||||
|
||||
#### Fedora
|
||||
|
||||
```console
|
||||
$ podman run -it \
|
||||
--cap-add=SYS_PTRACE --user 0 \
|
||||
-v /dev:/dev -v ./:/dracut \
|
||||
quay.io/haraldh/dracut-fedora:34 bash
|
||||
# cd /dracut
|
||||
# make V=1 check
|
||||
# cd test/TEST-01*
|
||||
# make clean setup run
|
||||
# cd ../..
|
||||
# make clean
|
||||
```
|
||||
|
||||
#### Arch Linux
|
||||
```console
|
||||
$ podman run -it \
|
||||
--cap-add=SYS_PTRACE --user 0 \
|
||||
-v /dev:/dev -v ./:/dracut \
|
||||
archlinux bash
|
||||
# pacman -Sy linux dash strace gcc dhclient asciidoc make dracut \
|
||||
qemu jack btrfs-progs mdadm dmraid nfs-utils nfsidmap lvm2 nbd \
|
||||
dhcp networkmanager multipath-tools vi tcpdump \
|
||||
git shfmt shellcheck astyle which
|
||||
# cd /dracut
|
||||
# export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)
|
||||
# make V=1 TESTS="01 02 03 04 10 11 12 13 14 15 17 20 21 40 41 98" check
|
||||
```
|
||||
to run the test without doing the setup.
|
||||
|
|
Loading…
Reference in New Issue