add RPMOSTREE_UNINSTALLED_PKGLIBDIR

Since we now run everything uninstalled, we can't expect the tmpfiles
conf file to be installed. We add an env var that will allow us to tell
rpm-ostree to look elsewhere. This is then used in test-compose.sh.

Closes: #304
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2016-06-06 16:32:37 -04:00 committed by Atomic Bot
parent acd3c8ff41
commit 6b07755d68
3 changed files with 13 additions and 5 deletions

View File

@ -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;

View File

@ -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

View File

@ -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