( t *testing.T, ctx context.Context, kind string, expected string, )
| 712 | } |
| 713 | |
| 714 | func (s *Sensor) assertTargetAppStdFileEqualsTo( |
| 715 | t *testing.T, |
| 716 | ctx context.Context, |
| 717 | kind string, |
| 718 | expected string, |
| 719 | ) { |
| 720 | if len(s.contID) == 0 { |
| 721 | t.Fatal("Test sensor container hasn't been started yet") |
| 722 | } |
| 723 | |
| 724 | data, err := os.ReadFile(filepath.Join(s.localArtifactsDirPath(), kind)) |
| 725 | if err != nil { |
| 726 | t.Fatalf("cannot read %s file: %v", kind, err) |
| 727 | } |
| 728 | |
| 729 | actual := strings.TrimSpace(string(data)) |
| 730 | if actual != expected { |
| 731 | t.Errorf("Unexpected target app %s content %q. Expected %q.", kind, actual, expected) |
| 732 | } |
| 733 | } |
| 734 | |
| 735 | // Checks the presense of the expected events AND the occurrence order. |
| 736 | func (s *Sensor) AssertSensorEventsFileContains( |
no test coverage detected