From 47b7fa2ca4a2e81b079afcaac6f1a3403146f4ac Mon Sep 17 00:00:00 2001 From: Lance Haig Date: Tue, 6 Jun 2023 09:40:47 +0200 Subject: [PATCH] Update tls_ca_create_test.go Update Tests --- command/tls_ca_create_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/command/tls_ca_create_test.go b/command/tls_ca_create_test.go index 2c13f8ec627..577db92a7d1 100644 --- a/command/tls_ca_create_test.go +++ b/command/tls_ca_create_test.go @@ -46,6 +46,10 @@ func TestCACreateCommand(t *testing.T) { "-name-constraint=true", "-domain=foo", "-additional-domain=bar", + "-common-name=CustomCA", + "-country=ZZ", + "-organization=CustOrg", + "-organizational-unit=CustOrgUnit", }, "foo-agent-ca.pem", "foo-agent-ca-key.pem", @@ -54,6 +58,10 @@ func TestCACreateCommand(t *testing.T) { require.True(t, cert.PermittedDNSDomainsCritical) require.Len(t, cert.PermittedDNSDomains, 4) require.ElementsMatch(t, cert.PermittedDNSDomains, []string{"nomad", "foo", "localhost", "bar"}) + require.Equal(t, cert.Issuer.Organization, []string{"CustOrg"}) + require.Equal(t, cert.Issuer.OrganizationalUnit, []string{"CustOrgUnit"}) + require.Equal(t, cert.Issuer.Country, []string{"ZZ"}) + require.Contains(t, cert.Issuer.CommonName, "CustomCA") }, }, }