Download this file
| 1 | //go:build linux |
| 2 | |
| 3 | package host |
| 4 | |
| 5 | import ( |
| 6 | "github.com/carlosframework/platform/internal/hostactors" |
| 7 | "testing" |
| 8 | ) |
| 9 | |
| 10 | func TestActivationConsoleProcessIdentity(t *testing.T) { |
| 11 | r := hostactors.Report{ProcessID: "boot:4026531836:123:456", BootID: "boot"} |
| 12 | if pid, start, err := activationConsolePID(r); err != nil || pid != 123 || start != "456" { |
| 13 | t.Fatal(pid, start, err) |
| 14 | } |
| 15 | for _, id := range []string{"boot:123", "boot:4026531836:0:456", "other:4026531836:123:456", "boot:4026531836:123:0", "boot:bad:123:456"} { |
| 16 | r.ProcessID = id |
| 17 | if _, _, err := activationConsolePID(r); err == nil { |
| 18 | t.Fatal("accepted", id) |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |