teemtee / tmt

Test Management Tool
MIT License
86 stars 130 forks source link

nspawn as provision method #725

Open jscotka opened 3 years ago

jscotka commented 3 years ago

as we've discussed on IRC, systemd-nspawn could be very nice solution for testing, it is something between virtualization and containerization with docker/podman. Implementation could be easy and could be beneficial, because it could provide still new sources because it can use system or remore repos.

Steps are

mkdir tempdir
dnf install --install-root=tempdir --repofrompath=url://toRHEL systemd ${required_packages}
systemd-nspawn --some_args tempdir

then via machinectl shell machine_name command run the commands on target machine e.g. run test there.

and have some option like tmt run -a provision -h nspawn without any other param it will use local repos, in case of multiple -r/--repo param used, use this repo, with some aliases I can imagine e.g. -r centos-8 will be traslated to url to centos-8

thrix commented 3 years ago

+1 this would be awesome to have

psss commented 3 years ago

Sounds interesting! I've quickly experimented with the example above and it worked nice.

dnf install --releasever 34 --nogpg --installroot=/tmp/spawn --repofrompath=f34,https://dl.fedoraproject.org/pub/fedora/linux/releases/34/Everything/x86_64/os/ systemd

What are the advantages of nspawn when compared to using podman?

jscotka commented 2 years ago

Sounds interesting! I've quickly experimented with the example above and it worked nice.

dnf install --releasever 34 --nogpg --installroot=/tmp/spawn --repofrompath=f34,https://dl.fedoraproject.org/pub/fedora/linux/releases/34/Everything/x86_64/os/ systemd

What are the advantages of nspawn when compared to using podman?

nspawn is closer to system and also running systemd by default is the main advantage, so from that perspective nspawn it is more than just container.