Download this file
| 1 | package equipo |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | "testing" |
| 6 | |
| 7 | "amadan.net/oficina/equipo/internal/equipo/team" |
| 8 | ) |
| 9 | |
| 10 | func TestExecutorReportIsolationContains(t *testing.T) { |
| 11 | need := team.IsolationSnapshot{Status: "unconfined", RunnerTainted: true, AcknowledgementIDs: []string{"current"}, ObservedTuples: []team.IsolationTuple{{Provider: "codex", ProviderVersion: "1", PaseoVersion: "1", IsolationConfigHash: strings.Repeat("a", 64)}}} |
| 12 | have := need |
| 13 | have.AcknowledgementIDs = []string{"current", "extra"} |
| 14 | if !executorReportIsolation(have, need) { |
| 15 | t.Fatal("extra taint refused") |
| 16 | } |
| 17 | have.RunnerTainted = false |
| 18 | if executorReportIsolation(have, need) { |
| 19 | t.Fatal("stripped taint accepted") |
| 20 | } |
| 21 | have = need |
| 22 | have.AcknowledgementIDs = nil |
| 23 | if executorReportIsolation(have, need) { |
| 24 | t.Fatal("missing acknowledgement accepted") |
| 25 | } |
| 26 | } |
| 27 | |