Add tarball tests
This commit is contained in:
		
							parent
							
								
									da196ec68f
								
							
						
					
					
						commit
						bc51175dc0
					
				
					 3 changed files with 22 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -229,7 +229,7 @@ bool isUri(const string & s)
 | 
			
		|||
    size_t pos = s.find("://");
 | 
			
		||||
    if (pos == string::npos) return false;
 | 
			
		||||
    string scheme(s, 0, pos);
 | 
			
		||||
    return scheme == "http" || scheme == "https";
 | 
			
		||||
    return scheme == "http" || scheme == "https" || scheme == "file";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,7 @@ nix_tests = \
 | 
			
		|||
  binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \
 | 
			
		||||
  multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \
 | 
			
		||||
  binary-cache.sh nix-profile.sh repair.sh dump-db.sh case-hack.sh \
 | 
			
		||||
  check-reqs.sh pass-as-file.sh
 | 
			
		||||
  check-reqs.sh pass-as-file.sh tarball.sh
 | 
			
		||||
  # parallel.sh
 | 
			
		||||
 | 
			
		||||
install-tests += $(foreach x, $(nix_tests), tests/$(x))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										20
									
								
								tests/tarball.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								tests/tarball.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
source common.sh
 | 
			
		||||
 | 
			
		||||
clearStore
 | 
			
		||||
 | 
			
		||||
tarroot=$TEST_ROOT/tarball
 | 
			
		||||
rm -rf $tarroot
 | 
			
		||||
mkdir -p $tarroot
 | 
			
		||||
cp dependencies.nix $tarroot/default.nix
 | 
			
		||||
cp config.nix dependencies.builder*.sh $tarroot/
 | 
			
		||||
 | 
			
		||||
tarball=$TEST_ROOT/tarball.tar.xz
 | 
			
		||||
(cd $TEST_ROOT && tar c tarball) | xz > $tarball
 | 
			
		||||
 | 
			
		||||
nix-env -f file://$tarball -qa --out-path | grep -q dependencies
 | 
			
		||||
 | 
			
		||||
nix-build file://$tarball
 | 
			
		||||
 | 
			
		||||
nix-build '<foo>' -I foo=file://$tarball
 | 
			
		||||
 | 
			
		||||
nix-build -E "import (fetchTarball file://$tarball)"
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue