1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-06-05 14:26:15 +02:00
youki/hack/busctl.sh
Yashodhan Joshi df5ebb29ef Fix cross cotainers for tests running
Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
2024-04-27 15:14:45 +05:30

15 lines
838 B
Bash

#!/bin/sh
# This hack script is the dummy busctl command used when running tests with cross containers.
# The issue is that we cannot run systemd or dbus inside the test container without a lot
# of hacks. For one specific test - test_task_addition, we need to check that the task
# addition via systemd manager works. We mount the host dbus socket in the test container, so
# dbus calls work, but for the initial authentication, we use busctl which needs dbus and systemd
# to be present and running. So instead of doing all that, we simply run the container with the
# actual test running user's uid/gid and here we echo the only relevant line from busctl's
# output, using id to get the uid. This is a hack, but less complex than actually setting up
# and running the systemd+dbus inside the container.
echo "OwnerUID=$(id -u)"