mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 02:36:16 +02: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
3 changed files with 6 additions and 5 deletions
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 \
|
derivation-advanced-attributes.sh \
|
||||||
import-derivation.sh \
|
import-derivation.sh \
|
||||||
nix_path.sh \
|
nix_path.sh \
|
||||||
case-hack.sh \
|
nars.sh \
|
||||||
placeholders.sh \
|
placeholders.sh \
|
||||||
ssh-relay.sh \
|
ssh-relay.sh \
|
||||||
build.sh \
|
build.sh \
|
||||||
|
|
|
@ -6,13 +6,14 @@ TODO_NixOS
|
||||||
|
|
||||||
clearStore
|
clearStore
|
||||||
|
|
||||||
rm -rf "$TEST_ROOT/case"
|
# Check that NARs with duplicate directory entries are rejected.
|
||||||
|
rm -rf "$TEST_ROOT/out"
|
||||||
opts=("--option" "use-case-hack" "true")
|
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
|
# Check whether restoring and dumping a NAR that contains case
|
||||||
# collisions is round-tripping, even on a case-insensitive system.
|
# 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[@]}" --restore "$TEST_ROOT/case" < case.nar
|
||||||
nix-store "${opts[@]}" --dump "$TEST_ROOT/case" > "$TEST_ROOT/case.nar"
|
nix-store "${opts[@]}" --dump "$TEST_ROOT/case" > "$TEST_ROOT/case.nar"
|
||||||
cmp case.nar "$TEST_ROOT/case.nar"
|
cmp case.nar "$TEST_ROOT/case.nar"
|
Loading…
Reference in a new issue