tests: add a new e2e test case for the combination of non empty CN and grpc proxy

release-3.4
Hitoshi Mitake 2019-01-25 00:24:30 +09:00
parent b1afe210e4
commit a1f964afd3
1 changed files with 31 additions and 0 deletions

View File

@ -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()
}