diff --git a/tests/fixtures/v1/node0/conf b/tests/fixtures/v1/node0/conf new file mode 100644 index 000000000..8f401dbe4 --- /dev/null +++ b/tests/fixtures/v1/node0/conf @@ -0,0 +1 @@ +{"commitIndex":15,"peers":[{"name":"node2","connectionString":""}]} \ No newline at end of file diff --git a/tests/fixtures/v1/node0/info b/tests/fixtures/v1/node0/info new file mode 100644 index 000000000..398c8e1e8 --- /dev/null +++ b/tests/fixtures/v1/node0/info @@ -0,0 +1,18 @@ +{ + "name": "node0", + "raftURL": "http://127.0.0.1:7001", + "etcdURL": "http://127.0.0.1:4001", + "webURL": "", + "raftListenHost": "127.0.0.1:7001", + "etcdListenHost": "127.0.0.1:4001", + "raftTLS": { + "CertFile": "", + "KeyFile": "", + "CAFile": "" + }, + "etcdTLS": { + "CertFile": "", + "KeyFile": "", + "CAFile": "" + } +} diff --git a/tests/fixtures/v1/node0/log b/tests/fixtures/v1/node0/log new file mode 100644 index 000000000..de3e7075e Binary files /dev/null and b/tests/fixtures/v1/node0/log differ diff --git a/tests/fixtures/v1/node2/conf b/tests/fixtures/v1/node2/conf new file mode 100644 index 000000000..19d6a9c92 --- /dev/null +++ b/tests/fixtures/v1/node2/conf @@ -0,0 +1 @@ +{"commitIndex":15,"peers":[{"name":"node0","connectionString":""}]} \ No newline at end of file diff --git a/tests/fixtures/v1/node2/info b/tests/fixtures/v1/node2/info new file mode 100644 index 000000000..85114a5f8 --- /dev/null +++ b/tests/fixtures/v1/node2/info @@ -0,0 +1,18 @@ +{ + "name": "node2", + "raftURL": "http://127.0.0.1:7002", + "etcdURL": "http://127.0.0.1:4002", + "webURL": "", + "raftListenHost": "127.0.0.1:7002", + "etcdListenHost": "127.0.0.1:4002", + "raftTLS": { + "CertFile": "", + "KeyFile": "", + "CAFile": "" + }, + "etcdTLS": { + "CertFile": "", + "KeyFile": "", + "CAFile": "" + } +} diff --git a/tests/fixtures/v1/node2/log b/tests/fixtures/v1/node2/log new file mode 100644 index 000000000..de3e7075e Binary files /dev/null and b/tests/fixtures/v1/node2/log differ diff --git a/tests/fixtures/v1/node3/conf b/tests/fixtures/v1/node3/conf new file mode 100644 index 000000000..d8a5840de --- /dev/null +++ b/tests/fixtures/v1/node3/conf @@ -0,0 +1 @@ +{"commitIndex":15,"peers":[{"name":"node0","connectionString":""},{"name":"node2","connectionString":""}]} \ No newline at end of file diff --git a/tests/fixtures/v1/node3/info b/tests/fixtures/v1/node3/info new file mode 100644 index 000000000..5e5cb3f3a --- /dev/null +++ b/tests/fixtures/v1/node3/info @@ -0,0 +1,18 @@ +{ + "name": "node3", + "raftURL": "http://127.0.0.1:7003", + "etcdURL": "http://127.0.0.1:4003", + "webURL": "", + "raftListenHost": "127.0.0.1:7003", + "etcdListenHost": "127.0.0.1:4003", + "raftTLS": { + "CertFile": "", + "KeyFile": "", + "CAFile": "" + }, + "etcdTLS": { + "CertFile": "", + "KeyFile": "", + "CAFile": "" + } +} diff --git a/tests/fixtures/v1/node3/log b/tests/fixtures/v1/node3/log new file mode 100644 index 000000000..de3e7075e Binary files /dev/null and b/tests/fixtures/v1/node3/log differ diff --git a/tests/functional/v1_migration_test.go b/tests/functional/v1_migration_test.go index f5d76fee5..b4c9a07bc 100644 --- a/tests/functional/v1_migration_test.go +++ b/tests/functional/v1_migration_test.go @@ -19,13 +19,19 @@ func TestV1Migration(t *testing.T) { os.RemoveAll(path) defer os.RemoveAll(path) - nodes := []string{"node0", "node1"} + nodes := []string{"node0", "node2"} for i, node := range nodes { nodepath := filepath.Join(path, node) + fixturepath, _ := filepath.Abs(filepath.Join("../fixtures/v1/", node)) + fmt.Println("FIXPATH =", fixturepath) + fmt.Println("NODEPATH =", nodepath) + os.MkdirAll(filepath.Dir(nodepath), 0777) // Copy over fixture files. - if err := exec.Command("cp", "-r", "../fixtures/v1/" + node, nodepath).Run(); err != nil { - panic("Fixture initialization error") + c := exec.Command("cp", "-rf", fixturepath, nodepath) + if out, err := c.CombinedOutput(); err != nil { + fmt.Println(">>>>>>\n", string(out), "<<<<<<") + panic("Fixture initialization error:" + err.Error()) } procAttr := new(os.ProcAttr) @@ -43,6 +49,7 @@ func TestV1Migration(t *testing.T) { time.Sleep(time.Second) } + time.Sleep(120 * time.Second) // Ensure deleted message is removed. resp, err := tests.Get("http://localhost:4001/v2/keys/message")