Skip to content

Commit 90ce15f

Browse files
authored
Merge pull request #1975 from evgenyz/fix-dbusmock
Fix D-Bus mock init/cleanup and fwupdsecattr probe initialization
2 parents 94cd797 + e314d7e commit 90ce15f

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/OVAL/probes/unix/linux/fwupdsecattr_probe.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,6 @@ int fwupdsecattr_probe_main(probe_ctx *ctx, void *arg)
292292
const char *hsi_result_str;
293293
uint64_t hsi_result = UINT64_MAX;
294294

295-
/* arg is NULL if regex compilation failed */
296-
if (arg == NULL) {
297-
return PROBE_EINIT;
298-
}
299-
300295
probe_in = probe_ctx_getobject(ctx);
301296
if (probe_in == NULL)
302297
return PROBE_ENOOBJ;

tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function test_probes_fwupdsecattr {
1818
[ -f $RF ] && rm -f $RF
1919

2020
init_dbus_mock $DBUS_MOCK_NAME
21-
$OSCAP oval eval --results $RF $DF 2>$stderr
21+
$OSCAP oval eval --results $RF $DF 2>$stderr || true
2222
clean_dbus_mock $DBUS_MOCK_NAME
2323

2424
if [ -f $RF ]; then

tests/test_common.sh.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ init_dbus_mock() {
368368
require_python_module "dbusmock" || return 255
369369
require "gdbus" || return 255
370370
printf "%s\n" "Initializing D-Bus mock from template: $1.py"
371-
python3 -m dbusmock --template "${srcdir}/$1.py" & disown
371+
python3 -m dbusmock --template "${srcdir}/$1.py" &
372372
# We have to replace system bus address because mock D-Bus
373373
# endpoint is created inside the user session
374374
export DBUS_SYSTEM_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS
@@ -380,6 +380,7 @@ clean_dbus_mock() {
380380
require "gdbus" || return 255
381381
printf "%s\n" "Shutting down D-Bus mock: $1"
382382
gdbus call --session -d "$1" -o / -m "$1.Exit" >/dev/null 2>&1 || true
383+
export DBUS_SYSTEM_BUS_ADDRESS=
383384
}
384385

385386
export -f assert_exists

0 commit comments

Comments
 (0)