Test the inclusion of transitive symlinks in the sandbox

(cherry picked from commit cef677ddbc)
(cherry picked from commit e8e62c95dd)

# Conflicts:
#	tests/functional/linux-sandbox.sh
This commit is contained in:
Théophane Hufschmitt 2024-04-12 16:10:22 +02:00 committed by Mergify
parent 90e847698b
commit b6f329cd5c

View File

@ -62,16 +62,22 @@ nocert=$TEST_ROOT/no-cert-file.pem
cert=$TEST_ROOT/some-cert-file.pem cert=$TEST_ROOT/some-cert-file.pem
symlinkcert=$TEST_ROOT/symlink-cert-file.pem symlinkcert=$TEST_ROOT/symlink-cert-file.pem
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> e8e62c95d (Test the inclusion of transitive symlinks in the sandbox)
transitivesymlinkcert=$TEST_ROOT/transitive-symlink-cert-file.pem transitivesymlinkcert=$TEST_ROOT/transitive-symlink-cert-file.pem
symlinkDir=$TEST_ROOT/symlink-dir symlinkDir=$TEST_ROOT/symlink-dir
echo -n "CERT_CONTENT" > $cert echo -n "CERT_CONTENT" > $cert
ln -s $cert $symlinkcert ln -s $cert $symlinkcert
ln -s $symlinkcert $transitivesymlinkcert ln -s $symlinkcert $transitivesymlinkcert
<<<<<<< HEAD
======= =======
symlinkDir=$TEST_ROOT/symlink-dir symlinkDir=$TEST_ROOT/symlink-dir
echo -n "CERT_CONTENT" > $cert echo -n "CERT_CONTENT" > $cert
ln -s $cert $symlinkcert ln -s $cert $symlinkcert
>>>>>>> 1cc79f134 (Fix the access of symlinks to host files in the sandbox) >>>>>>> 1cc79f134 (Fix the access of symlinks to host files in the sandbox)
=======
>>>>>>> e8e62c95d (Test the inclusion of transitive symlinks in the sandbox)
ln -s $TEST_ROOT $symlinkDir ln -s $TEST_ROOT $symlinkDir
# No cert in sandbox when not a fixed-output derivation # No cert in sandbox when not a fixed-output derivation
@ -86,6 +92,7 @@ testCert missing fixed-output "$nocert"
# Cert in sandbox when ssl-cert-file is set to an existing file # Cert in sandbox when ssl-cert-file is set to an existing file
testCert present fixed-output "$cert" testCert present fixed-output "$cert"
<<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
# Cert in sandbox when ssl-cert-file is set to a (potentially transitive) 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 "$symlinkcert"
@ -94,6 +101,11 @@ testCert present fixed-output "$transitivesymlinkcert"
# 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 symlink to an existing file
testCert present fixed-output "$symlinkcert" testCert present fixed-output "$symlinkcert"
>>>>>>> 1cc79f134 (Fix the access of symlinks to host files in the sandbox) >>>>>>> 1cc79f134 (Fix the access of symlinks to host files in the sandbox)
=======
# 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"
>>>>>>> e8e62c95d (Test the inclusion of transitive symlinks in the sandbox)
# Symlinks should be added in the sandbox directly and not followed # Symlinks should be added in the sandbox directly and not followed
nix-sandbox-build symlink-derivation.nix -A depends_on_symlink nix-sandbox-build symlink-derivation.nix -A depends_on_symlink