test: Remove accessing etcd via BinDir

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
Marek Siarkowicz 2022-10-17 12:54:05 +02:00
parent 89a1e7978c
commit 0f9e15fc37
6 changed files with 19 additions and 19 deletions

View File

@ -37,7 +37,7 @@ func TestDowngradeUpgradeClusterOf3(t *testing.T) {
}
func testDowngradeUpgrade(t *testing.T, clusterSize int) {
currentEtcdBinary := e2e.BinDir + "/etcd"
currentEtcdBinary := e2e.BinPath.Etcd
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)

View File

@ -51,7 +51,7 @@ func TestClusterVersion(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
binary := e2e.BinDir + "/etcd"
binary := e2e.BinPath.Etcd
if !fileutil.Exist(binary) {
t.Skipf("%q does not exist", binary)
}

View File

@ -30,7 +30,7 @@ const exampleConfigFile = "../../etcd.conf.yml.sample"
func TestEtcdExampleConfig(t *testing.T) {
e2e.SkipInShortMode(t)
proc, err := e2e.SpawnCmd([]string{e2e.BinDir + "/etcd", "--config-file", exampleConfigFile}, nil)
proc, err := e2e.SpawnCmd([]string{e2e.BinPath.Etcd, "--config-file", exampleConfigFile}, nil)
if err != nil {
t.Fatal(err)
}
@ -62,7 +62,7 @@ func TestEtcdMultiPeer(t *testing.T) {
}()
for i := range procs {
args := []string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"--name", fmt.Sprintf("e%d", i),
"--listen-client-urls", "http://0.0.0.0:0",
"--data-dir", tmpdirs[i],
@ -92,7 +92,7 @@ func TestEtcdUnixPeers(t *testing.T) {
d := t.TempDir()
proc, err := e2e.SpawnCmd(
[]string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"--data-dir", d,
"--name", "e1",
"--listen-peer-urls", "unix://etcd.unix:1",
@ -135,7 +135,7 @@ func TestEtcdPeerCNAuth(t *testing.T) {
// node 0 and 1 have a cert with the correct CN, node 2 doesn't
for i := range procs {
commonArgs := []string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"--name", fmt.Sprintf("e%d", i),
"--listen-client-urls", "http://0.0.0.0:0",
"--data-dir", tmpdirs[i],
@ -214,7 +214,7 @@ func TestEtcdPeerNameAuth(t *testing.T) {
// node 0 and 1 have a cert with the correct certificate name, node 2 doesn't
for i := range procs {
commonArgs := []string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"--name", fmt.Sprintf("e%d", i),
"--listen-client-urls", "http://0.0.0.0:0",
"--data-dir", tmpdirs[i],
@ -269,7 +269,7 @@ func TestGrpcproxyAndCommonName(t *testing.T) {
e2e.SkipInShortMode(t)
argsWithNonEmptyCN := []string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"grpc-proxy",
"start",
"--cert", e2e.CertPath2,
@ -278,7 +278,7 @@ func TestGrpcproxyAndCommonName(t *testing.T) {
}
argsWithEmptyCN := []string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"grpc-proxy",
"start",
"--cert", e2e.CertPath3,
@ -313,7 +313,7 @@ func TestGrpcproxyAndListenCipherSuite(t *testing.T) {
{
name: "ArgsWithCipherSuites",
args: []string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"grpc-proxy",
"start",
"--listen-cipher-suites", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
@ -322,7 +322,7 @@ func TestGrpcproxyAndListenCipherSuite(t *testing.T) {
{
name: "ArgsWithoutCipherSuites",
args: []string{
e2e.BinDir + "/etcd",
e2e.BinPath.Etcd,
"grpc-proxy",
"start",
"--listen-cipher-suites", "",
@ -346,7 +346,7 @@ func TestGrpcproxyAndListenCipherSuite(t *testing.T) {
func TestBootstrapDefragFlag(t *testing.T) {
e2e.SkipInShortMode(t)
proc, err := e2e.SpawnCmd([]string{e2e.BinDir + "/etcd", "--experimental-bootstrap-defrag-threshold-megabytes", "1000"}, nil)
proc, err := e2e.SpawnCmd([]string{e2e.BinPath.Etcd, "--experimental-bootstrap-defrag-threshold-megabytes", "1000"}, nil)
if err != nil {
t.Fatal(err)
}

View File

@ -49,7 +49,7 @@ func TestGrpcProxyAutoSync(t *testing.T) {
)
// Run independent grpc-proxy instance
proxyProc, err := e2e.SpawnCmd([]string{e2e.BinDir + "/etcd", "grpc-proxy", "start",
proxyProc, err := e2e.SpawnCmd([]string{e2e.BinPath.Etcd, "grpc-proxy", "start",
"--advertise-client-url", proxyClientURL, "--listen-addr", proxyClientURL,
"--endpoints", node1ClientURL,
"--endpoints-auto-sync-interval", "1s",

View File

@ -76,7 +76,7 @@ func TestReleaseUpgrade(t *testing.T) {
t.Fatalf("#%d: error closing etcd process (%v)", i, err)
}
t.Logf("Stopped node: %v", i)
epc.Procs[i].Config().ExecPath = e2e.BinDir + "/etcd"
epc.Procs[i].Config().ExecPath = e2e.BinPath.Etcd
epc.Procs[i].Config().KeepDataDir = true
t.Logf("Restarting node in the new version: %v", i)
@ -162,7 +162,7 @@ func TestReleaseUpgradeWithRestart(t *testing.T) {
wg.Add(len(epc.Procs))
for i := range epc.Procs {
go func(i int) {
epc.Procs[i].Config().ExecPath = e2e.BinDir + "/etcd"
epc.Procs[i].Config().ExecPath = e2e.BinPath.Etcd
epc.Procs[i].Config().KeepDataDir = true
if err := epc.Procs[i].Restart(context.TODO()); err != nil {
t.Errorf("error restarting etcd process (%v)", err)

View File

@ -55,7 +55,7 @@ func createV2store(t testing.TB, lastReleaseBinary string, dataDirPath string) {
func assertVerifyCannotStartV2deprecationWriteOnly(t testing.TB, dataDirPath string) {
t.Log("Verify its infeasible to start etcd with --v2-deprecation=write-only mode")
proc, err := e2e.SpawnCmd([]string{e2e.BinDir + "/etcd", "--v2-deprecation=write-only", "--data-dir=" + dataDirPath}, nil)
proc, err := e2e.SpawnCmd([]string{e2e.BinPath.Etcd, "--v2-deprecation=write-only", "--data-dir=" + dataDirPath}, nil)
assert.NoError(t, err)
_, err = proc.Expect("detected disallowed custom content in v2store for stage --v2-deprecation=write-only")
@ -64,7 +64,7 @@ func assertVerifyCannotStartV2deprecationWriteOnly(t testing.TB, dataDirPath str
func assertVerifyCannotStartV2deprecationNotYet(t testing.TB, dataDirPath string) {
t.Log("Verify its infeasible to start etcd with --v2-deprecation=not-yet mode")
proc, err := e2e.SpawnCmd([]string{e2e.BinDir + "/etcd", "--v2-deprecation=not-yet", "--data-dir=" + dataDirPath}, nil)
proc, err := e2e.SpawnCmd([]string{e2e.BinPath.Etcd, "--v2-deprecation=not-yet", "--data-dir=" + dataDirPath}, nil)
assert.NoError(t, err)
_, err = proc.Expect(`invalid value "not-yet" for flag -v2-deprecation: invalid value "not-yet"`)
@ -102,7 +102,7 @@ func TestV2DeprecationSnapshotMatches(t *testing.T) {
defer cancel()
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
currentReleaseBinary := e2e.BinDir + "/etcd"
currentReleaseBinary := e2e.BinPath.Etcd
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)
@ -137,7 +137,7 @@ func TestV2DeprecationSnapshotRecover(t *testing.T) {
defer cancel()
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
currentReleaseBinary := e2e.BinDir + "/etcd"
currentReleaseBinary := e2e.BinPath.Etcd
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)