Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
13 changes: 1 addition & 12 deletions kola/tests/etcd/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)"
Expand Down
9 changes: 6 additions & 3 deletions kola/tests/etcd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down