mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
e2e: Make the certificate file path configurable
This commit will help us to run the e2e tests in an enviroment without e2e source code more convenient. Signed-off-by: Yiqiao Pu <ypu@redhat.com>
This commit is contained in:
parent
2ca87f6c03
commit
a5e4fbd335
@ -26,16 +26,14 @@ import (
|
|||||||
"github.com/coreos/etcd/pkg/fileutil"
|
"github.com/coreos/etcd/pkg/fileutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const etcdProcessBasePort = 20000
|
||||||
etcdProcessBasePort = 20000
|
|
||||||
certPath = "../integration/fixtures/server.crt"
|
|
||||||
privateKeyPath = "../integration/fixtures/server.key.insecure"
|
|
||||||
caPath = "../integration/fixtures/ca.crt"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
binPath string
|
binPath string
|
||||||
ctlBinPath string
|
ctlBinPath string
|
||||||
|
certPath string
|
||||||
|
privateKeyPath string
|
||||||
|
caPath string
|
||||||
)
|
)
|
||||||
|
|
||||||
type clientConnType int
|
type clientConnType int
|
||||||
@ -207,6 +205,9 @@ func newEtcdProcess(cfg *etcdProcessConfig) (*etcdProcess, error) {
|
|||||||
func (cfg *etcdProcessClusterConfig) etcdProcessConfigs() []*etcdProcessConfig {
|
func (cfg *etcdProcessClusterConfig) etcdProcessConfigs() []*etcdProcessConfig {
|
||||||
binPath = binDir + "/etcd"
|
binPath = binDir + "/etcd"
|
||||||
ctlBinPath = binDir + "/etcdctl"
|
ctlBinPath = binDir + "/etcdctl"
|
||||||
|
certPath = certDir + "/server.crt"
|
||||||
|
privateKeyPath = certDir + "/server.key.insecure"
|
||||||
|
caPath = certDir + "/ca.crt"
|
||||||
|
|
||||||
if cfg.basePort == 0 {
|
if cfg.basePort == 0 {
|
||||||
cfg.basePort = etcdProcessBasePort
|
cfg.basePort = etcdProcessBasePort
|
||||||
|
@ -14,11 +14,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var binDir string
|
var binDir string
|
||||||
|
var certDir string
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
os.Setenv("ETCD_UNSUPPORTED_ARCH", runtime.GOARCH)
|
os.Setenv("ETCD_UNSUPPORTED_ARCH", runtime.GOARCH)
|
||||||
|
|
||||||
flag.StringVar(&binDir, "bin-dir", "../bin", "The directory for store etcd and etcdctl binaries.")
|
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()
|
flag.Parse()
|
||||||
|
|
||||||
v := m.Run()
|
v := m.Run()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user