Skip to content

Commit

Permalink
Merge pull request #1972 from hashicorp/backport/fix-leap-year-test/n…
Browse files Browse the repository at this point in the history
…otably-fleet-flamingo

This pull request was automerged via backport-assistant
  • Loading branch information
hc-github-team-consul-core authored Mar 2, 2023
2 parents 583daf1 + 46d7977 commit 5c7a02d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion control-plane/subcommand/tls-init/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ func TestRun_CreatesServerCertificatesWithExpiryWithinSpecifiedDays(t *testing.T
certBlock, _ := pem.Decode(newServerCert)
certificate, err := x509.ParseCertificate(certBlock.Bytes)
require.NoError(t, err)
require.Equal(t, time.Now().AddDate(1, 0, 0).Unix(), certificate.NotAfter.Unix())

// Add 365 days instead of 1 year to account for leap years
require.Equal(t, time.Now().AddDate(0, 0, 365).Unix(), certificate.NotAfter.Unix())
}

func TestRun_CreatesServerCertificatesWithProvidedHosts(t *testing.T) {
Expand Down

0 comments on commit 5c7a02d

Please sign in to comment.