about summary refs log blame commit diff
path: root/tests/fallback.sh
blob: b859d74ee70756290b92f6ffb76523e22058f430 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                  

                               
                                                                    
                                                           
                                                                                              
                                                        
                                                                    



                                                  
storeExpr=$($TOP/src/nix-instantiate/nix-instantiate fallback.nix)

echo "store expr is $storeExpr"

# Register a non-existant successor (and a nox-existant substitute).
suc=$NIX_STORE_DIR/deadbeafdeadbeafdeadbeafdeadbeaf-s.store
(echo $suc && echo $TOP/no-such-program && echo 0) | $TOP/src/nix-store/nix-store --substitute
$TOP/src/nix-store/nix-store --successor $storeExpr $suc

outPath=$($TOP/src/nix-store/nix-store -qnf --fallback "$storeExpr")

echo "output path is $outPath"

text=$(cat "$outPath"/hello)
if test "$text" != "Hello World!"; then exit 1; fi