Skip to content

Commit

Permalink
add simple e2e which runs on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
chanwit committed May 8, 2021
1 parent 4219e2a commit d4fb6ad
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions e2e/e2e-linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package main

import (
"github.com/chanwit/script"
)

func main() {
script.Debug = true
for _, provider := range []string{"ekz", "kind"} {
for eksdVersion, expected := range map[string]string{
"v1.19": "v1.19.8-eks-1-19-4",
"v1.18": "v1.18.16-eks-1-18-4",
} {
if err := script.Run("ekz", "create", "cluster", "--provider="+provider, "--eksd-version="+eksdVersion); err != nil {
panic(err)
}

kubeletVersion := script.Var()
if err := script.Exec("kubectl", "get", "nodes", "-oyaml").
Exec("yq", "e", ".items[0].status.nodeInfo.kubeletVersion", "-").To(kubeletVersion); err != nil {
panic(err)
}

if err := script.Run("ekz", "delete", "cluster", "--provider="+provider); err != nil {
panic(err)
}

if kubeletVersion.String() != expected {
panic("expected " + expected)
}
}
}
}

0 comments on commit d4fb6ad

Please sign in to comment.