Files
etcd/tests/functional/cmd/etcd-tester/etcd_tester_test.go
Bogdan Kanivets c31d758189 functional: remove SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT command
Problem: both SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT and test.sh
will attempt to stop agents and remove directories.

Solution: since test.sh creates directories and starts test, it should be
responsible for cleanup.

See https://github.com/etcd-io/etcd/issues/14384

Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
2022-09-15 10:55:32 -07:00

52 lines
1.5 KiB
Go

// Copyright 2018 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// etcd-tester is a program that runs functional-tester client.
package main
import (
"flag"
"testing"
"go.etcd.io/etcd/client/pkg/v3/testutil"
"go.etcd.io/etcd/tests/v3/functional/tester"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"go.uber.org/zap/zaptest"
)
var config = flag.String("config", "../../functional.yaml", "path to tester configuration")
func TestFunctional(t *testing.T) {
testutil.SkipTestIfShortMode(t, "functional tests are skipped in --short mode")
lg := zaptest.NewLogger(t, zaptest.Level(zapcore.InfoLevel)).Named("tester")
clus, err := tester.NewCluster(lg, *config)
if err != nil {
t.Fatalf("failed to create a cluster: %v", err)
}
if err = clus.Send_INITIAL_START_ETCD(); err != nil {
t.Fatal("Bootstrap failed", zap.Error(err))
}
t.Log("wait health after bootstrap")
if err = clus.WaitHealth(); err != nil {
t.Fatal("WaitHealth failed", zap.Error(err))
}
clus.Run(t)
}