Skip to content

Commit

Permalink
NetworkPolicy, conformance and e2e tests in kind-(ds or ipv6) cluster (
Browse files Browse the repository at this point in the history
…#5175)

Signed-off-by: KMAnju-2021 <[email protected]>
  • Loading branch information
KMAnju-2021 authored Jan 26, 2024
1 parent 6949c87 commit a01bd89
Show file tree
Hide file tree
Showing 5 changed files with 429 additions and 11 deletions.
39 changes: 32 additions & 7 deletions ci/jenkins/jobs/macros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,45 @@
#!/bin/bash
set -ex
DOCKER_REGISTRY="$(head -n1 ci/docker-registry)"
# Delete all kind clusters created more than 135 mins ago. 135 minutes is the timeout
KIND_TIMEOUT=135
FULL_CLUSTER_NAME='{kind_cluster_name}'-"${{BUILD_NUMBER}}"
# Delete all Kind clusters created more than 135 mins ago. 135 minutes is the timeout
# we have configured for running conformance and NetworkPolicy tests on Kind,
# so clusters older than that can de deleted safely.
./ci/kind/kind-setup.sh destroy --all --until 135
./ci/kind/kind-setup.sh destroy --all --until ${{KIND_TIMEOUT}}
./ci/kind/kind-install.sh
./ci/kind/kind-setup.sh --antrea-cni create "${{JOB_NAME}}-${{BUILD_NUMBER}}"
kind export kubeconfig -n "${{JOB_NAME}}-${{BUILD_NUMBER}}" --kubeconfig ${{PWD}}/.kube/config
set +ex
./ci/jenkins/test.sh --testcase '{conformance_type}' --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{JOB_NAME}}-${{BUILD_NUMBER}}"
./ci/kind/kind-setup.sh --antrea-cni create "${{FULL_CLUSTER_NAME}}" --ip-family '{ip_version}'
kind export kubeconfig -n "${{FULL_CLUSTER_NAME}}" --kubeconfig ${{PWD}}/.kube/config
set +e
./ci/jenkins/test.sh --testcase '{conformance_type}' --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{FULL_CLUSTER_NAME}}"
return_code=$?
set -ex
./ci/kind/kind-setup.sh destroy "${{JOB_NAME}}-${{BUILD_NUMBER}}"
./ci/kind/kind-setup.sh destroy "${{FULL_CLUSTER_NAME}}"
exit $return_code
- builder:
name: builder-e2e-kind
builders:
- shell: |-
#!/bin/bash
set -ex
DOCKER_REGISTRY="$(head -n1 ci/docker-registry)"
KIND_TIMEOUT=135
FULL_CLUSTER_NAME='{kind_cluster_name}'-"${{BUILD_NUMBER}}"
# Delete all Kind clusters created more than 135 mins ago. 135 minutes is the timeout
# we have configured for running conformance, NetworkPolicy and e2e tests on Kind,
# so clusters older than that can de deleted safely.
./ci/kind/kind-setup.sh destroy --all --until ${{KIND_TIMEOUT}}
./ci/kind/kind-install.sh
./ci/kind/kind-setup.sh --antrea-cni create "${{FULL_CLUSTER_NAME}}" --ip-family '{ip_version}'
kind export kubeconfig -n "${{FULL_CLUSTER_NAME}}" --kubeconfig ${{PWD}}/.kube/config
set +e
./ci/jenkins/test.sh --testcase e2e --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{FULL_CLUSTER_NAME}}"
return_code=$?
set -ex
./ci/kind/kind-setup.sh destroy "${{FULL_CLUSTER_NAME}}"
exit $return_code
- builder:
name: builder-rancher-e2e
builders:
Expand Down
190 changes: 190 additions & 0 deletions ci/jenkins/jobs/projects-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1077,3 +1077,193 @@
default-excludes: true
fingerprint: false
only-if-success: false
- '{name}-{test_name}-for-pull-request':
test_name: kind-aws-ipv6-only-networkpolicy
node: 'antrea-kind-test'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-conformance-kind:
conformance_type: 'networkpolicy'
ip_version: 'ipv6'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-only-(networkpolicy|all).*
white_list_target_branches: []
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
status_context: jenkins-kind-ipv6-only-networkpolicy
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-kind-aws-ipv6-only-networkpolicy to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-only-networkpolicy to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
publishers: []
- '{name}-{test_name}-for-pull-request':
test_name: kind-aws-ipv6-only-conformance
node: 'antrea-kind-test'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-conformance-kind:
conformance_type: 'conformance'
ip_version: 'ipv6'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-only-(conformance|all).*
white_list_target_branches: []
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
status_context: jenkins-kind-ipv6-only-conformance
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-kind-aws-ipv6-only-conformance to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-only-conformance to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
publishers: []
- '{name}-{test_name}-for-pull-request':
test_name: kind-aws-ipv6-only-e2e
node: 'antrea-kind-test'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-e2e-kind:
ip_version: 'ipv6'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-only-(e2e|all).*
white_list_target_branches: []
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
status_context: jenkins-kind-ipv6-only-e2e
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-kind-aws-ipv6-only-e2e to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-only-e2e to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
publishers: []
- '{name}-{test_name}-for-pull-request':
test_name: kind-aws-ipv6-ds-networkpolicy
node: 'antrea-kind-test'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-conformance-kind:
conformance_type: 'networkpolicy'
ip_version: 'dual'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-(networkpolicy|all).*
white_list_target_branches: []
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
status_context: jenkins-kind-ipv6-ds-networkpolicy
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-kind-aws-ipv6-networkpolicy to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-networkpolicy to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
publishers: []
- '{name}-{test_name}-for-pull-request':
test_name: kind-aws-ipv6-ds-conformance
node: 'antrea-kind-test'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-conformance-kind:
conformance_type: 'conformance'
ip_version: 'dual'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-(conformance|all).*
white_list_target_branches: []
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
status_context: jenkins-kind-ipv6-ds-conformance
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-kind-aws-ipv6-conformance to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-conformance to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
publishers: []
- '{name}-{test_name}-for-pull-request':
test_name: kind-aws-ipv6-ds-e2e
node: 'antrea-kind-test'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-e2e-kind:
ip_version: 'dual'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-(e2e|all).*
white_list_target_branches: []
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
status_context: jenkins-kind-ipv6-ds-e2e
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-kind-aws-ipv6-e2e to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-e2e to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
publishers: []
Loading

0 comments on commit a01bd89

Please sign in to comment.