File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ func TestYubiKeySignECDSA(t *testing.T) {
80
80
}
81
81
82
82
func TestSlots (t * testing.T ) {
83
+ yk , close := newTestYubiKey (t )
84
+ if err := yk .Reset (); err != nil {
85
+ t .Fatalf ("resetting yubikey: %v" , err )
86
+ }
87
+ close ()
88
+
83
89
tests := []struct {
84
90
name string
85
91
slot Slot
@@ -125,6 +131,10 @@ func TestSlots(t *testing.T) {
125
131
if err != nil {
126
132
t .Fatalf ("parse certificate: %v" , err )
127
133
}
134
+
135
+ if _ , err := yk .Certificate (test .slot ); err == nil || ! errors .Is (err , ErrNotFound ) {
136
+ t .Errorf ("get certificate, got err=%v, want=ErrNotFound" , err )
137
+ }
128
138
if err := yk .SetCertificate (DefaultManagementKey , test .slot , cert ); err != nil {
129
139
t .Fatalf ("set certificate: %v" , err )
130
140
}
You can’t perform that action at this time.
0 commit comments