From fd8481a29d9de7c2f9964e20a722fec31f07a42e Mon Sep 17 00:00:00 2001 From: ShylajaDevadiga <56045581+ShylajaDevadiga@users.noreply.github.com> Date: Wed, 11 Jan 2023 16:09:45 -0800 Subject: [PATCH] Adjust e2e test run script and fixes (#6718) Signed-off-by: ShylajaDevadiga --- tests/e2e/clusterreset/Vagrantfile | 2 +- tests/e2e/clusterreset/clusterreset_test.go | 4 +- tests/e2e/docker/Vagrantfile | 12 +-- tests/e2e/docker/docker_test.go | 7 +- tests/e2e/dualstack/dualstack_test.go | 7 +- tests/e2e/externalip/externalip_test.go | 7 +- tests/e2e/preferbundled/Vagrantfile | 13 +-- tests/e2e/preferbundled/preferbundled_test.go | 7 +- tests/e2e/scripts/run_tests.sh | 94 +++++++++++-------- tests/e2e/secretsencryption/Vagrantfile | 2 +- .../secretsencryption_test.go | 7 +- tests/e2e/snapshotrestore/Vagrantfile | 2 +- .../snapshotrestore/snapshotrestore_test.go | 2 +- tests/e2e/splitserver/Vagrantfile | 2 +- tests/e2e/splitserver/splitserver_test.go | 7 +- tests/e2e/upgradecluster/Vagrantfile | 2 +- .../e2e/upgradecluster/upgradecluster_test.go | 4 +- tests/e2e/validatecluster/Vagrantfile | 2 +- .../validatecluster/validatecluster_test.go | 4 +- 19 files changed, 106 insertions(+), 81 deletions(-) diff --git a/tests/e2e/clusterreset/Vagrantfile b/tests/e2e/clusterreset/Vagrantfile index 1bdf74e85d..b1c2e06cd4 100644 --- a/tests/e2e/clusterreset/Vagrantfile +++ b/tests/e2e/clusterreset/Vagrantfile @@ -8,7 +8,7 @@ RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "") EXTERNAL_DB = (ENV['E2E_EXTERNAL_DB'] || "etcd") HARDENED = (ENV['E2E_HARDENED'] || "") NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 1024).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" install_type = "" diff --git a/tests/e2e/clusterreset/clusterreset_test.go b/tests/e2e/clusterreset/clusterreset_test.go index e6ed1bc991..c30bba7c1f 100644 --- a/tests/e2e/clusterreset/clusterreset_test.go +++ b/tests/e2e/clusterreset/clusterreset_test.go @@ -67,7 +67,7 @@ var _ = Describe("Verify Create", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching Pods status\n") @@ -81,7 +81,7 @@ var _ = Describe("Verify Create", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParsePods(kubeConfigFile, true) }) diff --git a/tests/e2e/docker/Vagrantfile b/tests/e2e/docker/Vagrantfile index 81be33ac45..9003306fc1 100644 --- a/tests/e2e/docker/Vagrantfile +++ b/tests/e2e/docker/Vagrantfile @@ -1,12 +1,12 @@ ENV['VAGRANT_NO_PARALLEL'] = 'no' -NODE_ROLES = (ENV['NODE_ROLES'] || +NODE_ROLES = (ENV['E2E_NODE_ROLES'] || ["server-0", "agent-0"]) -NODE_BOXES = (ENV['NODE_BOXES'] || +NODE_BOXES = (ENV['E2E_NODE_BOXES'] || ['generic/ubuntu2004', 'generic/ubuntu2004', 'generic/ubuntu2004']) -GITHUB_BRANCH = (ENV['GITHUB_BRANCH'] || "master") -RELEASE_VERSION = (ENV['RELEASE_VERSION'] || "") -NODE_CPUS = (ENV['NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['NODE_MEMORY'] || 1024).to_i +GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master") +RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "") +NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" install_type = "" diff --git a/tests/e2e/docker/docker_test.go b/tests/e2e/docker/docker_test.go index 47e13e51c9..53046b190a 100644 --- a/tests/e2e/docker/docker_test.go +++ b/tests/e2e/docker/docker_test.go @@ -16,6 +16,7 @@ import ( var nodeOS = flag.String("nodeOS", "generic/ubuntu2004", "VM operating system") var serverCount = flag.Int("serverCount", 1, "number of server nodes") var agentCount = flag.Int("agentCount", 1, "number of agent nodes") +var ci = flag.Bool("ci", false, "running on CI") // Environment Variables Info: // E2E_RELEASE_VERSION=v1.23.1+k3s2 or nil for latest commit from master @@ -57,7 +58,7 @@ var _ = Describe("Verify CRI-Dockerd", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching pods status\n") @@ -71,7 +72,7 @@ var _ = Describe("Verify CRI-Dockerd", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParsePods(kubeConfigFile, true) }) }) @@ -83,7 +84,7 @@ var _ = AfterEach(func() { }) var _ = AfterSuite(func() { - if failed { + if failed && !*ci { fmt.Println("FAILED!") } else { Expect(e2e.DestroyCluster()).To(Succeed()) diff --git a/tests/e2e/dualstack/dualstack_test.go b/tests/e2e/dualstack/dualstack_test.go index 205690ab0a..daf8f21258 100644 --- a/tests/e2e/dualstack/dualstack_test.go +++ b/tests/e2e/dualstack/dualstack_test.go @@ -17,6 +17,7 @@ var nodeOS = flag.String("nodeOS", "generic/ubuntu2004", "VM operating system") var serverCount = flag.Int("serverCount", 3, "number of server nodes") var agentCount = flag.Int("agentCount", 1, "number of agent nodes") var hardened = flag.Bool("hardened", false, "true or false") +var ci = flag.Bool("ci", false, "running on CI") func Test_E2EDualStack(t *testing.T) { flag.Parse() @@ -54,7 +55,7 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, err := e2e.ParseNodes(kubeConfigFile, true) Expect(err).NotTo(HaveOccurred()) }) @@ -70,7 +71,7 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, err := e2e.ParsePods(kubeConfigFile, true) Expect(err).NotTo(HaveOccurred()) }) @@ -189,7 +190,7 @@ var _ = AfterEach(func() { }) var _ = AfterSuite(func() { - if failed { + if failed && !*ci { fmt.Println("FAILED!") } else { Expect(e2e.DestroyCluster()).To(Succeed()) diff --git a/tests/e2e/externalip/externalip_test.go b/tests/e2e/externalip/externalip_test.go index 45c79a84a4..d3fccb4da0 100644 --- a/tests/e2e/externalip/externalip_test.go +++ b/tests/e2e/externalip/externalip_test.go @@ -22,6 +22,7 @@ var nodeOS = flag.String("nodeOS", "generic/ubuntu2004", "VM operating system") var serverCount = flag.Int("serverCount", 1, "number of server nodes") var agentCount = flag.Int("agentCount", 1, "number of agent nodes") var hardened = flag.Bool("hardened", false, "true or false") +var ci = flag.Bool("ci", false, "running on CI") // getLBServiceIPs returns the externalIP configured for flannel func getExternalIPs(kubeConfigFile string) ([]string, error) { @@ -82,7 +83,7 @@ var _ = Describe("Verify External-IP config", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, err := e2e.ParseNodes(kubeConfigFile, true) Expect(err).NotTo(HaveOccurred()) }) @@ -98,7 +99,7 @@ var _ = Describe("Verify External-IP config", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, err := e2e.ParsePods(kubeConfigFile, true) Expect(err).NotTo(HaveOccurred()) }) @@ -159,7 +160,7 @@ var _ = AfterEach(func() { }) var _ = AfterSuite(func() { - if failed { + if failed && !*ci { fmt.Println("FAILED!") } else { Expect(e2e.DestroyCluster()).To(Succeed()) diff --git a/tests/e2e/preferbundled/Vagrantfile b/tests/e2e/preferbundled/Vagrantfile index 9d0cf433ba..92de4c2ebd 100644 --- a/tests/e2e/preferbundled/Vagrantfile +++ b/tests/e2e/preferbundled/Vagrantfile @@ -1,16 +1,17 @@ ENV['VAGRANT_NO_PARALLEL'] = 'no' -NODE_ROLES = (ENV['NODE_ROLES'] || +NODE_ROLES = (ENV['E2E_NODE_ROLES'] || ["server-0", "agent-0"]) -NODE_BOXES = (ENV['NODE_BOXES'] || +NODE_BOXES = (ENV['E2E_NODE_BOXES'] || ['generic/ubuntu2004', 'generic/ubuntu2004', 'generic/ubuntu2004']) -GITHUB_BRANCH = (ENV['GITHUB_BRANCH'] || "master") -RELEASE_VERSION = (ENV['RELEASE_VERSION'] || "") -NODE_CPUS = (ENV['NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['NODE_MEMORY'] || 1024).to_i +GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master") +RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "") +NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" install_type = "" + def provision(vm, role, role_num, node_num) vm.box = NODE_BOXES[node_num] vm.hostname = role diff --git a/tests/e2e/preferbundled/preferbundled_test.go b/tests/e2e/preferbundled/preferbundled_test.go index 3679399477..dd324779d0 100644 --- a/tests/e2e/preferbundled/preferbundled_test.go +++ b/tests/e2e/preferbundled/preferbundled_test.go @@ -16,6 +16,7 @@ import ( var nodeOS = flag.String("nodeOS", "generic/ubuntu2004", "VM operating system") var serverCount = flag.Int("serverCount", 1, "number of server nodes") var agentCount = flag.Int("agentCount", 1, "number of agent nodes") +var ci = flag.Bool("ci", false, "running on CI") // Environment Variables Info: // E2E_RELEASE_VERSION=v1.23.1+k3s2 or nil for latest commit from master @@ -57,7 +58,7 @@ var _ = Describe("Verify prefer-bundled-bin flag", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching pods status\n") @@ -71,7 +72,7 @@ var _ = Describe("Verify prefer-bundled-bin flag", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParsePods(kubeConfigFile, true) }) }) @@ -83,7 +84,7 @@ var _ = AfterEach(func() { }) var _ = AfterSuite(func() { - if failed { + if failed && !*ci { fmt.Println("FAILED!") } else { Expect(e2e.DestroyCluster()).To(Succeed()) diff --git a/tests/e2e/scripts/run_tests.sh b/tests/e2e/scripts/run_tests.sh index f171157e79..0afd987ab8 100755 --- a/tests/e2e/scripts/run_tests.sh +++ b/tests/e2e/scripts/run_tests.sh @@ -1,57 +1,75 @@ #!/bin/bash -servercount=${5:-3} -agentcount=${6:-1} -db=${7:-"etcd"} + +nodeOS=${1:-"generic/ubuntu2004"} +servercount=${2:-3} +agentcount=${3:-1} +db=${4:-"etcd"} +hardened=${5:-""} k3s_version=${k3s_version} k3s_channel=${k3s_channel:-"commit"} -hardened=${8:-""} E2E_EXTERNAL_DB=$db && export E2E_EXTERNAL_DB E2E_REGISTRY=true && export E2E_REGISTRY -eval openvpn --daemon --config external.ovpn &>/dev/null & -sleep 10 +cd +cd k3s && git pull --rebase origin master +/usr/local/go/bin/go mod tidy -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s && git pull --rebase origin master' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s && /usr/local/go/bin/go mod tidy' +cd tests/e2e +OS=$(echo "$nodeOS"|cut -d'/' -f2) +echo "$OS" -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e/dualstack && vagrant global-status | awk '/running/'|cut -c1-7| xargs -r -d '\n' -n 1 -- vagrant destroy -f" +# create directory if it does not exists +# create directory if it does not exists +if [ ! -d createreport ] +then + mkdir createreport +fi -echo 'RUNNING DUALSTACK VALIDATION TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v dualstack/dualstack_test.go -nodeOS="$4" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/dualstack && vagrant destroy -f' +count=0 +run_tests() { + vagrant global-status | awk '/running/'|cut -c1-7| xargs -r -d '\n' -n 1 -- vagrant destroy -f -echo 'RUNNING CLUSTER VALIDATION TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && E2E_REGISTRY=true E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v validatecluster/validatecluster_test.go -nodeOS="$4" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/validatecluster && vagrant destroy -f' + echo 'RUNNING DUALSTACK TEST' + E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v dualstack/dualstack_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci |tee createreport/k3s_"$OS".log -echo 'RUNNING SECRETS ENCRYPTION TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && /usr/local/go/bin/go test -v secretsencryption/secretsencryption_test.go -nodeOS="$4" -serverCount=$((servercount)) -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/secretsencryption && vagrant destroy -f' + echo 'RUNNING CLUSTER VALIDATION TEST' + E2E_REGISTRY=true E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v validatecluster/validatecluster_test.go -nodeOS="$nodeOS" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=30m -json -ci | tee -a createreport/k3s_"$OS".log -echo 'RUNNING SNAPSHOT RESTORE TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && /usr/local/go/bin/go test -v snapshotrestore/snapshotrestore_test.go -nodeOS="$4" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/secretsencryption && vagrant destroy -f' + echo 'RUNNING SECRETS ENCRYPTION TEST' + /usr/local/go/bin/go test -v secretsencryption/secretsencryption_test.go -nodeOS="$nodeOS" -serverCount=$((servercount)) -timeout=1h -json -ci | tee -a createreport/k3s_"$OS".log -echo 'RUNNING SPLIT SERVER VALIDATION TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v splitserver/splitserver_test.go -nodeOS="$4" -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/splitserver && vagrant destroy -f' + echo 'RUN CLUSTER RESET TEST' + /usr/local/go/bin/go test -v clusterreset/clusterreset_test.go -nodeOS="$nodeOS" -serverCount=3 -agentCount=1 -timeout=30m -json -ci | tee -a createreport/k3s_"$OS".log -E2E_RELEASE_VERSION=$k3s_version && export E2E_RELEASE_VERSION -E2E_RELEASE_CHANNEL=$k3s_channel && export E2E_RELEASE_CHANNEL + echo 'RUNNING SPLIT SERVER VALIDATION TEST' + E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v splitserver/splitserver_test.go -nodeOS="$nodeOS" -timeout=30m -json -ci | tee -a createreport/k3s_"$OS".log -echo 'RUNNING CLUSTER UPGRADE TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && E2E_REGISTRY=true /usr/local/go/bin/go test -v upgradecluster/upgradecluster_test.go -nodeOS="$4" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/upgradecluster && vagrant destroy -f' + echo 'RUNNING DOCKER CRI VALIDATION TEST' + /usr/local/go/bin/go test -v docker/docker_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a createreport/k3s_"$OS".log -echo 'RUN CLUSTER RESET TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && /usr/local/go/bin/go test -v clusterreset/clusterreset_test.go -nodeOS="$4" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/clusterreset && vagrant destroy -f' + echo 'RUNNING EXTERNAL IP TEST' + /usr/local/go/bin/go test -v externalip/externalip_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a createreport/k3s_"$OS".log -echo 'RUNNING DOCKER CRI VALIDATION TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && /usr/local/go/bin/go test -v docker/docker_test.go -nodeOS="$4" -serverCount=1 -agentCount=1 -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/docker && vagrant destroy -f' + echo 'RUNNING PRE-BUNDLED-BIN IP TEST' + /usr/local/go/bin/go test -v preferbundled/preferbundled_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a createreport/k3s_"$OS".log -echo 'RUNNING EXTERNALIP VALIDATION TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v externalip/externalip_test.go -nodeOS="$4" -serverCount=1 -agentCount=1 -timeout=30m -json" | tee -a testreport.log -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/dualstack && vagrant destroy -f' + echo 'RUNNING SNAPSHOT AND RESTORE TEST' + /usr/local/go/bin/go test -v snapshotrestore/snapshotrestore_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a createreport/k3s_"$OS".log + + E2E_RELEASE_VERSION=$k3s_version && export E2E_RELEASE_VERSION + E2E_RELEASE_CHANNEL=$k3s_channel && export E2E_RELEASE_CHANNEL + + echo 'RUNNING CLUSTER UPGRADE TEST' + E2E_REGISTRY=true /usr/local/go/bin/go test -v upgradecluster/upgradecluster_test.go -nodeOS="$nodeOS" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=1h -json -ci | tee -a createreport/k3s_"$OS".log +} + +ls createreport/k3s_"$OS".log 2>/dev/null && rm createreport/k3s_"$OS".log +run_tests + +while [ -f createreport/k3s_"$OS".log ] && grep -w ":\"fail" createreport/k3s_"$OS".log >>data && [ $count -le 2 ] +do + echo "Re-running tests" + cp createreport/k3s_"$OS".log createreport/k3s_"$OS"_"$count".log + run_tests +done \ No newline at end of file diff --git a/tests/e2e/secretsencryption/Vagrantfile b/tests/e2e/secretsencryption/Vagrantfile index b2b33c5713..b98322e761 100644 --- a/tests/e2e/secretsencryption/Vagrantfile +++ b/tests/e2e/secretsencryption/Vagrantfile @@ -6,7 +6,7 @@ NODE_BOXES = (ENV['E2E_NODE_BOXES'] || GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master") RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "") NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 1024).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" install_type = "" diff --git a/tests/e2e/secretsencryption/secretsencryption_test.go b/tests/e2e/secretsencryption/secretsencryption_test.go index c4a13643c0..2eb8e1c181 100644 --- a/tests/e2e/secretsencryption/secretsencryption_test.go +++ b/tests/e2e/secretsencryption/secretsencryption_test.go @@ -16,6 +16,7 @@ import ( var nodeOS = flag.String("nodeOS", "generic/ubuntu2004", "VM operating system") var serverCount = flag.Int("serverCount", 3, "number of server nodes") var hardened = flag.Bool("hardened", false, "true or false") +var ci = flag.Bool("ci", false, "running on CI") // Environment Variables Info: // E2E_RELEASE_VERSION=v1.23.1+k3s2 or nil for latest commit from master @@ -55,7 +56,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching pods status\n") @@ -69,7 +70,7 @@ var _ = Describe("Verify Secrets Encryption Rotation", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParsePods(kubeConfigFile, true) }) @@ -295,7 +296,7 @@ var _ = AfterEach(func() { }) var _ = AfterSuite(func() { - if failed { + if failed && !*ci { fmt.Println("FAILED!") } else { Expect(e2e.DestroyCluster()).To(Succeed()) diff --git a/tests/e2e/snapshotrestore/Vagrantfile b/tests/e2e/snapshotrestore/Vagrantfile index 99301ead32..5ee814b624 100644 --- a/tests/e2e/snapshotrestore/Vagrantfile +++ b/tests/e2e/snapshotrestore/Vagrantfile @@ -7,7 +7,7 @@ GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master") RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "") EXTERNAL_DB = (ENV['E2E_EXTERNAL_DB'] || "etcd") NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 1024).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" install_type = "" diff --git a/tests/e2e/snapshotrestore/snapshotrestore_test.go b/tests/e2e/snapshotrestore/snapshotrestore_test.go index 4174d8f2dc..af5f095d6a 100644 --- a/tests/e2e/snapshotrestore/snapshotrestore_test.go +++ b/tests/e2e/snapshotrestore/snapshotrestore_test.go @@ -69,7 +69,7 @@ var _ = Describe("Verify Create", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching Pods status\n") diff --git a/tests/e2e/splitserver/Vagrantfile b/tests/e2e/splitserver/Vagrantfile index 803b186186..40d96d6427 100644 --- a/tests/e2e/splitserver/Vagrantfile +++ b/tests/e2e/splitserver/Vagrantfile @@ -6,7 +6,7 @@ NODE_BOXES = (ENV['E2E_NODE_BOXES'] || GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master") RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "") NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 1024).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" diff --git a/tests/e2e/splitserver/splitserver_test.go b/tests/e2e/splitserver/splitserver_test.go index 044f590ec0..65a8a48167 100644 --- a/tests/e2e/splitserver/splitserver_test.go +++ b/tests/e2e/splitserver/splitserver_test.go @@ -18,6 +18,7 @@ var nodeOS = flag.String("nodeOS", "generic/ubuntu2004", "VM operating system") var etcdCount = flag.Int("etcdCount", 1, "number of server nodes only deploying etcd") var controlPlaneCount = flag.Int("controlPlaneCount", 1, "number of server nodes acting as control plane") var agentCount = flag.Int("agentCount", 1, "number of agent nodes") +var ci = flag.Bool("ci", false, "running on CI") var hardened = flag.Bool("hardened", false, "true or false") // Environment Variables Info: @@ -96,7 +97,7 @@ var _ = Describe("Verify Create", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching Pods status\n") @@ -110,7 +111,7 @@ var _ = Describe("Verify Create", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParsePods(kubeConfigFile, true) }) @@ -228,7 +229,7 @@ var _ = AfterEach(func() { }) var _ = AfterSuite(func() { - if failed { + if failed && !*ci { fmt.Println("FAILED!") } else { Expect(e2e.DestroyCluster()).To(Succeed()) diff --git a/tests/e2e/upgradecluster/Vagrantfile b/tests/e2e/upgradecluster/Vagrantfile index dee336bed1..c652b9cb1c 100644 --- a/tests/e2e/upgradecluster/Vagrantfile +++ b/tests/e2e/upgradecluster/Vagrantfile @@ -8,7 +8,7 @@ RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "") EXTERNAL_DB = (ENV['E2E_EXTERNAL_DB'] || "etcd") REGISTRY = (ENV['E2E_REGISTRY'] || "") NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 1024).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" install_type = "" diff --git a/tests/e2e/upgradecluster/upgradecluster_test.go b/tests/e2e/upgradecluster/upgradecluster_test.go index 9c271b2afd..9b09944769 100644 --- a/tests/e2e/upgradecluster/upgradecluster_test.go +++ b/tests/e2e/upgradecluster/upgradecluster_test.go @@ -65,7 +65,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching Pods status\n") @@ -79,7 +79,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParsePods(kubeConfigFile, true) }) diff --git a/tests/e2e/validatecluster/Vagrantfile b/tests/e2e/validatecluster/Vagrantfile index 04b29a014c..2df1d63efe 100644 --- a/tests/e2e/validatecluster/Vagrantfile +++ b/tests/e2e/validatecluster/Vagrantfile @@ -10,7 +10,7 @@ HARDENED = (ENV['E2E_HARDENED'] || "") REGISTRY = (ENV['E2E_REGISTRY'] || "") RANCHER = (ENV['E2E_RANCHER'] || "") NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i -NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 1024).to_i +NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i # Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks NETWORK_PREFIX = "10.10.10" install_type = "" diff --git a/tests/e2e/validatecluster/validatecluster_test.go b/tests/e2e/validatecluster/validatecluster_test.go index b1bc8fbaf6..0d5b1a4091 100644 --- a/tests/e2e/validatecluster/validatecluster_test.go +++ b/tests/e2e/validatecluster/validatecluster_test.go @@ -68,7 +68,7 @@ var _ = Describe("Verify Create", Ordered, func() { for _, node := range nodes { g.Expect(node.Status).Should(Equal("Ready")) } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParseNodes(kubeConfigFile, true) fmt.Printf("\nFetching Pods status\n") @@ -82,7 +82,7 @@ var _ = Describe("Verify Create", Ordered, func() { g.Expect(pod.Status).Should(Equal("Running"), pod.Name) } } - }, "420s", "5s").Should(Succeed()) + }, "620s", "5s").Should(Succeed()) _, _ = e2e.ParsePods(kubeConfigFile, true) })