From d3c675f4e9f39b661a6aeab025c960db2a7f2c45 Mon Sep 17 00:00:00 2001 From: ShylajaDevadiga <56045581+ShylajaDevadiga@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:02:44 -0700 Subject: [PATCH] Expand nightly E2E tests (#6354) Signed-off-by: Shylaja Devadiga --- tests/e2e/clusterreset/clusterreset_test.go | 2 +- tests/e2e/docker/docker_test.go | 2 +- tests/e2e/dualstack/dualstack_test.go | 2 +- tests/e2e/scripts/run_tests.sh | 27 ++++++++++++++++--- tests/e2e/splitserver/splitserver_test.go | 2 +- .../e2e/upgradecluster/upgradecluster_test.go | 2 +- 6 files changed, 28 insertions(+), 9 deletions(-) diff --git a/tests/e2e/clusterreset/clusterreset_test.go b/tests/e2e/clusterreset/clusterreset_test.go index db69cf72fe..5a9b665712 100644 --- a/tests/e2e/clusterreset/clusterreset_test.go +++ b/tests/e2e/clusterreset/clusterreset_test.go @@ -29,7 +29,7 @@ var local = flag.Bool("local", false, "deploy a locally built K3s binary") func Test_E2EClusterReset(t *testing.T) { RegisterFailHandler(Fail) flag.Parse() - RunSpecs(t, "Create ClusterReset Test Suite") + RunSpecs(t, "ClusterReset Test Suite") } var ( diff --git a/tests/e2e/docker/docker_test.go b/tests/e2e/docker/docker_test.go index 0f805546ef..a26d4964ea 100644 --- a/tests/e2e/docker/docker_test.go +++ b/tests/e2e/docker/docker_test.go @@ -23,7 +23,7 @@ var agentCount = flag.Int("agentCount", 1, "number of agent nodes") func Test_E2EClusterValidation(t *testing.T) { RegisterFailHandler(Fail) flag.Parse() - RunSpecs(t, "Create Cluster Test Suite") + RunSpecs(t, "Docker CRI Test Suite") } var ( diff --git a/tests/e2e/dualstack/dualstack_test.go b/tests/e2e/dualstack/dualstack_test.go index 1edd3450e2..f21a4d7363 100644 --- a/tests/e2e/dualstack/dualstack_test.go +++ b/tests/e2e/dualstack/dualstack_test.go @@ -21,7 +21,7 @@ var hardened = flag.Bool("hardened", false, "true or false") func Test_E2EDualStack(t *testing.T) { flag.Parse() RegisterFailHandler(Fail) - RunSpecs(t, "Validate DualStack Suite") + RunSpecs(t, "DualStack Suite") } var ( diff --git a/tests/e2e/scripts/run_tests.sh b/tests/e2e/scripts/run_tests.sh index 4cd479d2a7..0247c95919 100755 --- a/tests/e2e/scripts/run_tests.sh +++ b/tests/e2e/scripts/run_tests.sh @@ -13,19 +13,38 @@ eval openvpn --daemon --config external.ovpn &>/dev/null & sleep 10 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 && go mod tidy' +ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s && /usr/local/go/bin/go mod tidy' + +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" + +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=1h" +ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/dualstack && 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=1h" ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/validatecluster && vagrant destroy -f' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v validatecluster/validatecluster_test.go -nodeOS="$4" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=1h" + echo 'RUNNING SECRETS ENCRYPTION TEST' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/secretsencryption && vagrant destroy -f' 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=1h" +ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/secretsencryption && vagrant destroy -f' + +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=3 -agentCount=1 -timeout=1h" +ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/clusterreset && vagrant destroy -f' + +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=1h" +ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/splitserver && vagrant destroy -f' E2E_RELEASE_VERSION=$k3s_version && export E2E_RELEASE_VERSION E2E_RELEASE_CHANNEL=$k3s_channel && export E2E_RELEASE_CHANNEL 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=1h" ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/upgradecluster && vagrant destroy -f' -ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 "cd k3s/tests/e2e && /usr/local/go/bin/go test -v upgradecluster/upgradecluster_test.go -nodeOS="$4" -serverCount=$((servercount)) -agentCount=$((agentcount)) -timeout=1h" + +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=1h" +ssh -i "$1" -o "StrictHostKeyChecking no" $2@$3 'cd k3s/tests/e2e/docker && vagrant destroy -f' diff --git a/tests/e2e/splitserver/splitserver_test.go b/tests/e2e/splitserver/splitserver_test.go index 9262f99f40..c6569a9b3d 100644 --- a/tests/e2e/splitserver/splitserver_test.go +++ b/tests/e2e/splitserver/splitserver_test.go @@ -1,4 +1,4 @@ -package validatecluster +package splitserver import ( "flag" diff --git a/tests/e2e/upgradecluster/upgradecluster_test.go b/tests/e2e/upgradecluster/upgradecluster_test.go index af7ee8f696..04ae565bcf 100644 --- a/tests/e2e/upgradecluster/upgradecluster_test.go +++ b/tests/e2e/upgradecluster/upgradecluster_test.go @@ -31,7 +31,7 @@ var ci = flag.Bool("ci", false, "running on CI") func Test_E2EUpgradeValidation(t *testing.T) { RegisterFailHandler(Fail) flag.Parse() - RunSpecs(t, "Create Cluster Test Suite") + RunSpecs(t, "Upgrade Cluster Test Suite") } var (