@@ -25,7 +25,6 @@ import (
25
25
"testing"
26
26
27
27
"github.com/pkg/errors"
28
- "github.com/stretchr/testify/assert"
29
28
30
29
utilerrors "k8s.io/apimachinery/pkg/util/errors"
31
30
certutil "k8s.io/client-go/util/cert"
@@ -638,38 +637,6 @@ func TestValidateMethods(t *testing.T) {
638
637
}
639
638
}
640
639
641
- func TestNewCSR (t * testing.T ) {
642
- kubeadmCert := KubeadmCertAPIServer ()
643
- cfg := testutil .GetDefaultInternalConfig (t )
644
-
645
- certConfig , err := kubeadmCert .GetConfig (cfg )
646
- if err != nil {
647
- t .Fatalf ("couldn't get cert config: %v" , err )
648
- }
649
-
650
- csr , _ , err := NewCSR (kubeadmCert , cfg )
651
-
652
- if err != nil {
653
- t .Errorf ("invalid signature on CSR: %v" , err )
654
- }
655
-
656
- assert .ElementsMatch (t , certConfig .Organization , csr .Subject .Organization , "organizations not equal" )
657
-
658
- if csr .Subject .CommonName != certConfig .CommonName {
659
- t .Errorf ("expected common name %q, got %q" , certConfig .CommonName , csr .Subject .CommonName )
660
- }
661
-
662
- assert .ElementsMatch (t , certConfig .AltNames .DNSNames , csr .DNSNames , "dns names not equal" )
663
-
664
- assert .Len (t , csr .IPAddresses , len (certConfig .AltNames .IPs ))
665
-
666
- for i , ip := range csr .IPAddresses {
667
- if ! ip .Equal (certConfig .AltNames .IPs [i ]) {
668
- t .Errorf ("[%d]: %v != %v" , i , ip , certConfig .AltNames .IPs [i ])
669
- }
670
- }
671
- }
672
-
673
640
func TestCreateCertificateFilesMethods (t * testing.T ) {
674
641
675
642
var tests = []struct {
0 commit comments