#!/bin/dash
# autopkgtest check: Build and run a program against glib, to verify that the
# headers and pkg-config file are installed correctly
# Author: Kun-Hung Tsai (蔡昆宏) <moonape1226@gmail.com>

set -e
echo "run: Test"
dbus_manual_start=0
if ! test -x "/var/run/dbus/system_bus_socket"; then
    systemctl start dbus.socket
    dbus_manual_start=1
fi
echo "allow all" | tee /etc/usbauth.conf
usbauth init
if test ${dbus_manual_start} = 1; then
    systemctl stop dbus.socket
fi
echo "run: Successful"
exit 0
