tests: Make the deployment mutable in test-sysroot.js

We attempt to make deployments mutable in the test suite (as opposed to
immutable which is the default) to make it easier to chmod and clean up
the tmp files after each test. This is normally accomplished by setting
OSTREE_SYSROOT_DEBUG=mutable-deployments in libtest.sh, but that only
affects the environment variables for that bash instance, not the
process running gjs. So in test-sysroot.js OSTREE_SYSROOT_DEBUG wasn't
set when sysroot.deploy_tree() was called, which means the deployment
was made immutable which eventually causes the test to fail. This only
occurs when the test is run by the root user because for non-root users
_ostree_linuxfs_fd_alter_immutable_flag() would silently fail and the
deployment would be mutable.

This commit fixes this issue by setting the environment variable in
tests/test-sysroot.js.

Closes: #1122
Approved by: cgwalters
This commit is contained in:
Matthew Leeds 2017-08-30 12:06:45 -07:00 committed by Atomic Bot
parent 138c4d7aae
commit 93d2590c35

View File

@ -42,6 +42,8 @@ print('1..1')
libtestExec('setup_os_repository archive-z2 syslinux');
GLib.setenv("OSTREE_SYSROOT_DEBUG", "mutable-deployments", true);
let upstreamRepo = OSTree.Repo.new(Gio.File.new_for_path('testos-repo'));
upstreamRepo.open(null);