We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14040ad commit bd4a9d3Copy full SHA for bd4a9d3
src/Tests/bash-testlib.sh
@@ -240,3 +240,26 @@ function execute()
240
241
return $job_rc
242
}
243
+
244
+function setup_test_dbus_policy() {
245
+ local config_file='/etc/dbus-1/system.d/test.org.usbguard1.conf'
246
+ if [[ -e "${config_file}" ]]; then
247
+ return
248
+ fi
249
250
+ sudo -n tee "${config_file}" <<EOF
251
+<?xml version="1.0" encoding="UTF-8"?>
252
+<!DOCTYPE busconfig PUBLIC
253
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
254
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
255
+<busconfig>
256
+ <policy user="root">
257
+ <allow own="org.usbguard1"/>
258
+ </policy>
259
+</busconfig>
260
+EOF
261
+ sudo -n dbus-send --system --dest=org.freedesktop.DBus --type=method_call \
262
+ /org org.freedesktop.DBus.ReloadConfig
263
+}
264
265
+setup_test_dbus_policy
0 commit comments