Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Feb 26, 2024
1 parent 9167707 commit 8eb5128
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 35 deletions.
52 changes: 25 additions & 27 deletions pkg/collect/certificates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,23 @@ vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
+OkuE6N36B9K
-----END CERTIFICATE-----`,
"validCert": `-----BEGIN CERTIFICATE-----
MIIDejCCAmKgAwIBAgIEAZaq0DANBgkqhkiG9w0BAQsFADAuMRgwFgYDVQQDEw9Q
cm9qZWN0IENvbnRvdXIxEjAQBgNVBAUTCTYxNTkyOTg5MTAeFw0yMzAyMjQwNDI3
MThaFw0yNDAyMjUwNDI3MTZaMBAxDjAMBgNVBAMTBWVudm95MIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqsNmmxb1ICso6Ay25lapcRyvLxAX/5u422uV
eiNn5jseCVXfg1jJr2Symrgou2dgMtIpZoVKT7w0el8sNpD+az5oMOWUNfTGEpYI
5zNAhtiedxCWcX15gfezOZ/DECL7HP8U37JFVdazm0CjvlQWI+8rFGvFQJJFDLYJ
h0fHGfbX6L/ST6cANtkXZyIU6CYFSgniuuDjHmQnQr6CC8lkisJxY5QVS7MZ02RR
nU/dK14ABY+mo/0ZeBKR5si04hr4i18nJJnk4DnHN+jQ/WWWSO1yLqr9kAOj37dA
nRAeKuzkx/VbU8DC/3sh0otcazoWO470D+irOy1is0whDArLNwIDAQABo4G9MIG6
MA4GA1UdDwEB/wQEAwIE8DAdBgNVHQ4EFgQUbAavOY+vIXgc44k8GvLHH6mdzzYw
HwYDVR0jBBgwFoAUb+S3Mu7cbwZiqZaEHTEMyUhLyH4waAYDVR0RBGEwX4IFZW52
b3mCFGVudm95LnByb2plY3Rjb250b3VyghhlbnZveS5wcm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XhhbXBsZTOCCGV4YW1w
bGU0MB0GA1UdDgQWBBTEkowqyNS1ez5XJ0shro/18UQlqTANBgkqhkiG9w0BAQsF
AAOCAQEANhnxV81NZmt8FcgrcRt73WdKDCE0hQbci65ZkAbcTVOCAs6Rw+aEC04L
0gKJT4Zmx3kR3fUwcDQRhjoXIrhmvP59k/8SN0N+Ua50oEYikaetsxEDr8oikwP2
eHDKU451jZZfcyII2Jx8XjgtiExcNZL3N9ZtSstp3I9n9BSmMdQHDIvPxNeGdJri
l4YGTm+sJLs+c5efSNaEPw1Dr6bhAPamNQwvIspuASJlCTcMCLw2+F3dEolAFUuM
E5wI9498c+P3pvl85UfiQISTu95jOl7YmZOYl8xBpu9yhQ7kjWhVRdVAnhl9Ts9F
3TD68rCMXegJYyg5VbiwVdSPkcw3eQ==
-----END CERTIFICATE-----`,
"nonCert": `-----BEGIN CERTIFICATE-----
Oy1is0whDArLNwIDAQABo4G9MIG6
Expand Down Expand Up @@ -248,16 +246,16 @@ func TestCertParser(t *testing.T) {
CertificateChain: []ParsedCertificate{
{
CertName: "tls.crt",
Subject: "CN=envoy",
Subject: "CN=ExampleServer",
SubjectAlternativeNames: []string{
"envoy",
"envoy.projectcontour",
"envoy.projectcontour.svc",
"envoy.projectcontour.svc.cluster.local",
"example1",
"example2",
"example3",
"example4",
},
Issuer: "SERIALNUMBER=615929891,CN=Project Contour",
NotAfter: time.Date(2025, time.February, 25, 4, 27, 16, 0, time.UTC),
NotBefore: time.Date(2024, time.February, 24, 4, 27, 18, 0, time.UTC),
Issuer: "CN=ExampleServer",
NotAfter: time.Date(2029, time.February, 24, 22, 9, 27, 0, time.UTC),
NotBefore: time.Date(2024, time.February, 26, 22, 9, 27, 0, time.UTC),
IsValid: true,
IsCA: false,
},
Expand Down
16 changes: 8 additions & 8 deletions pkg/collect/host_certificates_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ func Test_HostCertParser(t *testing.T) {
CertificatePath: path,
CertificateChain: []ParsedCertificate{
{
Subject: "CN=envoy",
Subject: "CN=ExampleServer",
SubjectAlternativeNames: []string{
"envoy",
"envoy.projectcontour",
"envoy.projectcontour.svc",
"envoy.projectcontour.svc.cluster.local",
"example1",
"example2",
"example3",
"example4",
},
Issuer: "SERIALNUMBER=615929891,CN=Project Contour",
NotAfter: time.Date(2024, time.February, 25, 4, 27, 16, 0, time.UTC),
NotBefore: time.Date(2023, time.February, 24, 4, 27, 18, 0, time.UTC),
Issuer: "CN=ExampleServer",
NotAfter: time.Date(2029, time.February, 24, 22, 9, 27, 0, time.UTC),
NotBefore: time.Date(2024, time.February, 26, 22, 9, 27, 0, time.UTC),
IsValid: true,
IsCA: false,
},
Expand Down

0 comments on commit 8eb5128

Please sign in to comment.