| 652 | } |
| 653 | |
| 654 | func (s *Sensor) ExpectEvent(t *testing.T, name event.Type) { |
| 655 | if s.client == nil { |
| 656 | t.Fatal("IPC client isn't initialized - is sensor running?") |
| 657 | } |
| 658 | |
| 659 | evt, err := s.client.GetEvent() |
| 660 | if err != nil { |
| 661 | t.Fatalf("IPC client.GetEvent() failed with response %q: %v", evt, err) |
| 662 | } |
| 663 | |
| 664 | if evt.Name != name { |
| 665 | t.Fatalf("Unexpected event type %q (expected %q)", evt.Name, name) |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | func (s *Sensor) AssertSensorLogsContain(t *testing.T, ctx context.Context, what ...string) { |
| 670 | if len(s.contID) == 0 { |