Skip to content

Commit

Permalink
tests: removes redundant integration files and generated by script (#…
Browse files Browse the repository at this point in the history
…6909)

close #6910

Signed-off-by: husharp <jinhao.hu@pingcap.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
HuSharp and ti-chi-bot[bot] authored Aug 10, 2023
1 parent 9d2f650 commit c98f6da
Show file tree
Hide file tree
Showing 27 changed files with 99 additions and 518 deletions.
22 changes: 19 additions & 3 deletions pkg/utils/grpcutil/grpcutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ package grpcutil

import (
"os"
"os/exec"
"path"
"testing"

"github.com/pingcap/errors"
"github.com/stretchr/testify/require"
"github.com/tikv/pd/pkg/errs"
)

var (
certPath = "../../../tests/integrations/client/"
certScript = "cert_opt.sh"
)

func loadTLSContent(re *require.Assertions, caPath, certPath, keyPath string) (caData, certData, keyData []byte) {
var err error
caData, err = os.ReadFile(caPath)
Expand All @@ -21,12 +28,21 @@ func loadTLSContent(re *require.Assertions, caPath, certPath, keyPath string) (c
}

func TestToTLSConfig(t *testing.T) {
if err := exec.Command(certPath+certScript, "generate", certPath).Run(); err != nil {
t.Fatal(err)
}
defer func() {
if err := exec.Command(certPath+certScript, "cleanup", certPath).Run(); err != nil {
t.Fatal(err)
}
}()

t.Parallel()
re := require.New(t)
tlsConfig := TLSConfig{
KeyPath: "../../../tests/integrations/client/cert/pd-server-key.pem",
CertPath: "../../../tests/integrations/client/cert/pd-server.pem",
CAPath: "../../../tests/integrations/client/cert/ca.pem",
KeyPath: path.Join(certPath, "pd-server-key.pem"),
CertPath: path.Join(certPath, "pd-server.pem"),
CAPath: path.Join(certPath, "ca.pem"),
}
// test without bytes
_, err := tlsConfig.ToTLSConfig()
Expand Down
27 changes: 0 additions & 27 deletions tests/integrations/client/cert-expired/ca-config.json

This file was deleted.

18 changes: 0 additions & 18 deletions tests/integrations/client/cert-expired/ca-csr.json

This file was deleted.

27 changes: 0 additions & 27 deletions tests/integrations/client/cert-expired/ca-key.pem

This file was deleted.

16 changes: 0 additions & 16 deletions tests/integrations/client/cert-expired/ca.csr

This file was deleted.

22 changes: 0 additions & 22 deletions tests/integrations/client/cert-expired/ca.pem

This file was deleted.

27 changes: 0 additions & 27 deletions tests/integrations/client/cert-expired/client-key.pem

This file was deleted.

16 changes: 0 additions & 16 deletions tests/integrations/client/cert-expired/client.csr

This file was deleted.

21 changes: 0 additions & 21 deletions tests/integrations/client/cert-expired/client.pem

This file was deleted.

18 changes: 0 additions & 18 deletions tests/integrations/client/cert-expired/gencerts.sh

This file was deleted.

27 changes: 0 additions & 27 deletions tests/integrations/client/cert-expired/pd-server-key.pem

This file was deleted.

16 changes: 0 additions & 16 deletions tests/integrations/client/cert-expired/pd-server.csr

This file was deleted.

22 changes: 0 additions & 22 deletions tests/integrations/client/cert-expired/pd-server.pem

This file was deleted.

27 changes: 0 additions & 27 deletions tests/integrations/client/cert/ca-config.json

This file was deleted.

18 changes: 0 additions & 18 deletions tests/integrations/client/cert/ca-csr.json

This file was deleted.

27 changes: 0 additions & 27 deletions tests/integrations/client/cert/ca-key.pem

This file was deleted.

Loading

0 comments on commit c98f6da

Please sign in to comment.