File: test.sh

package info (click to toggle)
dbus-broker 37-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,012 kB
  • sloc: ansic: 32,667; makefile: 146; sh: 56; python: 44
file content (25 lines) | stat: -rwxr-xr-x 781 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# vi: set sw=4 ts=4 et tw=110:

set -eux
set -o pipefail

TEST_USER="dfuzzer$SRANDOM"

at_exit() {
    userdel -rf "$TEST_USER"
}

trap at_exit EXIT
useradd "$TEST_USER"

dbus-broker --version
systemctl status --no-pager dbus-broker.service

# Run dfuzzer on the PID 1's D-Bus interface. Drop privileges while doing so, since here we're interested in
# the actual message broking instead of breaking systemd.
#
# org.freedesktop.systemd1 was picked here because its interface is very rich when it comes to function
# signatures. Also, it's fuzzed in upstream by dfuzzer as well, which should make the test less prone to fails
# due to issues on systemd's side.
setpriv --reuid="$TEST_USER" --init-group -- dfuzzer -v --buffer-limit=10240 --bus org.freedesktop.systemd1