diff --git a/e2e/e2e-linux.go b/e2e/e2e-linux.go new file mode 100644 index 0000000..69bd4de --- /dev/null +++ b/e2e/e2e-linux.go @@ -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) + } + } + } +}