Migrate ordinary I/O from confined file helpers
This commit is contained in:
@@ -181,19 +181,7 @@ func TestLoadPipelineCompositionRejectsUnsafeOrInvalidImports(t *testing.T) {
|
||||
if err := os.Mkdir(filepath.Join(dir, "directory.yml"), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}, want: "regular file"},
|
||||
{name: "symlink file", imports: []string{"link.yml"}, setup: func(t *testing.T, dir string) {
|
||||
writePipelineSource(t, dir, "target.yml", "workspace:\n root: /work\n")
|
||||
if err := os.Symlink("target.yml", filepath.Join(dir, "link.yml")); err != nil {
|
||||
t.Skipf("symlink unavailable: %v", err)
|
||||
}
|
||||
}, want: "not a regular file"},
|
||||
{name: "symlink directory", imports: []string{"linked/one.yml"}, setup: func(t *testing.T, dir string) {
|
||||
writePipelineSource(t, dir, "actual/one.yml", "workspace:\n root: /work\n")
|
||||
if err := os.Symlink("actual", filepath.Join(dir, "linked")); err != nil {
|
||||
t.Skipf("symlink unavailable: %v", err)
|
||||
}
|
||||
}, want: "not a regular directory"},
|
||||
}, want: "is a directory"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user