diff --git a/README.md b/README.md index 6be53c326..7b77bfc30 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,13 @@ By default, kola uses the `qemu` platform with the most recently built image (assuming it is run from within the SDK). #### kola run + +In order to provide internet access to QEMU instances; it's required to enable ipv4 forwarding on the host machine: + +```shell +sudo sysctl -w net.ipv4.ip_forward=1 +``` + The run command invokes the main kola test harness. It runs any tests whose registered names matches a glob pattern. diff --git a/kola/tests/etcd/discovery.go b/kola/tests/etcd/discovery.go index f0a316ad0..7d4042524 100644 --- a/kola/tests/etcd/discovery.go +++ b/kola/tests/etcd/discovery.go @@ -80,21 +80,9 @@ etcd: func Discovery(c cluster.TestCluster) { var err error - // NOTE(pb): this check makes the next code somewhat redundant if err = GetClusterHealth(c, c.Machines()[0], len(c.Machines())); err != nil { c.Fatalf("discovery failed cluster-health check: %v", err) } - - var keyMap map[string]string - keyMap, err = setKeys(c, 5) - if err != nil { - c.Fatalf("failed to set keys: %v", err) - } - - if err = checkKeys(c, keyMap); err != nil { - c.Fatalf("failed to check keys: %v", err) - } - } // etcdMemberV2BackupRestore tests that the basic etcdctl v2 operations (get, @@ -114,6 +102,7 @@ func etcdMemberV2BackupRestore(c cluster.TestCluster) { c.MustSSH(m, ` set -e + export ETCDCTL_API=2 prefix=$RANDOM etcdctl set /$prefix/test magic res="$(etcdctl get /$prefix/test)" diff --git a/kola/tests/etcd/util.go b/kola/tests/etcd/util.go index dc6af63fa..0eb43d039 100644 --- a/kola/tests/etcd/util.go +++ b/kola/tests/etcd/util.go @@ -36,13 +36,16 @@ func GetClusterHealth(c cluster.TestCluster, m platform.Machine, csize int) erro var b []byte checker := func() error { - b, err := c.SSH(m, "etcdctl cluster-health") + // Fun hack: we need to redirect stderr to stdout because in 3.3.25, there is + // a mistake (?) where `health` command redirects to stderr + // More details https://github.com/etcd-io/etcd/commit/e48ad568b9e0ad9d3fbcecb82bf77998b19f6499 + b, err := c.SSH(m, "ETCDCTL_API=3 etcdctl endpoint --cluster health 2>&1") if err != nil { return err } - // repsonse should include "healthy" for each machine and for cluster - if strings.Count(string(b), "healthy") != (csize*2)+1 { + // response should include "healthy" for each machine + if strings.Count(string(b), "healthy") != csize { return fmt.Errorf("unexpected etcdctl output") }