diff --git a/pkg/testcase/daemonset.go b/pkg/testcase/daemonset.go index 37199488..d7ca9d75 100644 --- a/pkg/testcase/daemonset.go +++ b/pkg/testcase/daemonset.go @@ -1,7 +1,6 @@ package testcase import ( - "fmt" "sort" "strings" @@ -19,14 +18,15 @@ func TestDaemonset(applyWorkload, deleteWorkload bool) { Expect(workloadErr).NotTo(HaveOccurred(), "Daemonset manifest not deployed") } - getDeamonset := "kubectl get pods -n test-daemonset" + - " --field-selector=status.phase=Running --kubeconfig=" - err := assert.ValidateOnHost(getDeamonset+shared.KubeConfigFile, statusRunning) + cmd := "kubectl get pods -n test-daemonset" + + " --field-selector=status.phase=Running " + + " --kubeconfig=" + shared.KubeConfigFile + err := assert.ValidateOnHost(cmd, statusRunning) Expect(err).NotTo(HaveOccurred(), err) pods, _ := shared.GetPods(false) - cmd := "kubectl get pods -n test-daemonset" + + cmd = "kubectl get pods -n test-daemonset" + ` -o jsonpath='{range .items[*]}{.spec.nodeName}{"\n"}{end}'` + " --kubeconfig=" + shared.KubeConfigFile @@ -43,12 +43,8 @@ func TestDaemonset(applyWorkload, deleteWorkload bool) { } } - cmd = fmt.Sprintf(` - kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints \ - --kubeconfig="%s" | grep '' - `, - shared.KubeConfigFile, - ) + cmd = "kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints" + + " --kubeconfig=" + shared.KubeConfigFile + ` | grep ''` taints, err := shared.RunCommandHost(cmd) if err != nil { return diff --git a/pkg/testcase/upgrademanual.go b/pkg/testcase/upgrademanual.go index e3e58a04..5912a1ab 100644 --- a/pkg/testcase/upgrademanual.go +++ b/pkg/testcase/upgrademanual.go @@ -3,7 +3,6 @@ package testcase import ( "errors" "fmt" - "time" "github.com/rancher/distros-test-framework/pkg/k8s" "github.com/rancher/distros-test-framework/shared" @@ -72,12 +71,10 @@ func upgradeProduct(product, nodeType, installType, ip string) error { actions := []shared.ServiceAction{ {Service: product, Action: restart, NodeType: nodeType, ExplicitDelay: 180}, - {Service: product, Action: status, NodeType: nodeType, ExplicitDelay: 60}, + {Service: product, Action: status, NodeType: nodeType, ExplicitDelay: 30}, } if product == "rke2" { - shared.LogLevel("info", "Waiting for 2 mins after installing upgrade...") - time.Sleep(2 * time.Minute) ms := shared.NewManageService(3, 30) output, err := ms.ManageService(ip, actions) if output != "" {