Skip to content

Commit

Permalink
Adding a test for deleting keysets
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Markus With committed Apr 21, 2020
1 parent 8bb078a commit 4d688c8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions upup/pkg/fi/vfs_castore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"testing"
"time"

"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/pki"
"k8s.io/kops/util/pkg/vfs"
)
Expand Down Expand Up @@ -214,4 +215,20 @@ spec:
}
}

// Check that keyset gets deleted
{
keyset := &kops.Keyset{}
keyset.Name = "ca"
keyset.Spec.Type = kops.SecretTypeKeypair

s.DeleteKeysetItem(keyset, "237054359138908419352140518924933177492")

_, err := pathMap["memfs://tests/private/ca/237054359138908419352140518924933177492.key"].ReadFile()
pathMap["memfs://tests/private/ca/237054359138908419352140518924933177492.key"].ReadFile()
if err == nil {
t.Fatalf("File memfs://tests/private/ca/237054359138908419352140518924933177492.key still exists")
}

}

}

0 comments on commit 4d688c8

Please sign in to comment.