Skip to content

Commit a2fd8c3

Browse files
committed
step-registry: add Origin E2E test step
1 parent 4748256 commit a2fd8c3

File tree

7 files changed

+131
-2
lines changed

7 files changed

+131
-2
lines changed

ci-operator/config/openshift/installer/openshift-installer-master.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ tests:
198198
openshift_installer_upi:
199199
cluster_profile: vsphere
200200
- as: e2e-steps
201-
commands: ""
202201
steps:
203202
cluster_profile: aws
204-
workflow: ipi
203+
workflow: origin-e2e
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
approvers:
2+
- smarterclayton
3+
- wking
4+
- stevekuznetsov
5+
- vrutkovs
6+
- abhinavdahiya
7+
- deads2k
8+
- crawford
9+
- ewolinetz
10+
- csrwng
11+
- staebler
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
approvers:
2+
- smarterclayton
3+
- wking
4+
- stevekuznetsov
5+
- vrutkovs
6+
- abhinavdahiya
7+
- deads2k
8+
- crawford
9+
- ewolinetz
10+
- csrwng
11+
- staebler
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
workflow:
2+
as: origin-e2e
3+
steps:
4+
pre:
5+
- ref: ipi-conf
6+
- chain: ipi-install
7+
test:
8+
- ref: origin-e2e-test
9+
post:
10+
- chain: ipi-deprovision
11+
documentation: |-
12+
The Origin E2E workflow executes the common end-to-end test suite.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
approvers:
2+
- smarterclayton
3+
- wking
4+
- stevekuznetsov
5+
- vrutkovs
6+
- abhinavdahiya
7+
- deads2k
8+
- crawford
9+
- ewolinetz
10+
- csrwng
11+
- staebler
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
3+
set -o nounset
4+
set -o errexit
5+
set -o pipefail
6+
7+
cluster_profile=/var/run/secrets/ci.openshift.io/cluster-profile
8+
export AWS_SHARED_CREDENTIALS_FILE=${cluster_profile}/.awscred
9+
export AZURE_AUTH_LOCATION=${cluster_profile}/osServicePrincipal.json
10+
export GCP_SHARED_CREDENTIALS_FILE=${cluster_profile}/gce.json
11+
export HOME=/tmp/home
12+
export PATH=/usr/libexec/origin:$PATH
13+
14+
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM
15+
16+
mkdir -p "${HOME}"
17+
18+
# if the cluster profile included an insights secret, install it to the cluster to
19+
# report support data from the support-operator
20+
if [[ -f "${cluster_profile}/insights-live.yaml" ]]; then
21+
oc create -f "${cluster_profile}/insights-live.yaml" || true
22+
fi
23+
24+
# set up cloud-provider-specific env vars
25+
KUBE_SSH_BASTION="$( oc --insecure-skip-tls-verify get node -l node-role.kubernetes.io/master -o 'jsonpath={.items[0].status.addresses[?(@.type=="ExternalIP")].address}' ):22"
26+
KUBE_SSH_KEY_PATH=${cluster_profile}/ssh-privatekey
27+
export KUBE_SSH_BASTION KUBE_SSH_KEY_PATH
28+
case "${CLUSTER_TYPE}" in
29+
gcp)
30+
export GOOGLE_APPLICATION_CREDENTIALS="${GCP_SHARED_CREDENTIALS_FILE}"
31+
export KUBE_SSH_USER=core
32+
mkdir -p ~/.ssh
33+
cp "${cluster_profile}/ssh-privatekey" ~/.ssh/google_compute_engine || true
34+
export TEST_PROVIDER='{"type":"gce","region":"us-east1","multizone": true,"multimaster":true,"projectid":"openshift-gce-devel-ci"}'
35+
;;
36+
aws)
37+
mkdir -p ~/.ssh
38+
cp "${cluster_profile}/ssh-privatekey" ~/.ssh/kube_aws_rsa || true
39+
export PROVIDER_ARGS="-provider=aws -gce-zone=us-east-1"
40+
# TODO: make openshift-tests auto-discover this from cluster config
41+
REGION="$(oc get -o jsonpath='{.status.platformStatus.aws.region}' infrastructure cluster)"
42+
ZONE="$(oc get -o jsonpath='{.items[0].metadata.labels.failure-domain\.beta\.kubernetes\.io/zone}' nodes)"
43+
export TEST_PROVIDER="{\"type\":\"aws\",\"region\":\"${REGION}\",\"zone\":\"${ZONE}\",\"multizone\":true,\"multimaster\":true}"
44+
export KUBE_SSH_USER=core
45+
;;
46+
azure4) export TEST_PROVIDER=azure;;
47+
*) echo >&2 "Unsupported cluster type '${CLUSTER_TYPE}'"; exit 1;;
48+
esac
49+
50+
mkdir -p /tmp/output
51+
cd /tmp/output
52+
53+
if [[ "${CLUSTER_TYPE}" == gcp ]]; then
54+
pushd /tmp
55+
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-256.0.0-linux-x86_64.tar.gz
56+
tar -xzf google-cloud-sdk-256.0.0-linux-x86_64.tar.gz
57+
export PATH=$PATH:/tmp/google-cloud-sdk/bin
58+
mkdir gcloudconfig
59+
export CLOUDSDK_CONFIG=/tmp/gcloudconfig
60+
gcloud auth activate-service-account --key-file="${GCP_SHARED_CREDENTIALS_FILE}"
61+
gcloud config set project openshift-gce-devel-ci
62+
popd
63+
fi
64+
65+
test_suite=openshift/conformance/parallel
66+
if [[ -e "${SHARED_DIR}/test-suite.txt" ]]; then
67+
test_suite=$(<"${SHARED_DIR}/test-suite.txt")
68+
fi
69+
70+
openshift-tests run "${test_suite}" \
71+
--provider "${TEST_PROVIDER}" \
72+
-o /tmp/artifacts/e2e.log \
73+
--junit-dir /tmp/artifacts/junit
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ref:
2+
as: origin-e2e-test
3+
from: stable:tests
4+
commands: origin-e2e-test-commands.sh
5+
resources:
6+
requests:
7+
cpu: "3"
8+
memory: 600Mi
9+
limits:
10+
memory: 4Gi
11+
documentation: |-
12+
The Origin E2E step executes the common end-to-end test suite.

0 commit comments

Comments
 (0)