+15
-6
lines changedFilter options
+15
-6
lines changed Original file line number Diff line number Diff line change
@@ -114,12 +114,13 @@ func testInsertCertificateAndGetUnexpiredCertificate(ta TestAccessor, t *testing
114
114
115
115
expiry := time.Now().Add(time.Minute)
116
116
want := certdb.CertificateRecord{
117
-
PEM: "fake cert data",
118
-
Serial: "fake serial 2",
119
-
AKI: fakeAKI,
120
-
Status: "good",
121
-
Reason: 0,
122
-
Expiry: expiry,
117
+
PEM: "fake cert data",
118
+
Serial: "fake serial 2",
119
+
AKI: fakeAKI,
120
+
Status: "good",
121
+
Reason: 0,
122
+
Expiry: expiry,
123
+
CALabel: "foo",
123
124
}
124
125
125
126
if err := ta.Accessor.InsertCertificate(want); err != nil {
@@ -153,6 +154,14 @@ func testInsertCertificateAndGetUnexpiredCertificate(ta TestAccessor, t *testing
153
154
if len(unexpired) != 1 {
154
155
t.Error("Should have 1 unexpired certificate record:", len(unexpired))
155
156
}
157
+
158
+
unexpiredFiltered, err := ta.Accessor.GetUnexpiredCertificatesByLabel([]string{"foo"})
159
+
require.NoError(t, err)
160
+
require.Len(t, unexpiredFiltered, 1)
161
+
unexpiredFiltered, err = ta.Accessor.GetUnexpiredCertificatesByLabel([]string{"bar"})
162
+
require.NoError(t, err)
163
+
require.Len(t, unexpiredFiltered, 0)
164
+
156
165
}
157
166
func testInsertCertificateAndGetUnexpiredCertificateNullCommonName(ta TestAccessor, t *testing.T) {
158
167
ta.Truncate()
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4