-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libstore: check additionalSandboxProfile
Make sure that `extraSandboxProfile` is set before we check whether it's empty or not (in the `sandbox=true` case). Also adds a test case for this. Co-Authored-By: Artemis Tosini <[email protected]>
- Loading branch information
Showing
4 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ destFile, seed }: | ||
|
||
with import ./config.nix; | ||
|
||
mkDerivation { | ||
name = "simple"; | ||
__sandboxProfile = '' | ||
# Allow writing any file in the filesystem | ||
(allow file*) | ||
''; | ||
inherit seed; | ||
buildCommand = '' | ||
( | ||
set -x | ||
touch ${destFile} | ||
touch $out | ||
) | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
source common.sh | ||
|
||
if [[ $(uname) != Darwin ]]; then skipTest "Need Darwin"; fi | ||
|
||
DEST_FILE="${TEST_ROOT}/foo" | ||
|
||
testSandboxProfile () ( | ||
set -e | ||
|
||
sandboxMode="$1" | ||
|
||
rm -f "${DEST_FILE}" | ||
nix-build --no-out-link ./extra-sandbox-profile.nix \ | ||
--option sandbox "$sandboxMode" \ | ||
--argstr seed "$RANDOM" \ | ||
--argstr destFile "${DEST_FILE}" | ||
|
||
ls -l "${DEST_FILE}" | ||
) | ||
|
||
testSandboxProfile "false" | ||
! testSandboxProfile "true" | ||
testSandboxProfile "relaxed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters