mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
commit
06e2338108
@ -323,7 +323,7 @@ func etcdctlPrefixArgs(clus *etcdProcessCluster) []string {
|
||||
}
|
||||
endpoints = strings.Join(es, ",")
|
||||
}
|
||||
cmdArgs := []string{defaultCtlBinPath, "--endpoints", endpoints}
|
||||
cmdArgs := []string{ctlBinPath, "--endpoints", endpoints}
|
||||
if clus.cfg.clientTLS == clientTLS {
|
||||
cmdArgs = append(cmdArgs, "--ca-file", caPath, "--cert-file", certPath, "--key-file", privateKeyPath)
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ func (cx *ctlCtx) PrefixArgs() []string {
|
||||
}
|
||||
endpoints = strings.Join(es, ",")
|
||||
}
|
||||
cmdArgs := []string{defaultCtlBinPath, "--endpoints", endpoints, "--dial-timeout", cx.dialTimeout.String()}
|
||||
cmdArgs := []string{ctlBinPath, "--endpoints", endpoints, "--dial-timeout", cx.dialTimeout.String()}
|
||||
if cx.epc.cfg.clientTLS == clientTLS {
|
||||
if cx.epc.cfg.isClientAutoTLS {
|
||||
cmdArgs = append(cmdArgs, "--insecure-transport=false", "--insecure-skip-tls-verify")
|
||||
|
@ -26,13 +26,14 @@ import (
|
||||
"github.com/coreos/etcd/pkg/fileutil"
|
||||
)
|
||||
|
||||
const (
|
||||
etcdProcessBasePort = 20000
|
||||
certPath = "../integration/fixtures/server.crt"
|
||||
privateKeyPath = "../integration/fixtures/server.key.insecure"
|
||||
caPath = "../integration/fixtures/ca.crt"
|
||||
defaultBinPath = "../bin/etcd"
|
||||
defaultCtlBinPath = "../bin/etcdctl"
|
||||
const etcdProcessBasePort = 20000
|
||||
|
||||
var (
|
||||
binPath string
|
||||
ctlBinPath string
|
||||
certPath string
|
||||
privateKeyPath string
|
||||
caPath string
|
||||
)
|
||||
|
||||
type clientConnType int
|
||||
@ -207,12 +208,18 @@ func newEtcdProcess(cfg *etcdProcessConfig) (*etcdProcess, error) {
|
||||
}
|
||||
|
||||
func (cfg *etcdProcessClusterConfig) etcdProcessConfigs() []*etcdProcessConfig {
|
||||
binPath = binDir + "/etcd"
|
||||
ctlBinPath = binDir + "/etcdctl"
|
||||
certPath = certDir + "/server.crt"
|
||||
privateKeyPath = certDir + "/server.key.insecure"
|
||||
caPath = certDir + "/ca.crt"
|
||||
|
||||
if cfg.basePort == 0 {
|
||||
cfg.basePort = etcdProcessBasePort
|
||||
}
|
||||
|
||||
if cfg.execPath == "" {
|
||||
cfg.execPath = defaultBinPath
|
||||
cfg.execPath = binPath
|
||||
}
|
||||
if cfg.snapCount == 0 {
|
||||
cfg.snapCount = etcdserver.DefaultSnapCount
|
||||
|
@ -41,14 +41,14 @@ func TestGateway(t *testing.T) {
|
||||
os.Setenv("ETCDCTL_API", "3")
|
||||
defer os.Unsetenv("ETCDCTL_API")
|
||||
|
||||
err = spawnWithExpect([]string{defaultCtlBinPath, "--endpoints=" + defaultGatewayEndpoint, "put", "foo", "bar"}, "OK\r\n")
|
||||
err = spawnWithExpect([]string{ctlBinPath, "--endpoints=" + defaultGatewayEndpoint, "put", "foo", "bar"}, "OK\r\n")
|
||||
if err != nil {
|
||||
t.Errorf("failed to finish put request through gateway: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func startGateway(t *testing.T, endpoints string) *expect.ExpectProcess {
|
||||
p, err := expect.NewExpect(defaultBinPath, "gateway", "--endpoints="+endpoints, "start")
|
||||
p, err := expect.NewExpect(binPath, "gateway", "--endpoints="+endpoints, "start")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
package e2e
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
@ -12,8 +13,16 @@ import (
|
||||
"github.com/coreos/etcd/pkg/testutil"
|
||||
)
|
||||
|
||||
var binDir string
|
||||
var certDir string
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
os.Setenv("ETCD_UNSUPPORTED_ARCH", runtime.GOARCH)
|
||||
|
||||
flag.StringVar(&binDir, "bin-dir", "../bin", "The directory for store etcd and etcdctl binaries.")
|
||||
flag.StringVar(&certDir, "cert-dir", "../integration/fixtures", "The directory for store certificate files.")
|
||||
flag.Parse()
|
||||
|
||||
v := m.Run()
|
||||
if v == 0 && testutil.CheckLeakedGoroutine() {
|
||||
os.Exit(1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user