Преглед изворни кода

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

Hitoshi Mitake пре 7 година
родитељ
комит
a1f964afd3
1 измењених фајлова са 31 додато и 0 уклоњено
  1. 31 0
      tests/e2e/etcd_config_test.go

+ 31 - 0
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()
+}