From a1f964afd3f8859f9a2705b58ebfefbb49288df8 Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Fri, 25 Jan 2019 00:24:30 +0900 Subject: [PATCH] tests: add a new e2e test case for the combination of non empty CN and grpc proxy --- tests/e2e/etcd_config_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/e2e/etcd_config_test.go b/tests/e2e/etcd_config_test.go index 68370104f..7c660b03e 100644 --- a/tests/e2e/etcd_config_test.go +++ b/tests/e2e/etcd_config_test.go @@ -190,3 +190,34 @@ func TestEtcdPeerCNAuth(t *testing.T) { } } } + +func TestGrpcproxyAndCommonName(t *testing.T) { + argsWithNonEmptyCN := []string{ + binDir + "/etcd", + "grpc-proxy", + "start", + "--cert", certPath2, + "--key", privateKeyPath2, + "--cacert", caPath, + } + + argsWithEmptyCN := []string{ + binDir + "/etcd", + "grpc-proxy", + "start", + "--cert", certPath3, + "--key", privateKeyPath3, + "--cacert", caPath, + } + + err := spawnWithExpect(argsWithNonEmptyCN, "cert has non empty Common Name") + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + + p, err := spawnCmd(argsWithEmptyCN) + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + p.Stop() +}