oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1//go:build linux
2
3package containment
4
5import (
6 "amadan.net/oficina/equipo/internal/runner/provider"
7 "context"
8 "os"
9 "path/filepath"
10 "testing"
11)
12
13func TestDirectIsolationExpectedHome(t *testing.T) {
14 m, l := egressFixture(t)
15 path := filepath.Join(l.Binding.Home, "equipo-read-0123456789abcdef0123456789abcdef")
16 if err := os.WriteFile(path, []byte("synthetic staged marker"), 0600); err != nil {
17 t.Fatal(err)
18 }
19 target, err := IsolationTarget("selected-home", path, "/home/runner/equipo-read-0123456789abcdef0123456789abcdef")
20 if err != nil {
21 t.Fatal(err)
22 }
23 report, err := m.ProbeIsolation(context.Background(), l, []provider.IsolationTarget{target}, false)
24 if err != nil {
25 t.Fatal(err)
26 }
27 r := report.Targets[0]
28 if !report.Safe || r.Safe || r.Status != "expected-provider-home" || r.Operations["open"] != "sentinel-exposed" {
29 t.Fatalf("staged provider home misclassified: %+v", report)
30 }
31 target.Name = "credential-source"
32 report, err = m.ProbeIsolation(context.Background(), l, []provider.IsolationTarget{target}, false)
33 if err != nil {
34 t.Fatal(err)
35 }
36 if report.Safe || report.Targets[0].Status != "" {
37 t.Fatal("source exposure exempted")
38 }
39}
40