Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ func doTlsParserTest(t *testing.T, domain string, tlsVer string) {
lastSeenStr := gjson.GetBytes(body, fmt.Sprintf("#(domain==\"%s\").lastSeen", domain)).String()
lastSeen, _ := time.Parse("2006-01-02T15:04:05.000000000Z", lastSeenStr)

return assert.EqualValues(t, tlsVer, tlsVersion) &&
assert.NotEmpty(t, cipher) &&
assert.Greater(t, time.Now(), lastSeen)
return tlsVer == tlsVersion &&
cipher != "" &&
time.Now().After(lastSeen)
}, 10*time.Second, 1*time.Second)

assert.Eventually(t, func() bool {
Expand All @@ -190,12 +190,12 @@ func doTlsParserTest(t *testing.T, domain string, tlsVer string) {

chain := gjson.GetBytes(body, "certificate.serverChain").String()

return assert.EqualValues(t, domain, d) &&
assert.Contains(t, clientTLSVersions, tlsVersion) &&
assert.Contains(t, clientCipherSuites, cipher) &&
assert.Greater(t, time.Now(), notBefore) &&
assert.Less(t, time.Now(), notAfter) &&
assert.Contains(t, chain, "C=PL,ST=Poznan,UnknownOID=2.5.4.7,O=k8spacket,OU=k8spacket,CN=k8spacket.domain")
return domain == d &&
strings.Contains(clientTLSVersions, tlsVersion) &&
strings.Contains(clientCipherSuites, cipher) &&
time.Now().After(notBefore) &&
time.Now().Before(notAfter) &&
strings.Contains(chain, "C=PL,ST=Poznan,UnknownOID=2.5.4.7,O=k8spacket,OU=k8spacket,CN=k8spacket.domain")
}, 10*time.Second, 1*time.Second)
}

Expand Down