diff --git a/e2e/ctl_v3_kv_test.go b/e2e/ctl_v3_kv_test.go index 112ea2375..b2ccf0cc7 100644 --- a/e2e/ctl_v3_kv_test.go +++ b/e2e/ctl_v3_kv_test.go @@ -19,18 +19,20 @@ import ( "testing" ) -func TestCtlV3Put(t *testing.T) { testCtl(t, putTest) } -func TestCtlV3PutNoTLS(t *testing.T) { testCtl(t, putTest, withCfg(configNoTLS)) } -func TestCtlV3PutClientTLS(t *testing.T) { testCtl(t, putTest, withCfg(configClientTLS)) } -func TestCtlV3PutPeerTLS(t *testing.T) { testCtl(t, putTest, withCfg(configPeerTLS)) } -func TestCtlV3PutTimeout(t *testing.T) { testCtl(t, putTest, withDialTimeout(0)) } +func TestCtlV3Put(t *testing.T) { testCtl(t, putTest) } +func TestCtlV3PutNoTLS(t *testing.T) { testCtl(t, putTest, withCfg(configNoTLS)) } +func TestCtlV3PutClientTLS(t *testing.T) { testCtl(t, putTest, withCfg(configClientTLS)) } +func TestCtlV3PutClientAutoTLS(t *testing.T) { testCtl(t, putTest, withCfg(configClientAutoTLS)) } +func TestCtlV3PutPeerTLS(t *testing.T) { testCtl(t, putTest, withCfg(configPeerTLS)) } +func TestCtlV3PutTimeout(t *testing.T) { testCtl(t, putTest, withDialTimeout(0)) } -func TestCtlV3Get(t *testing.T) { testCtl(t, getTest) } -func TestCtlV3GetNoTLS(t *testing.T) { testCtl(t, getTest, withCfg(configNoTLS)) } -func TestCtlV3GetClientTLS(t *testing.T) { testCtl(t, getTest, withCfg(configClientTLS)) } -func TestCtlV3GetPeerTLS(t *testing.T) { testCtl(t, getTest, withCfg(configPeerTLS)) } -func TestCtlV3GetTimeout(t *testing.T) { testCtl(t, getTest, withDialTimeout(0)) } -func TestCtlV3GetQuorum(t *testing.T) { testCtl(t, getTest, withQuorum()) } +func TestCtlV3Get(t *testing.T) { testCtl(t, getTest) } +func TestCtlV3GetNoTLS(t *testing.T) { testCtl(t, getTest, withCfg(configNoTLS)) } +func TestCtlV3GetClientTLS(t *testing.T) { testCtl(t, getTest, withCfg(configClientTLS)) } +func TestCtlV3GetClientAutoTLS(t *testing.T) { testCtl(t, getTest, withCfg(configClientAutoTLS)) } +func TestCtlV3GetPeerTLS(t *testing.T) { testCtl(t, getTest, withCfg(configPeerTLS)) } +func TestCtlV3GetTimeout(t *testing.T) { testCtl(t, getTest, withDialTimeout(0)) } +func TestCtlV3GetQuorum(t *testing.T) { testCtl(t, getTest, withQuorum()) } func TestCtlV3GetFormat(t *testing.T) { testCtl(t, getFormatTest) } func TestCtlV3GetRev(t *testing.T) { testCtl(t, getRevTest) } diff --git a/e2e/ctl_v3_test.go b/e2e/ctl_v3_test.go index 8cb7124ff..b8ab810eb 100644 --- a/e2e/ctl_v3_test.go +++ b/e2e/ctl_v3_test.go @@ -140,8 +140,13 @@ func (cx *ctlCtx) PrefixArgs() []string { } cmdArgs := []string{"../bin/etcdctl", "--endpoints", endpoints, "--dial-timeout", cx.dialTimeout.String()} if cx.epc.cfg.clientTLS == clientTLS { - cmdArgs = append(cmdArgs, "--cacert", caPath, "--cert", certPath, "--key", privateKeyPath) + if cx.epc.cfg.isClientAuthTLS { + cmdArgs = append(cmdArgs, "--insecure-transport=false", "--insecure-skip-tls-verify") + } else { + cmdArgs = append(cmdArgs, "--cacert", caPath, "--cert", certPath, "--key", privateKeyPath) + } } + return cmdArgs } diff --git a/e2e/etcd_test.go b/e2e/etcd_test.go index 55483e72b..3f7fc8a44 100644 --- a/e2e/etcd_test.go +++ b/e2e/etcd_test.go @@ -44,7 +44,6 @@ var ( configNoTLS = etcdProcessClusterConfig{ clusterSize: 3, proxySize: 0, - isPeerTLS: false, initialToken: "new", } configAutoTLS = etcdProcessClusterConfig{ @@ -64,16 +63,21 @@ var ( clusterSize: 3, proxySize: 0, clientTLS: clientTLS, - isPeerTLS: false, initialToken: "new", } configClientBoth = etcdProcessClusterConfig{ clusterSize: 1, proxySize: 0, clientTLS: clientTLSAndNonTLS, - isPeerTLS: false, initialToken: "new", } + configClientAutoTLS = etcdProcessClusterConfig{ + clusterSize: 1, + proxySize: 0, + isClientAuthTLS: true, + clientTLS: clientTLS, + initialToken: "new", + } configPeerTLS = etcdProcessClusterConfig{ clusterSize: 3, proxySize: 0, @@ -83,7 +87,6 @@ var ( configWithProxy = etcdProcessClusterConfig{ clusterSize: 3, proxySize: 1, - isPeerTLS: false, initialToken: "new", } configWithProxyTLS = etcdProcessClusterConfig{ @@ -135,6 +138,7 @@ type etcdProcessClusterConfig struct { clientTLS clientConnType isPeerTLS bool isPeerAutoTLS bool + isClientAuthTLS bool initialToken string quotaBackendBytes int64 } @@ -292,13 +296,18 @@ func (cfg *etcdProcessClusterConfig) etcdProcessConfigs() []*etcdProcessConfig { func (cfg *etcdProcessClusterConfig) tlsArgs() (args []string) { if cfg.clientTLS != clientNonTLS { - tlsClientArgs := []string{ - "--cert-file", certPath, - "--key-file", privateKeyPath, - "--ca-file", caPath, + if cfg.isClientAuthTLS { + args = append(args, "--auto-tls=true") + } else { + tlsClientArgs := []string{ + "--cert-file", certPath, + "--key-file", privateKeyPath, + "--ca-file", caPath, + } + args = append(args, tlsClientArgs...) } - args = append(args, tlsClientArgs...) } + if cfg.isPeerTLS { if cfg.isPeerAutoTLS { args = append(args, "--peer-auto-tls=true")