mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Check the signatures when copying store paths around
Broken atm
This commit is contained in:
parent
3e6017f911
commit
54ced9072b
6 changed files with 53 additions and 2 deletions
39
tests/ca/signatures.sh
Normal file
39
tests/ca/signatures.sh
Normal file
|
@ -0,0 +1,39 @@
|
|||
source common.sh
|
||||
|
||||
# Globally enable the ca derivations experimental flag
|
||||
sed -i 's/experimental-features = .*/& ca-derivations ca-references/' "$NIX_CONF_DIR/nix.conf"
|
||||
|
||||
clearStore
|
||||
clearCache
|
||||
|
||||
nix-store --generate-binary-cache-key cache1.example.org $TEST_ROOT/sk1 $TEST_ROOT/pk1
|
||||
pk1=$(cat $TEST_ROOT/pk1)
|
||||
|
||||
export REMOTE_STORE_DIR="$TEST_ROOT/remote_store"
|
||||
export REMOTE_STORE="file://$REMOTE_STORE_DIR"
|
||||
|
||||
ensureCorrectlyCopied () {
|
||||
attrPath="$1"
|
||||
nix build --store "$REMOTE_STORE" --file ./content-addressed.nix "$attrPath"
|
||||
}
|
||||
|
||||
testOneCopy () {
|
||||
clearStore
|
||||
rm -rf "$REMOTE_STORE_DIR"
|
||||
|
||||
attrPath="$1"
|
||||
nix copy --to $REMOTE_STORE "$attrPath" --file ./content-addressed.nix \
|
||||
--secret-key-files "$TEST_ROOT/sk1"
|
||||
|
||||
ensureCorrectlyCopied "$attrPath"
|
||||
|
||||
# Ensure that we can copy back what we put in the store
|
||||
clearStore
|
||||
nix copy --from $REMOTE_STORE \
|
||||
--file ./content-addressed.nix "$attrPath" \
|
||||
--trusted-public-keys $pk1
|
||||
}
|
||||
|
||||
for attrPath in rootCA dependentCA transitivelyDependentCA dependentNonCA dependentFixedOutput; do
|
||||
testOneCopy "$attrPath"
|
||||
done
|
|
@ -41,8 +41,9 @@ nix_tests = \
|
|||
build.sh \
|
||||
compute-levels.sh \
|
||||
ca/build.sh \
|
||||
ca/nix-copy.sh \
|
||||
ca/substitute.sh
|
||||
ca/signatures.sh \
|
||||
ca/nix-copy.sh
|
||||
# parallel.sh
|
||||
|
||||
install-tests += $(foreach x, $(nix_tests), tests/$(x))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue