try to shed root privileges

We have root on CircleCI in the docker container.  We can't currently shed
them before we get inside the flake app because we can't run `nix build` as
non-root inside the nix container. :/

https://github.com/nix-community/docker-nixpkgs/issues/62
This commit is contained in:
Jean-Paul Calderone 2023-07-20 10:58:10 -04:00
parent 08e364bbab
commit 90e08314c2

View File

@ -193,7 +193,14 @@
writeScript "unit-tests"
''
export TAHOE_LAFS_HYPOTHESIS_PROFILE=ci
${makeTestEnv pyVersion}/bin/python -m twisted.trial "$@"
if [ $(id -u) = "0" ]; then
# The test suite assumes non-root permissions. Get rid
# of the root permissions we seem to have.
SUDO="sudo -u nobody"
else
SUDO=""
fi
$SUDO ${makeTestEnv pyVersion}/bin/python -m twisted.trial "$@"
'';
};
};