From 02abbb6a6c7a7aef6e4ca4971fbbe00e841bd059 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sun, 3 Nov 2013 15:49:00 -0700 Subject: [PATCH] Migration test. --- release_version.go | 2 + tests/fixtures/v1/README | 14 +++++++ tests/fixtures/v1/complete.1.sh | 4 ++ tests/fixtures/v1/complete.2.sh | 3 ++ tests/fixtures/v1/complete.3.sh | 3 ++ tests/fixtures/v1/complete.4.sh | 12 ++++++ tests/fixtures/v1/complete/conf | 1 + tests/fixtures/v1/complete/info | 18 +++++++++ tests/fixtures/v1/complete/log | Bin 0 -> 1289 bytes tests/functional/v1_migration_test.go | 51 ++++++++++++++++++++++++++ 10 files changed, 108 insertions(+) create mode 100644 release_version.go create mode 100644 tests/fixtures/v1/README create mode 100644 tests/fixtures/v1/complete.1.sh create mode 100644 tests/fixtures/v1/complete.2.sh create mode 100644 tests/fixtures/v1/complete.3.sh create mode 100644 tests/fixtures/v1/complete.4.sh create mode 100644 tests/fixtures/v1/complete/conf create mode 100644 tests/fixtures/v1/complete/info create mode 100644 tests/fixtures/v1/complete/log create mode 100644 tests/functional/v1_migration_test.go diff --git a/release_version.go b/release_version.go new file mode 100644 index 000000000..5285c9763 --- /dev/null +++ b/release_version.go @@ -0,0 +1,2 @@ +package main +const releaseVersion = "v0.1.2-33-g1a2a9d6" diff --git a/tests/fixtures/v1/README b/tests/fixtures/v1/README new file mode 100644 index 000000000..0940522bb --- /dev/null +++ b/tests/fixtures/v1/README @@ -0,0 +1,14 @@ +README + +The scripts in this directory should be run from the project root: + +$ cd $GOPATH/src/github.com/coreos/etcd +$ tests/fixtures/v1/complete.1.sh + +Scripts with numbers should be run in separate terminal windows (in order): + +$ tests/fixtures/v1/complete.1.sh +$ tests/fixtures/v1/complete.2.sh +$ tests/fixtures/v1/complete.3.sh + +The resulting server state data can be found in tmp/node0. diff --git a/tests/fixtures/v1/complete.1.sh b/tests/fixtures/v1/complete.1.sh new file mode 100644 index 000000000..ee77deaed --- /dev/null +++ b/tests/fixtures/v1/complete.1.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +./build +./etcd -d tmp/node0 -n node0 diff --git a/tests/fixtures/v1/complete.2.sh b/tests/fixtures/v1/complete.2.sh new file mode 100644 index 000000000..1b067eb2b --- /dev/null +++ b/tests/fixtures/v1/complete.2.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./etcd -s 127.0.0.1:7002 -c 127.0.0.1:4002 -C 127.0.0.1:7001 -d tmp/node2 -n node2 diff --git a/tests/fixtures/v1/complete.3.sh b/tests/fixtures/v1/complete.3.sh new file mode 100644 index 000000000..a1c9c6b3e --- /dev/null +++ b/tests/fixtures/v1/complete.3.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./etcd -s 127.0.0.1:7003 -c 127.0.0.1:4003 -C 127.0.0.1:7001 -d tmp/node3 -n node3 diff --git a/tests/fixtures/v1/complete.4.sh b/tests/fixtures/v1/complete.4.sh new file mode 100644 index 000000000..b228b1a1d --- /dev/null +++ b/tests/fixtures/v1/complete.4.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +curl -L http://127.0.0.1:4001/v1/keys/message -d value="Hello world" +curl -L http://127.0.0.1:4001/v1/keys/message -d value="Hello etcd" +curl -L http://127.0.0.1:4001/v1/keys/message -X DELETE +curl -L http://127.0.0.1:4001/v1/keys/foo -d value=bar -d ttl=5 +curl -L http://127.0.0.1:4001/v1/keys/foo -d value=one +curl -L http://127.0.0.1:4001/v1/keys/foo -d prevValue=two -d value=three +curl -L http://127.0.0.1:4001/v1/keys/foo -d prevValue=one -d value=two +curl -L http://127.0.0.1:4001/v1/keys/bar -d prevValue= -d value=four +curl -L http://127.0.0.1:4001/v1/keys/bar -d prevValue= -d value=five +curl -X DELETE http://127.0.0.1:4001/v1/keys/_etcd/machines diff --git a/tests/fixtures/v1/complete/conf b/tests/fixtures/v1/complete/conf new file mode 100644 index 000000000..827bb86d1 --- /dev/null +++ b/tests/fixtures/v1/complete/conf @@ -0,0 +1 @@ +{"commitIndex":13,"peers":[]} \ No newline at end of file diff --git a/tests/fixtures/v1/complete/info b/tests/fixtures/v1/complete/info new file mode 100644 index 000000000..398c8e1e8 --- /dev/null +++ b/tests/fixtures/v1/complete/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/complete/log b/tests/fixtures/v1/complete/log new file mode 100644 index 0000000000000000000000000000000000000000..5ed55603d845adc26e3651e53fabe6cc9cf59427 GIT binary patch literal 1289 zcmbu9&rjPh6vr8C!k^$hq!loeclV)6;9^=T3bHjLlU+JhL@m6sprNRgTEQ#n+#9v+u@;u;d z6%{dBGA`_JGHeuQYcyO7t-y(&V{r#hNE|>_CD(wAQIg-2sw2pA>pj>qPl^0E%t|=V zYQd^!dcHz8>Rd&!l=%3PUS0$k$=Syl(#dNi($pTLL(V=SXtTDILJkhZw|UkyFJYgv z&oi=qOhfzDHq8G?%6TnXs=!yWHXX)Y69-t(gFtsf6Gpx?P5U9LTA$$@F6P*RQrR)Tm4l4J(NYAjEzZXN?O$mfKDPeT^TwV7-c3XlCZmW$&;9pC?HKd7slV5Yi z8DE6Gm|`d8n(o}by{GCmxo_}_(9Jf`Y&4(a_E731Ul979PNEU}|4u>?v~`wu68&