|
1 | 1 | package e2e |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "strings" |
4 | 5 | "testing" |
5 | 6 | "time" |
6 | 7 |
|
@@ -54,5 +55,31 @@ func TestLocalArtifactMirror(t *testing.T) { |
54 | 55 | t.Fatalf("we should not be able to fetch paths with ../") |
55 | 56 | } |
56 | 57 |
|
| 58 | + t.Logf("testing local artifact mirror restart after materialize") |
| 59 | + command = []string{"embedded-cluster", "materialize"} |
| 60 | + if _, _, err := RunCommandOnNode(t, tc, 0, command); err != nil { |
| 61 | + t.Fatalf("fail materialize embedded cluster binaries: %v", err) |
| 62 | + } |
| 63 | + |
| 64 | + t.Logf("waiting to verify if local artifact mirror has restarted") |
| 65 | + time.Sleep(20 * time.Second) |
| 66 | + |
| 67 | + command = []string{"journalctl", "-u", "local-artifact-mirror"} |
| 68 | + stdout, _, err := RunCommandOnNode(t, tc, 0, command) |
| 69 | + if err != nil { |
| 70 | + t.Fatalf("fail to get journalctl logs: %v", err) |
| 71 | + } |
| 72 | + |
| 73 | + expected := []string{ |
| 74 | + "Binary changed, sending signal to stop", |
| 75 | + "Scheduled restart job, restart counter is at", |
| 76 | + } |
| 77 | + for _, str := range expected { |
| 78 | + if !strings.Contains(stdout, str) { |
| 79 | + t.Fatalf("expected %q in journalctl logs, got %q", str, stdout) |
| 80 | + } |
| 81 | + t.Logf("found %q in journalctl logs", str) |
| 82 | + } |
| 83 | + |
57 | 84 | t.Logf("%s: test complete", time.Now().Format(time.RFC3339)) |
58 | 85 | } |
0 commit comments