ostree-sysroot: add debug option to help testing

If ostree is run in a test setup where it operates as root in a tmp
directory, it might cause issues to flag the deployments as immutable.
The test harness might simply be doing an `rm -rf` (effectively the case
for gnome-desktop-testing-runner), which will then fail.

We add a new debug option to the ostree_sysroot object using GLib's
GDebugKey functionality to allow our tests to communicate to ostree that
we don't want immutable deployments.
This commit is contained in:
Jonathan Lebon committed 2016-02-19 11:58:08 -05:00
1 parent 3a555114bc
commit eba7df0da9
4 files changed
+25 -3

No files matched your search

+7
View File
@@ -153,6 +153,13 @@ ostree_sysroot_class_init (OstreeSysrootClass *klass)
static void
ostree_sysroot_init (OstreeSysroot *self)
{
const GDebugKey keys[] = {
{ "mutable-deployments", OSTREE_SYSROOT_DEBUG_MUTABLE_DEPLOYMENTS },
};
self->debug_flags = g_parse_debug_string (g_getenv("OSTREE_SYSROOT_DEBUG"),
keys, G_N_ELEMENTS (keys));
self->sysroot_fd = -1;
self->lock = (GLnxLockFile)GLNX_LOCK_FILE_INIT;
}