diff --git a/tests/overlay-local-store/inner.sh b/tests/overlay-local-store/inner.sh index 7ab587b87..c8d49eb19 100755 --- a/tests/overlay-local-store/inner.sh +++ b/tests/overlay-local-store/inner.sh @@ -14,6 +14,16 @@ storeA="$TEST_ROOT/store-a" storeBTop="$TEST_ROOT/store-b" storeB="local-overlay?root=$TEST_ROOT/merged-store&lower-store=$storeA&upper-layer=$storeBTop" +mkdir -p $TEST_ROOT/bad_test +badTestRoot=$TEST_ROOT/bad_test +storeBadRoot="local-overlay?root=$badTestRoot&lower-store=$storeA&upper-layer=$storeBTop" +storeBadLower="local-overlay?root=$TEST_ROOT/merged-store&lower-store=$badTestRoot&upper-layer=$storeBTop" +storeBadUpper="local-overlay?root=$TEST_ROOT/merged-store&lower-store=$storeA&upper-layer=$badTestRoot" + +declare -a storesBad=( + "$storeBadRoot" "$storeBadLower" "$storeBadUpper" +) + mkdir -p "$TEST_ROOT"/{store-a,store-b,merged-store/nix/store,workdir} # Mounting Overlay Store @@ -105,6 +115,11 @@ expect 1 stat $(toRealPath "$storeBTop/nix/store" "$path") path=$(nix-store --store "$storeB" --add dummy) +for i in "${storesBad[@]}"; do + echo $i + expectStderr 1 nix-store --store "$i" --add dummy | grepQuiet "overlay filesystem .* mounted incorrectly" +done + # lower store should have it from before stat $(toRealPath "$storeA/nix/store" "$path")