diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c index 3f1fb6fa..fa4948c3 100644 --- a/src/libpriv/rpmostree-postprocess.c +++ b/src/libpriv/rpmostree-postprocess.c @@ -964,13 +964,18 @@ create_rootfs_from_yumroot_content (GFile *targetroot, g_print ("Adding tmpfiles-ostree-integration.conf\n"); { - gs_unref_object GFile *src_pkglibdir = g_file_new_for_path (PKGLIBDIR); + /* This is useful if we're running in an uninstalled configuration, e.g. + * during tests. */ + const char *pkglibdir_path + = g_getenv("RPMOSTREE_UNINSTALLED_PKGLIBDIR") ?: PKGLIBDIR; + + gs_unref_object GFile *src_pkglibdir = g_file_new_for_path (pkglibdir_path); gs_unref_object GFile *src_tmpfilesd = g_file_get_child (src_pkglibdir, "tmpfiles-ostree-integration.conf"); gs_unref_object GFile *target_tmpfilesd = g_file_resolve_relative_path (targetroot, "usr/lib/tmpfiles.d/tmpfiles-ostree-integration.conf"); gs_unref_object GFile *target_tmpfilesd_parent = g_file_get_parent (target_tmpfilesd); - + if (!gs_file_ensure_directory (target_tmpfilesd_parent, TRUE, cancellable, error)) goto out; diff --git a/tests/check/test-compose.sh b/tests/check/test-compose.sh index 14a263b9..e8e300ab 100755 --- a/tests/check/test-compose.sh +++ b/tests/check/test-compose.sh @@ -23,9 +23,11 @@ set -e check_root_test -# Workaround a debugging message "Missing callback called fullpath" that let the test fails. -# Remove once it doesn't happen anymore. -unset G_DEBUG +# Let's create a temporary pkglibdir and tell rpm-ostree to use that dir +# instead of the (non-existent) installed version +mkdir pkglibdir +ln -s ${topsrcdir}/src/app/tmpfiles-ostree-integration.conf pkglibdir/ +export RPMOSTREE_UNINSTALLED_PKGLIBDIR=$PWD/pkglibdir composedir=${commondir}/compose diff --git a/tests/utils/setup-session.sh b/tests/utils/setup-session.sh index ce07d776..8a9f7694 100755 --- a/tests/utils/setup-session.sh +++ b/tests/utils/setup-session.sh @@ -59,6 +59,7 @@ Name=org.projectatomic.rpmostree1 Exec=${exec_binary} --debug --sysroot=${test_tmpdir}/sysroot EOF +# Tell rpm-ostree to connect to the session bus instead of system export RPMOSTREE_USE_SESSION_BUS=1 # Don't flag deployments as immutable so that test harnesses can