e2e: etcdctlv3 with serializable read

This commit is contained in:
Gyu-Ho Lee 2016-03-22 15:49:08 -07:00
parent 5686340d26
commit a10662210a

View File

@ -23,6 +23,22 @@ import (
"github.com/coreos/etcd/pkg/testutil" "github.com/coreos/etcd/pkg/testutil"
) )
func TestCtlV3Set(t *testing.T) {
testCtlV3Set(t, &configNoTLS, 3*time.Second, false)
}
func TestCtlV3SetZeroTimeout(t *testing.T) {
testCtlV3Set(t, &configNoTLS, 0, false)
}
func TestCtlV3SetTimeout(t *testing.T) {
testCtlV3Set(t, &configNoTLS, time.Nanosecond, false)
}
func TestCtlV3SetPeerTLS(t *testing.T) {
testCtlV3Set(t, &configPeerTLS, 3*time.Second, false)
}
func TestCtlV3SetQuorum(t *testing.T) { func TestCtlV3SetQuorum(t *testing.T) {
testCtlV3Set(t, &configNoTLS, 3*time.Second, true) testCtlV3Set(t, &configNoTLS, 3*time.Second, true)
} }
@ -105,12 +121,10 @@ func ctlV3Put(clus *etcdProcessCluster, key, value string, dialTimeout time.Dura
} }
func ctlV3Get(clus *etcdProcessCluster, key, value string, dialTimeout time.Duration, quorum bool) error { func ctlV3Get(clus *etcdProcessCluster, key, value string, dialTimeout time.Duration, quorum bool) error {
if !quorum { // TODO: add serialized option
panic("serialized option is not implemented")
}
cmdArgs := append(ctlV3PrefixArgs(clus, dialTimeout), "get", key) cmdArgs := append(ctlV3PrefixArgs(clus, dialTimeout), "get", key)
if !quorum {
cmdArgs = append(cmdArgs, "--consistency", "s")
}
// TODO: match by value. Currently it prints out both key and value in multi-lines. // TODO: match by value. Currently it prints out both key and value in multi-lines.
return spawnWithExpectedString(cmdArgs, key) return spawnWithExpectedString(cmdArgs, key)
} }
@ -122,10 +136,6 @@ func mustCtlV3(t *testing.T) {
} }
func setupCtlV3Test(t *testing.T, cfg *etcdProcessClusterConfig, quorum bool) *etcdProcessCluster { func setupCtlV3Test(t *testing.T, cfg *etcdProcessClusterConfig, quorum bool) *etcdProcessCluster {
if !quorum { // TODO: add serialized option
panic("serialized option is not implemented")
}
mustCtlV3(t) mustCtlV3(t)
if !quorum { if !quorum {
cfg = configStandalone(*cfg) cfg = configStandalone(*cfg)