All checks were successful
		
		
	
	Test / Create distribution (push) Successful in 25s
				
			Test / Hakurei (push) Successful in 44s
				
			Test / Sandbox (push) Successful in 41s
				
			Test / Hakurei (race detector) (push) Successful in 44s
				
			Test / Sandbox (race detector) (push) Successful in 41s
				
			Test / Hpkg (push) Successful in 41s
				
			Test / Flake checks (push) Successful in 1m24s
				
			Most tests already had no global state, however parallel was never enabled. This change enables it for all applicable tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
		
			
				
	
	
		
			65 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package hst_test
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"hakurei.app/container"
 | |
| 	"hakurei.app/hst"
 | |
| )
 | |
| 
 | |
| func TestFSLink(t *testing.T) {
 | |
| 	t.Parallel()
 | |
| 
 | |
| 	checkFs(t, []fsTestCase{
 | |
| 		{"nil", (*hst.FSLink)(nil), false, nil, nil, nil, "<invalid>"},
 | |
| 		{"zero", new(hst.FSLink), false, nil, nil, nil, "<invalid>"},
 | |
| 
 | |
| 		{"deref rel", &hst.FSLink{Target: m("/"), Linkname: ":3", Dereference: true},
 | |
| 			false, nil, nil, nil, "<invalid>"},
 | |
| 		{"deref differs", &hst.FSLink{
 | |
| 			Target:      m("/.hakurei/etc"),
 | |
| 			Linkname:    "/etc/static",
 | |
| 			Dereference: true,
 | |
| 		}, true, container.Ops{
 | |
| 			&container.SymlinkOp{
 | |
| 				Target:      m("/.hakurei/etc"),
 | |
| 				LinkName:    "/etc/static",
 | |
| 				Dereference: true,
 | |
| 			},
 | |
| 		}, m("/.hakurei/etc"), nil,
 | |
| 			"/.hakurei/etc -> */etc/static"},
 | |
| 		{"deref", &hst.FSLink{
 | |
| 			Target:      m("/run/current-system"),
 | |
| 			Linkname:    "/run/current-system",
 | |
| 			Dereference: true,
 | |
| 		}, true, container.Ops{
 | |
| 			&container.SymlinkOp{
 | |
| 				Target:      m("/run/current-system"),
 | |
| 				LinkName:    "/run/current-system",
 | |
| 				Dereference: true,
 | |
| 			},
 | |
| 		}, m("/run/current-system"), nil,
 | |
| 			"/run/current-system@"},
 | |
| 
 | |
| 		{"direct", &hst.FSLink{
 | |
| 			Target:   m("/etc/mtab"),
 | |
| 			Linkname: "/proc/mounts",
 | |
| 		}, true, container.Ops{
 | |
| 			&container.SymlinkOp{
 | |
| 				Target:   m("/etc/mtab"),
 | |
| 				LinkName: "/proc/mounts",
 | |
| 			},
 | |
| 		}, m("/etc/mtab"), nil, "/etc/mtab -> /proc/mounts"},
 | |
| 
 | |
| 		{"direct rel", &hst.FSLink{
 | |
| 			Target:   m("/etc/mtab"),
 | |
| 			Linkname: "../proc/mounts",
 | |
| 		}, true, container.Ops{
 | |
| 			&container.SymlinkOp{
 | |
| 				Target:   m("/etc/mtab"),
 | |
| 				LinkName: "../proc/mounts",
 | |
| 			},
 | |
| 		}, m("/etc/mtab"), nil, "/etc/mtab -> ../proc/mounts"},
 | |
| 	})
 | |
| }
 |