Skip to content

Commit

Permalink
Test the inclusion of transitive symlinks in the sandbox
Browse files Browse the repository at this point in the history
(cherry picked from commit cef677d)
  • Loading branch information
Théophane Hufschmitt authored and roberth committed Oct 14, 2024
1 parent 67d369a commit 1047383
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/functional/linux-sandbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ testCert () {
nocert=$TEST_ROOT/no-cert-file.pem
cert=$TEST_ROOT/some-cert-file.pem
symlinkcert=$TEST_ROOT/symlink-cert-file.pem
transitivesymlinkcert=$TEST_ROOT/transitive-symlink-cert-file.pem
symlinkDir=$TEST_ROOT/symlink-dir
echo -n "CERT_CONTENT" > $cert
ln -s $cert $symlinkcert
ln -s $symlinkcert $transitivesymlinkcert
ln -s $TEST_ROOT $symlinkDir

# No cert in sandbox when not a fixed-output derivation
Expand All @@ -78,8 +80,9 @@ testCert missing fixed-output "$nocert"
# Cert in sandbox when ssl-cert-file is set to an existing file
testCert present fixed-output "$cert"

# Cert in sandbox when ssl-cert-file is set to a symlink to an existing file
# Cert in sandbox when ssl-cert-file is set to a (potentially transitive) symlink to an existing file
testCert present fixed-output "$symlinkcert"
testCert present fixed-output "$transitivesymlinkcert"

# Symlinks should be added in the sandbox directly and not followed
nix-sandbox-build symlink-derivation.nix -A depends_on_symlink
Expand Down

0 comments on commit 1047383

Please sign in to comment.