tests/virtualbox: Start systemwide DBus in guests.

We want to check whether DBus functionality is working, so let's make
sure it is running in our mini-initrd.

DBus unfortunately requires to have users properly set up and another
configuration file other than in ${dbus.daemon}/etc/dbus-1/system.conf,
so we do provide that as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-09-15 14:14:44 +02:00
parent 89b6831ffd
commit 7707c7df7f
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -8,6 +8,19 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
#!${pkgs.stdenv.shell} -xe #!${pkgs.stdenv.shell} -xe
export PATH="${pkgs.coreutils}/bin:${pkgs.utillinux}/bin" export PATH="${pkgs.coreutils}/bin:${pkgs.utillinux}/bin"
mkdir -p /etc/dbus-1 /var/run/dbus
cat > /etc/passwd <<EOF
root:x:0:0::/root:/bin/false
messagebus:x:1:1::/var/run/dbus:/bin/false
EOF
cat > /etc/group <<EOF
root:x:0:
messagebus:x:1:
EOF
cp -v "${pkgs.dbus.daemon}/etc/dbus-1/system.conf" \
/etc/dbus-1/system.conf
"${pkgs.dbus.daemon}/bin/dbus-daemon" --fork --system
${pkgs.linuxPackages.virtualboxGuestAdditions}/bin/VBoxService ${pkgs.linuxPackages.virtualboxGuestAdditions}/bin/VBoxService
${(attrs.vmScript or (const "")) pkgs} ${(attrs.vmScript or (const "")) pkgs}