0

I am writing a test case that tests installation and removal of Debian packages. The debian package had a systemd process in it. During the start up the systemd takes care of starting the service and all the logs are forwarded to systemd.

Since the test cases are aimed to run in the integration/end-end test pipe line and also the test is aimed to run inside a container. From inside container we should be able to do apt install <my_service.deb>. But the issue being containers do not have systemd in them.

A quick internet search resulted and alternative to systemd inside docker like supervisor and other being volume mounting and starting container in privilage mode –privileged -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro.

How do people usually test debian installation and uninstallation of the debian package. Are there any alternative of having systemd inside a container ?

BhanuKiran
  • 2,631
  • 3
  • 20
  • 36
  • A virtual machine can be reasonably quickly set up and torn down, but it will run a full OS with all of the attendant system services. – David Maze Nov 08 '22 at 13:54
  • Debian developers uses https://wiki.debian.org/piuparts (it is also a package), which test installation and removing of packages (and check of leftover packages, double installs, etc.). Else you should use `dpkg` (the low level package manager). And no need of containers: a chroot is very often enough for such tests, in any case a container doesn't hurt (especially for system packages). – Giacomo Catenazzi Nov 09 '22 at 10:05

0 Answers0