From 93d2590c35c6e302c52a4bfce23712a06ed732f2 Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Wed, 30 Aug 2017 12:06:45 -0700 Subject: [PATCH] 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 --- tests/test-sysroot.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-sysroot.js b/tests/test-sysroot.js index d7d3dab3..4da55d0f 100755 --- a/tests/test-sysroot.js +++ b/tests/test-sysroot.js @@ -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);