From: Matus Fabian Date: Thu, 30 Jan 2025 09:36:14 +0000 (-0500) Subject: hs-test: fix broken test X-Git-Tag: v25.02-rc2~11 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=82cd81ade65e0e29f8e1a908c0b92aa0d6895aaf;p=vpp.git hs-test: fix broken test AssertContains and AssertNotContains are now case insensitive to prevent issues like in HttpPersistentConnectionTest. Type: test Change-Id: Ic52e3fa5a7d1d5cb8486e86aa39a845cbd911d94 Signed-off-by: Matus Fabian (cherry picked from commit d38c132883ac6e9f726fed7f5a533288a5932058) --- diff --git a/extras/hs-test/infra/hst_suite.go b/extras/hs-test/infra/hst_suite.go index 78cabb3eae9..d91958e33d9 100644 --- a/extras/hs-test/infra/hst_suite.go +++ b/extras/hs-test/infra/hst_suite.go @@ -327,11 +327,11 @@ func (s *HstSuite) AssertNotEqual(expected, actual interface{}, msgAndArgs ...in } func (s *HstSuite) AssertContains(testString, contains interface{}, msgAndArgs ...interface{}) { - ExpectWithOffset(2, testString).To(ContainSubstring(fmt.Sprint(contains)), msgAndArgs...) + ExpectWithOffset(2, strings.ToLower(fmt.Sprint(testString))).To(ContainSubstring(strings.ToLower(fmt.Sprint(contains))), msgAndArgs...) } func (s *HstSuite) AssertNotContains(testString, contains interface{}, msgAndArgs ...interface{}) { - ExpectWithOffset(2, testString).ToNot(ContainSubstring(fmt.Sprint(contains)), msgAndArgs...) + ExpectWithOffset(2, strings.ToLower(fmt.Sprint(testString))).ToNot(ContainSubstring(strings.ToLower(fmt.Sprint(contains))), msgAndArgs...) } func (s *HstSuite) AssertEmpty(object interface{}, msgAndArgs ...interface{}) {