test/sandbox/tool: marker pathname from flag
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Test / Hakurei (push) Successful in 45s
				
			
		
			
				
	
				Test / Create distribution (push) Successful in 37s
				
			
		
			
				
	
				Test / Hakurei (race detector) (push) Successful in 45s
				
			
		
			
				
	
				Test / Hpkg (push) Successful in 45s
				
			
		
			
				
	
				Test / Sandbox (push) Successful in 1m26s
				
			
		
			
				
	
				Test / Sandbox (race detector) (push) Successful in 2m10s
				
			
		
			
				
	
				Test / Flake checks (push) Successful in 1m32s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Test / Hakurei (push) Successful in 45s
				
			Test / Create distribution (push) Successful in 37s
				
			Test / Hakurei (race detector) (push) Successful in 45s
				
			Test / Hpkg (push) Successful in 45s
				
			Test / Sandbox (push) Successful in 1m26s
				
			Test / Sandbox (race detector) (push) Successful in 2m10s
				
			Test / Flake checks (push) Successful in 1m32s
				
			Since this is going to be placed in a shared directory, it needs to be unique to the identity. Instead of trying to figure out identity from mountinfo, just have the test script pass hardcoded values. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
		
							parent
							
								
									83c4f8b767
								
							
						
					
					
						commit
						56aad8dc11
					
				| @ -16,11 +16,13 @@ import ( | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| var ( | var ( | ||||||
| 	flagTestCase string | 	flagMarkerPath string | ||||||
| 	flagBpfHash  string | 	flagTestCase   string | ||||||
|  | 	flagBpfHash    string | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func init() { | func init() { | ||||||
|  | 	flag.StringVar(&flagMarkerPath, "p", "/tmp/sandbox-ok", "Pathname of completion marker") | ||||||
| 	flag.StringVar(&flagTestCase, "t", "", "Nix store path to test case file") | 	flag.StringVar(&flagTestCase, "t", "", "Nix store path to test case file") | ||||||
| 	flag.StringVar(&flagBpfHash, "s", "", "String representation of expected bpf sha512 hash") | 	flag.StringVar(&flagBpfHash, "s", "", "String representation of expected bpf sha512 hash") | ||||||
| } | } | ||||||
| @ -37,10 +39,10 @@ func main() { | |||||||
| 		go func() { <-s; log.Println("exiting on signal (likely from verifier)"); os.Exit(0) }() | 		go func() { <-s; log.Println("exiting on signal (likely from verifier)"); os.Exit(0) }() | ||||||
| 
 | 
 | ||||||
| 		(&sandbox.T{FS: os.DirFS("/")}).MustCheckFile(flagTestCase) | 		(&sandbox.T{FS: os.DirFS("/")}).MustCheckFile(flagTestCase) | ||||||
| 		if _, err := os.Create("/tmp/sandbox-ok"); err != nil { | 		if _, err := os.Create(flagMarkerPath); err != nil { | ||||||
| 			log.Fatalf("cannot create success marker: %v", err) | 			log.Fatalf("cannot create success marker: %v", err) | ||||||
| 		} | 		} | ||||||
| 		log.Println("blocking for seccomp check") | 		log.Printf("blocking for seccomp check (%s)", flagMarkerPath) | ||||||
| 		select {} | 		select {} | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user