container/dispatcher: check simple test errors via reflect
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Test / Create distribution (push) Successful in 34s
				
			
		
			
				
	
				Test / Sandbox (push) Successful in 2m11s
				
			
		
			
				
	
				Test / Hpkg (push) Successful in 3m40s
				
			
		
			
				
	
				Test / Sandbox (race detector) (push) Successful in 4m28s
				
			
		
			
				
	
				Test / Hakurei (race detector) (push) Successful in 5m13s
				
			
		
			
				
	
				Test / Hakurei (push) Successful in 2m17s
				
			
		
			
				
	
				Test / Flake checks (push) Successful in 1m31s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Test / Create distribution (push) Successful in 34s
				
			Test / Sandbox (push) Successful in 2m11s
				
			Test / Hpkg (push) Successful in 3m40s
				
			Test / Sandbox (race detector) (push) Successful in 4m28s
				
			Test / Hakurei (race detector) (push) Successful in 5m13s
				
			Test / Hakurei (push) Successful in 2m17s
				
			Test / Flake checks (push) Successful in 1m31s
				
			Again, avoids the errors package concealing unexpected behaviours. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
		
							parent
							
								
									50972096cd
								
							
						
					
					
						commit
						d7c7c69a13
					
				| @ -115,7 +115,7 @@ func checkSimple(t *testing.T, fname string, testCases []simpleTestCase) { | ||||
| 		t.Run(tc.name, func(t *testing.T) { | ||||
| 			defer handleExitStub() | ||||
| 			k := &kstub{t: t, want: tc.want, wg: new(sync.WaitGroup)} | ||||
| 			if err := tc.f(k); !errors.Is(err, tc.wantErr) { | ||||
| 			if err := tc.f(k); !reflect.DeepEqual(err, tc.wantErr) { | ||||
| 				t.Errorf("%s: error = %v, want %v", fname, err, tc.wantErr) | ||||
| 			} | ||||
| 			k.handleIncomplete(func(k *kstub) { | ||||
|  | ||||
| @ -90,7 +90,7 @@ func TestRemount(t *testing.T) { | ||||
| 		}, [][]kexpect{{ | ||||
| 			{"evalSymlinks", expectArgs{"/sysroot/nix"}, "/sysroot/nix", nil}, | ||||
| 			{"open", expectArgs{"/sysroot/nix", 0x280000, uint32(0)}, 0xdeadbeef, errUnique}, | ||||
| 		}}, errUnique}, | ||||
| 		}}, &os.PathError{Op: "open", Path: "/sysroot/nix", Err: errUnique}}, | ||||
| 
 | ||||
| 		{"readlink", func(k syscallDispatcher) error { | ||||
| 			return newProcPaths(k, hostPath).remount("/sysroot/nix", syscall.MS_REC|syscall.MS_RDONLY|syscall.MS_NODEV) | ||||
| @ -107,7 +107,7 @@ func TestRemount(t *testing.T) { | ||||
| 			{"open", expectArgs{"/sysroot/nix", 0x280000, uint32(0)}, 0xdeadbeef, nil}, | ||||
| 			{"readlink", expectArgs{"/host/proc/self/fd/3735928559"}, "/sysroot/nix", nil}, | ||||
| 			{"close", expectArgs{0xdeadbeef}, nil, errUnique}, | ||||
| 		}}, errUnique}, | ||||
| 		}}, &os.PathError{Op: "close", Path: "/sysroot/nix", Err: errUnique}}, | ||||
| 
 | ||||
| 		{"mountinfo no match", func(k syscallDispatcher) error { | ||||
| 			return newProcPaths(k, hostPath).remount("/sysroot/nix", syscall.MS_REC|syscall.MS_RDONLY|syscall.MS_NODEV) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user