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
Signed-off-by: KMAnju-2021 <[email protected]>
  • Loading branch information
KMAnju-2021 committed Jan 16, 2024
1 parent 2bf7c80 commit 33a32cb
Show file tree
Hide file tree
Showing 9 changed files with 530 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ jobs:
run: |
mkdir log
mkdir test-e2e-fa-coverage
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-fa-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage --flow-visibility --ip-family dual
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-fa-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage --flow-visibility --ip-family ds
- name: Tar coverage files
run: tar -czf test-e2e-fa-coverage.tar.gz test-e2e-fa-coverage
- name: Upload coverage for test-e2e-fa-coverage
Expand Down
30 changes: 30 additions & 0 deletions ci/cloud-coredns-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: ConfigMap
metadata:
namespace: kube-system
name: coredns
data:
Corefile: |
.:53 {
errors
health {
lameduck 5s
}
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
ttl 30
}
prometheus :9153
forward . /etc/resolv.conf {
max_concurrent 1000
}
cache 30
reload
loadbalance
}
compute.internal:53 {
template ANY ANY {
rcode NXDOMAIN
}
}
31 changes: 31 additions & 0 deletions ci/coredns-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: ConfigMap
metadata:
namespace: kube-system
name: coredns
data:
Corefile: |
.:53 {
errors
health {
lameduck 5s
}
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
ttl 30
}
prometheus :9153
forward . /etc/resolv.conf {
max_concurrent 1000
}
cache 30
reload
loadbalance
}
vmware.com:53 {
template ANY ANY {
rcode NXDOMAIN
}
}
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}}" --jenkins-location '{jenkins_location}' --ip-mode '{ip_version}'
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
194 changes: 194 additions & 0 deletions ci/jenkins/jobs/projects-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1077,3 +1077,197 @@
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'
jenkins_location: 'cloud'
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'
jenkins_location: 'cloud'
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: 'ds'
jenkins_location: 'cloud'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-ds-(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-ds-networkpolicy to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-ds-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: 'ds'
jenkins_location: 'cloud'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-ds-(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-ds-conformance to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-ds-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: 'ds'
kind_cluster_name: '{test_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-kind-aws-ipv6-ds-(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-ds-e2e to re-trigger.
error_status: Failed. Add comment /test-kind-aws-ipv6-ds-e2e to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
publishers: []
Loading

0 comments on commit 33a32cb

Please sign in to comment.