mirror of
https://github.com/NixOS/nix.git
synced 2024-11-21 22:32:26 +00:00
Add test case for NARs with duplicate directory entries
This test was made by @puckipedia.
This commit is contained in:
parent
495d32e1b8
commit
83d5b32803
BIN
tests/functional/duplicate.nar
Normal file
BIN
tests/functional/duplicate.nar
Normal file
Binary file not shown.
@ -90,7 +90,7 @@ nix_tests = \
|
||||
derivation-advanced-attributes.sh \
|
||||
import-derivation.sh \
|
||||
nix_path.sh \
|
||||
case-hack.sh \
|
||||
nars.sh \
|
||||
placeholders.sh \
|
||||
ssh-relay.sh \
|
||||
build.sh \
|
||||
|
@ -6,13 +6,14 @@ TODO_NixOS
|
||||
|
||||
clearStore
|
||||
|
||||
rm -rf "$TEST_ROOT/case"
|
||||
|
||||
opts=("--option" "use-case-hack" "true")
|
||||
# Check that NARs with duplicate directory entries are rejected.
|
||||
rm -rf "$TEST_ROOT/out"
|
||||
expectStderr 1 nix-store --restore "$TEST_ROOT/out" < duplicate.nar | grepQuiet "NAR directory is not sorted"
|
||||
|
||||
# Check whether restoring and dumping a NAR that contains case
|
||||
# collisions is round-tripping, even on a case-insensitive system.
|
||||
|
||||
rm -rf "$TEST_ROOT/case"
|
||||
opts=("--option" "use-case-hack" "true")
|
||||
nix-store "${opts[@]}" --restore "$TEST_ROOT/case" < case.nar
|
||||
nix-store "${opts[@]}" --dump "$TEST_ROOT/case" > "$TEST_ROOT/case.nar"
|
||||
cmp case.nar "$TEST_ROOT/case.nar"
|
Loading…
Reference in New Issue
Block a user