From 5f70d07f90cac2d71040d3bffdcd0567b9b7f2c8 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Mon, 10 Jul 2023 18:00:51 +0100 Subject: [PATCH] Finish renaming the dns table, sort string slices in tests --- renewal/find-next-cert.sql | 4 ++-- renewal/service_test.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/renewal/find-next-cert.sql b/renewal/find-next-cert.sql index ec8f99d..6f719b8 100644 --- a/renewal/find-next-cert.sql +++ b/renewal/find-next-cert.sql @@ -1,6 +1,6 @@ -select cert.id, cert.not_after, dns.type, dns.token, cert.temp_parent +select cert.id, cert.not_after, dns_acme.type, dns_acme.token, cert.temp_parent from certificates as cert - left outer join dns on cert.dns = dns.id + left outer join dns_acme on cert.dns = dns_acme.id where cert.active = 1 and (cert.auto_renew = 1 or cert.not_after IS NULL) and cert.renewing = 0 diff --git a/renewal/service_test.go b/renewal/service_test.go index b7764d7..94619b3 100644 --- a/renewal/service_test.go +++ b/renewal/service_test.go @@ -25,6 +25,7 @@ import ( "os" "os/exec" "path/filepath" + "sort" "sync" "testing" "time" @@ -194,6 +195,8 @@ func TestPebbleRenewal(t *testing.T) { assert.Equal(t, "CERTIFICATE", p.Type) outCert, err := x509.ParseCertificate(p.Bytes) assert.NoError(t, err) + sort.Strings(i.domains) + sort.Strings(outCert.DNSNames) assert.Equal(t, i.domains, outCert.DNSNames) }) }