mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
integration/fixtures: Move the 'tests/integration/fixtures' directory up and update references.
I moved the files up as they are shared between e2e & integrational tests.
This commit is contained in:
parent
bb9703820c
commit
be4e8b7013
@ -64,7 +64,7 @@ The command should show that the handshake succeed. Since we use self-signed cer
|
||||
|
||||
**OSX 10.9+ Users**: curl 7.30.0 on OSX 10.9+ doesn't understand certificates passed in on the command line.
|
||||
Instead, import the dummy ca.crt directly into the keychain or add the `-k` flag to curl to ignore errors.
|
||||
To test without the `-k` flag, run `open ./fixtures/ca/ca.crt` and follow the prompts.
|
||||
To test without the `-k` flag, run `open ./tests/fixtures/ca/ca.crt` and follow the prompts.
|
||||
Please remove this certificate after testing!
|
||||
If there is a workaround, let us know.
|
||||
|
||||
|
@ -23,11 +23,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
jwtRSAPubKey = "../integration/fixtures/server.crt"
|
||||
jwtRSAPrivKey = "../integration/fixtures/server.key.insecure"
|
||||
jwtRSAPubKey = "../tests/fixtures/server.crt"
|
||||
jwtRSAPrivKey = "../tests/fixtures/server.key.insecure"
|
||||
|
||||
jwtECPubKey = "../integration/fixtures/server-ecdsa.crt"
|
||||
jwtECPrivKey = "../integration/fixtures/server-ecdsa.key.insecure"
|
||||
jwtECPubKey = "../tests/fixtures/server-ecdsa.crt"
|
||||
jwtECPrivKey = "../tests/fixtures/server-ecdsa.key.insecure"
|
||||
)
|
||||
|
||||
func TestJWTInfo(t *testing.T) {
|
||||
|
@ -25,9 +25,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
certPath = "../../tests/integration/fixtures/server.crt"
|
||||
privateKeyPath = "../../tests/integration/fixtures/server.key.insecure"
|
||||
caPath = "../../tests/integration/fixtures/ca.crt"
|
||||
certPath = "../../tests/fixtures/server.crt"
|
||||
privateKeyPath = "../../tests/fixtures/server.key.insecure"
|
||||
caPath = "../../tests/fixtures/ca.crt"
|
||||
)
|
||||
|
||||
func TestConfigFromFile(t *testing.T) {
|
||||
|
@ -38,9 +38,9 @@ import (
|
||||
var testLogger = zap.NewExample()
|
||||
|
||||
var testTLSInfo = transport.TLSInfo{
|
||||
KeyFile: "./fixtures/server.key.insecure",
|
||||
CertFile: "./fixtures/server.crt",
|
||||
TrustedCAFile: "./fixtures/ca.crt",
|
||||
KeyFile: "../../tests/fixtures/server.key.insecure",
|
||||
CertFile: "../../tests/fixtures/server.crt",
|
||||
TrustedCAFile: "../../tests/fixtures/ca.crt",
|
||||
ClientCertAuth: true,
|
||||
}
|
||||
|
||||
|
@ -267,10 +267,10 @@ func newProxyV3Proc(cfg *etcdServerProcessConfig) *proxyV3Proc {
|
||||
// Configure certificates for connection proxy ---> server.
|
||||
// This certificate must NOT have CN set.
|
||||
tlsArgs = append(tlsArgs,
|
||||
"--cert", "../../integration/fixtures/client-nocn.crt",
|
||||
"--key", "../../integration/fixtures/client-nocn.key.insecure",
|
||||
"--cacert", "../../integration/fixtures/ca.crt",
|
||||
"--client-crl-file", "../../integration/fixtures/revoke.crl")
|
||||
"--cert", "../fixtures/client-nocn.crt",
|
||||
"--key", "../fixtures/client-nocn.key.insecure",
|
||||
"--cacert", "../fixtures/ca.crt",
|
||||
"--client-crl-file", "../fixtures/revoke.crl")
|
||||
}
|
||||
return &proxyV3Proc{
|
||||
proxyProc{
|
||||
|
@ -90,7 +90,7 @@ var (
|
||||
configJWT = etcdProcessClusterConfig{
|
||||
clusterSize: 1,
|
||||
initialToken: "new",
|
||||
authTokenOpts: "jwt,pub-key=../../integration/fixtures/server.crt,priv-key=../../integration/fixtures/server.key.insecure,sign-method=RS256,ttl=1s",
|
||||
authTokenOpts: "jwt,pub-key=../fixtures/server.crt,priv-key=../fixtures/server.key.insecure,sign-method=RS256,ttl=1s",
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -37,7 +37,7 @@ func TestMain(m *testing.M) {
|
||||
os.Unsetenv("ETCDCTL_API")
|
||||
|
||||
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.StringVar(&certDir, "cert-dir", "../fixtures", "The directory for store certificate files.")
|
||||
flag.Parse()
|
||||
|
||||
binPath = binDir + "/etcd"
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
// +build !cluster_proxy
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -31,16 +31,16 @@ import (
|
||||
|
||||
var (
|
||||
testTLSInfo = transport.TLSInfo{
|
||||
KeyFile: "../../integration/fixtures/server.key.insecure",
|
||||
CertFile: "../../integration/fixtures/server.crt",
|
||||
TrustedCAFile: "../../integration/fixtures/ca.crt",
|
||||
KeyFile: "../../fixtures/server.key.insecure",
|
||||
CertFile: "../../fixtures/server.crt",
|
||||
TrustedCAFile: "../../fixtures/ca.crt",
|
||||
ClientCertAuth: true,
|
||||
}
|
||||
|
||||
testTLSInfoExpired = transport.TLSInfo{
|
||||
KeyFile: "../../integration/fixtures-expired/server.key.insecure",
|
||||
CertFile: "../../integration/fixtures-expired/server.crt",
|
||||
TrustedCAFile: "../../integration/fixtures-expired/ca.crt",
|
||||
KeyFile: "../fixtures-expired/server.key.insecure",
|
||||
CertFile: "../fixtures-expired/server.crt",
|
||||
TrustedCAFile: "../fixtures-expired/ca.crt",
|
||||
ClientCertAuth: true,
|
||||
}
|
||||
)
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package clientv3_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package naming_test
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
// +build !cluster_proxy
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package ordering
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -21,6 +21,7 @@ import (
|
||||
|
||||
"go.etcd.io/etcd/tests/v3/integration"
|
||||
"go.etcd.io/etcd/v3/clientv3"
|
||||
"go.etcd.io/etcd/v3/clientv3/ordering"
|
||||
"go.etcd.io/etcd/v3/pkg/testutil"
|
||||
)
|
||||
|
||||
@ -38,6 +39,7 @@ func TestEndpointSwitchResolvesViolation(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer cli.Close()
|
||||
|
||||
ctx := context.TODO()
|
||||
|
||||
@ -64,7 +66,7 @@ func TestEndpointSwitchResolvesViolation(t *testing.T) {
|
||||
// NewOrderViolationSwitchEndpointClosure will be able to
|
||||
// access the full list of endpoints.
|
||||
cli.SetEndpoints(eps...)
|
||||
OrderingKv := NewKV(cli.KV, NewOrderViolationSwitchEndpointClosure(*cli))
|
||||
OrderingKv := ordering.NewKV(cli.KV, ordering.NewOrderViolationSwitchEndpointClosure(*cli))
|
||||
// set prevRev to the second member's revision of "foo" such that
|
||||
// the revision is higher than the third member's revision of "foo"
|
||||
_, err = OrderingKv.Get(ctx, "foo")
|
||||
@ -97,6 +99,7 @@ func TestUnresolvableOrderViolation(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer cli.Close()
|
||||
eps := cli.Endpoints()
|
||||
ctx := context.TODO()
|
||||
|
||||
@ -123,7 +126,7 @@ func TestUnresolvableOrderViolation(t *testing.T) {
|
||||
// access the full list of endpoints.
|
||||
cli.SetEndpoints(eps...)
|
||||
time.Sleep(1 * time.Second) // give enough time for operation
|
||||
OrderingKv := NewKV(cli.KV, NewOrderViolationSwitchEndpointClosure(*cli))
|
||||
OrderingKv := ordering.NewKV(cli.KV, ordering.NewOrderViolationSwitchEndpointClosure(*cli))
|
||||
// set prevRev to the first member's revision of "foo" such that
|
||||
// the revision is higher than the fourth and fifth members' revision of "foo"
|
||||
_, err = OrderingKv.Get(ctx, "foo")
|
||||
@ -147,7 +150,7 @@ func TestUnresolvableOrderViolation(t *testing.T) {
|
||||
time.Sleep(5 * time.Second) // give enough time for operation
|
||||
|
||||
_, err = OrderingKv.Get(ctx, "foo", clientv3.WithSerializable())
|
||||
if err != ErrNoGreaterRev {
|
||||
t.Fatalf("expected %v, got %v", ErrNoGreaterRev, err)
|
||||
if err != ordering.ErrNoGreaterRev {
|
||||
t.Fatalf("expected %v, got %v", ordering.ErrNoGreaterRev, err)
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
// +build !cluster_proxy
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package integration
|
||||
package clientv3test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -81,16 +81,16 @@ var (
|
||||
localListenCount = int64(0)
|
||||
|
||||
testTLSInfo = transport.TLSInfo{
|
||||
KeyFile: "./fixtures/server.key.insecure",
|
||||
CertFile: "./fixtures/server.crt",
|
||||
TrustedCAFile: "./fixtures/ca.crt",
|
||||
KeyFile: "../fixtures/server.key.insecure",
|
||||
CertFile: "../fixtures/server.crt",
|
||||
TrustedCAFile: "../fixtures/ca.crt",
|
||||
ClientCertAuth: true,
|
||||
}
|
||||
|
||||
testTLSInfoIP = transport.TLSInfo{
|
||||
KeyFile: "./fixtures/server-ip.key.insecure",
|
||||
CertFile: "./fixtures/server-ip.crt",
|
||||
TrustedCAFile: "./fixtures/ca.crt",
|
||||
KeyFile: "../fixtures/server-ip.key.insecure",
|
||||
CertFile: "../fixtures/server-ip.crt",
|
||||
TrustedCAFile: "../fixtures/ca.crt",
|
||||
ClientCertAuth: true,
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ var (
|
||||
ClientCertAuth: true,
|
||||
}
|
||||
|
||||
defaultTokenJWT = "jwt,pub-key=./fixtures/server.crt,priv-key=./fixtures/server.key.insecure,sign-method=RS256,ttl=1s"
|
||||
defaultTokenJWT = "jwt,pub-key=../fixtures/server.crt,priv-key=../fixtures/server.key.insecure,sign-method=RS256,ttl=1s"
|
||||
|
||||
lg = zap.NewNop()
|
||||
)
|
||||
|
@ -37,9 +37,9 @@ import (
|
||||
|
||||
var (
|
||||
testTLSInfo = transport.TLSInfo{
|
||||
KeyFile: "../fixtures/server.key.insecure",
|
||||
CertFile: "../fixtures/server.crt",
|
||||
TrustedCAFile: "../fixtures/ca.crt",
|
||||
KeyFile: "../../fixtures/server.key.insecure",
|
||||
CertFile: "../../fixtures/server.crt",
|
||||
TrustedCAFile: "../../fixtures/ca.crt",
|
||||
ClientCertAuth: true,
|
||||
}
|
||||
)
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
"go.etcd.io/etcd/tests/v3/integration"
|
||||
"go.etcd.io/etcd/v3/clientv3"
|
||||
"go.etcd.io/etcd/v3/pkg/testutil"
|
||||
"go.etcd.io/etcd/v3/proxy/grpcproxy"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"google.golang.org/grpc"
|
||||
@ -114,8 +115,8 @@ func newClusterProxyServer(lg *zap.Logger, endpoints []string, t *testing.T) *cl
|
||||
cts.server.Serve(cts.l)
|
||||
}()
|
||||
|
||||
Register(lg, client, "test-prefix", cts.l.Addr().String(), 7)
|
||||
cts.cp, cts.donec = NewClusterProxy(lg, client, cts.l.Addr().String(), "test-prefix")
|
||||
grpcproxy.Register(lg, client, "test-prefix", cts.l.Addr().String(), 7)
|
||||
cts.cp, cts.donec = grpcproxy.NewClusterProxy(lg, client, cts.l.Addr().String(), "test-prefix")
|
||||
cts.caddr = cts.l.Addr().String()
|
||||
pb.RegisterClusterServer(cts.server, cts.cp)
|
||||
close(servec)
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
"go.etcd.io/etcd/tests/v3/integration"
|
||||
"go.etcd.io/etcd/v3/clientv3"
|
||||
"go.etcd.io/etcd/v3/pkg/testutil"
|
||||
"go.etcd.io/etcd/v3/proxy/grpcproxy"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
@ -76,7 +77,7 @@ func newKVProxyServer(endpoints []string, t *testing.T) *kvproxyTestServer {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
kvp, _ := NewKvProxy(client)
|
||||
kvp, _ := grpcproxy.NewKvProxy(client)
|
||||
|
||||
kvts := &kvproxyTestServer{
|
||||
kp: kvp,
|
||||
|
@ -22,6 +22,7 @@ import (
|
||||
"go.etcd.io/etcd/v3/clientv3"
|
||||
"go.etcd.io/etcd/v3/clientv3/naming"
|
||||
"go.etcd.io/etcd/v3/pkg/testutil"
|
||||
"go.etcd.io/etcd/v3/proxy/grpcproxy"
|
||||
|
||||
"go.uber.org/zap"
|
||||
gnaming "google.golang.org/grpc/naming"
|
||||
@ -45,7 +46,7 @@ func TestRegister(t *testing.T) {
|
||||
t.Fatalf("len(ups) expected 0, got %d (%v)", len(ups), ups)
|
||||
}
|
||||
|
||||
donec := Register(zap.NewExample(), cli, testPrefix, paddr, 5)
|
||||
donec := grpcproxy.Register(zap.NewExample(), cli, testPrefix, paddr, 5)
|
||||
|
||||
ups, err = wa.Next()
|
||||
if err != nil {
|
||||
|
@ -26,6 +26,7 @@ import (
|
||||
"time"
|
||||
|
||||
"go.etcd.io/etcd/v3/clientv3"
|
||||
"go.etcd.io/etcd/v3/clientv3/snapshot"
|
||||
"go.etcd.io/etcd/v3/embed"
|
||||
"go.etcd.io/etcd/v3/pkg/fileutil"
|
||||
"go.etcd.io/etcd/v3/pkg/testutil"
|
||||
@ -55,12 +56,12 @@ func TestSnapshotV3RestoreSingle(t *testing.T) {
|
||||
cfg.InitialCluster = fmt.Sprintf("%s=%s", cfg.Name, pURLs[0].String())
|
||||
cfg.Dir = filepath.Join(os.TempDir(), fmt.Sprint(time.Now().Nanosecond()))
|
||||
|
||||
sp := NewV3(zap.NewExample())
|
||||
sp := snapshot.NewV3(zap.NewExample())
|
||||
pss := make([]string, 0, len(pURLs))
|
||||
for _, p := range pURLs {
|
||||
pss = append(pss, p.String())
|
||||
}
|
||||
if err := sp.Restore(RestoreConfig{
|
||||
if err := sp.Restore(snapshot.RestoreConfig{
|
||||
SnapshotPath: dbPath,
|
||||
Name: cfg.Name,
|
||||
OutputDataDir: cfg.Dir,
|
||||
@ -168,7 +169,7 @@ func TestCorruptedBackupFileCheck(t *testing.T) {
|
||||
t.Fatalf("test file [%s] does not exist: %v", dbPath, err)
|
||||
}
|
||||
|
||||
sp := NewV3(zap.NewExample())
|
||||
sp := snapshot.NewV3(zap.NewExample())
|
||||
_, err := sp.Status(dbPath)
|
||||
expectedErrKeywords := "snapshot file integrity check failed"
|
||||
/* example error message:
|
||||
@ -236,7 +237,7 @@ func createSnapshotFile(t *testing.T, kvs []kv) string {
|
||||
}
|
||||
}
|
||||
|
||||
sp := NewV3(zap.NewExample())
|
||||
sp := snapshot.NewV3(zap.NewExample())
|
||||
dpPath := filepath.Join(os.TempDir(), fmt.Sprintf("snapshot%d.db", time.Now().Nanosecond()))
|
||||
if err = sp.Save(context.Background(), ccfg, dpPath); err != nil {
|
||||
t.Fatal(err)
|
||||
@ -275,8 +276,8 @@ func restoreCluster(t *testing.T, clusterN int, dbPath string) (
|
||||
cfg.InitialCluster = ics
|
||||
cfg.Dir = filepath.Join(os.TempDir(), fmt.Sprint(time.Now().Nanosecond()+i))
|
||||
|
||||
sp := NewV3(zap.NewExample())
|
||||
if err := sp.Restore(RestoreConfig{
|
||||
sp := snapshot.NewV3(zap.NewExample())
|
||||
if err := sp.Restore(snapshot.RestoreConfig{
|
||||
SnapshotPath: dbPath,
|
||||
Name: cfg.Name,
|
||||
OutputDataDir: cfg.Dir,
|
||||
|
Loading…
x
Reference in New Issue
Block a user