@@ -43,6 +43,9 @@ func TestCertificate(t *testing.T) {
43
43
t .Skip ("Skipping because CERT_DOMAIN is not set" )
44
44
}
45
45
46
+ // random subdomain
47
+ certDomain = fmt .Sprintf ("%s.%s" , randomHex (4 ), certDomain )
48
+
46
49
certName := withSuffix ("test-certificate-managed" )
47
50
certID , err := createCertificate (t , certName , "--type" , "managed" , "--domain" , certDomain )
48
51
require .NoError (t , err )
@@ -72,6 +75,12 @@ func runCertificateTestSuite(t *testing.T, certName string, certID int64, certTy
72
75
require .NoError (t , err )
73
76
assert .Equal (t , fmt .Sprintf ("Label(s) baz added to certificate %d\n " , certID ), out )
74
77
})
78
+
79
+ t .Run ("HC-Staging-CA" , func (t * testing.T ) {
80
+ out , err := runCommand (t , "certificate" , "add-label" , strconv .FormatInt (certID , 10 ), "HC-Use-Staging-CA=true" )
81
+ require .NoError (t , err )
82
+ assert .Equal (t , fmt .Sprintf ("Label(s) HC-Use-Staging-CA added to certificate %d\n " , certID ), out )
83
+ })
75
84
})
76
85
77
86
t .Run ("update-name" , func (t * testing.T ) {
@@ -100,7 +109,7 @@ func runCertificateTestSuite(t *testing.T, certName string, certID int64, certTy
100
109
).Newline ().
101
110
Lit (strconv .FormatInt (certID , 10 )).Whitespace ().
102
111
Lit (certName ).Whitespace ().
103
- Lit ("foo=bar" ).Whitespace ().
112
+ Lit ("HC-Use-Staging-CA=true, foo=bar" ).Whitespace ().
104
113
Lit (string (certType )).Whitespace ().
105
114
UnixDate ().Whitespace ().
106
115
UnixDate ().Whitespace ().
@@ -139,6 +148,7 @@ func runCertificateTestSuite(t *testing.T, certName string, certID int64, certTy
139
148
Lit ("Domain names:" ).Newline ().
140
149
Lit (" - " ).Lit (domainName ).Newline ().
141
150
Lit ("Labels:" ).Newline ().
151
+ Lit (" HC-Use-Staging-CA:" ).Whitespace ().Lit ("true" ).Newline ().
142
152
Lit (" foo:" ).Whitespace ().Lit ("bar" ).Newline ().
143
153
Lit ("Used By:" ).Newline ().
144
154
Lit (" Certificate unused" ).Newline ().
0 commit comments