Skip to content

Commit

Permalink
step-registry: add Origin E2E test step
Browse files Browse the repository at this point in the history
  • Loading branch information
bbguimaraes committed Feb 3, 2020
1 parent 4748256 commit a2fd8c3
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ tests:
openshift_installer_upi:
cluster_profile: vsphere
- as: e2e-steps
commands: ""
steps:
cluster_profile: aws
workflow: ipi
workflow: origin-e2e
11 changes: 11 additions & 0 deletions ci-operator/step-registry/origin/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
approvers:
- smarterclayton
- wking
- stevekuznetsov
- vrutkovs
- abhinavdahiya
- deads2k
- crawford
- ewolinetz
- csrwng
- staebler
11 changes: 11 additions & 0 deletions ci-operator/step-registry/origin/e2e/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
approvers:
- smarterclayton
- wking
- stevekuznetsov
- vrutkovs
- abhinavdahiya
- deads2k
- crawford
- ewolinetz
- csrwng
- staebler
12 changes: 12 additions & 0 deletions ci-operator/step-registry/origin/e2e/origin-e2e-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
workflow:
as: origin-e2e
steps:
pre:
- ref: ipi-conf
- chain: ipi-install
test:
- ref: origin-e2e-test
post:
- chain: ipi-deprovision
documentation: |-
The Origin E2E workflow executes the common end-to-end test suite.
11 changes: 11 additions & 0 deletions ci-operator/step-registry/origin/e2e/test/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
approvers:
- smarterclayton
- wking
- stevekuznetsov
- vrutkovs
- abhinavdahiya
- deads2k
- crawford
- ewolinetz
- csrwng
- staebler
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

cluster_profile=/var/run/secrets/ci.openshift.io/cluster-profile
export AWS_SHARED_CREDENTIALS_FILE=${cluster_profile}/.awscred
export AZURE_AUTH_LOCATION=${cluster_profile}/osServicePrincipal.json
export GCP_SHARED_CREDENTIALS_FILE=${cluster_profile}/gce.json
export HOME=/tmp/home
export PATH=/usr/libexec/origin:$PATH

trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM

mkdir -p "${HOME}"

# if the cluster profile included an insights secret, install it to the cluster to
# report support data from the support-operator
if [[ -f "${cluster_profile}/insights-live.yaml" ]]; then
oc create -f "${cluster_profile}/insights-live.yaml" || true
fi

# set up cloud-provider-specific env vars
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"
KUBE_SSH_KEY_PATH=${cluster_profile}/ssh-privatekey
export KUBE_SSH_BASTION KUBE_SSH_KEY_PATH
case "${CLUSTER_TYPE}" in
gcp)
export GOOGLE_APPLICATION_CREDENTIALS="${GCP_SHARED_CREDENTIALS_FILE}"
export KUBE_SSH_USER=core
mkdir -p ~/.ssh
cp "${cluster_profile}/ssh-privatekey" ~/.ssh/google_compute_engine || true
export TEST_PROVIDER='{"type":"gce","region":"us-east1","multizone": true,"multimaster":true,"projectid":"openshift-gce-devel-ci"}'
;;
aws)
mkdir -p ~/.ssh
cp "${cluster_profile}/ssh-privatekey" ~/.ssh/kube_aws_rsa || true
export PROVIDER_ARGS="-provider=aws -gce-zone=us-east-1"
# TODO: make openshift-tests auto-discover this from cluster config
REGION="$(oc get -o jsonpath='{.status.platformStatus.aws.region}' infrastructure cluster)"
ZONE="$(oc get -o jsonpath='{.items[0].metadata.labels.failure-domain\.beta\.kubernetes\.io/zone}' nodes)"
export TEST_PROVIDER="{\"type\":\"aws\",\"region\":\"${REGION}\",\"zone\":\"${ZONE}\",\"multizone\":true,\"multimaster\":true}"
export KUBE_SSH_USER=core
;;
azure4) export TEST_PROVIDER=azure;;
*) echo >&2 "Unsupported cluster type '${CLUSTER_TYPE}'"; exit 1;;
esac

mkdir -p /tmp/output
cd /tmp/output

if [[ "${CLUSTER_TYPE}" == gcp ]]; then
pushd /tmp
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-256.0.0-linux-x86_64.tar.gz
tar -xzf google-cloud-sdk-256.0.0-linux-x86_64.tar.gz
export PATH=$PATH:/tmp/google-cloud-sdk/bin
mkdir gcloudconfig
export CLOUDSDK_CONFIG=/tmp/gcloudconfig
gcloud auth activate-service-account --key-file="${GCP_SHARED_CREDENTIALS_FILE}"
gcloud config set project openshift-gce-devel-ci
popd
fi

test_suite=openshift/conformance/parallel
if [[ -e "${SHARED_DIR}/test-suite.txt" ]]; then
test_suite=$(<"${SHARED_DIR}/test-suite.txt")
fi

openshift-tests run "${test_suite}" \
--provider "${TEST_PROVIDER}" \
-o /tmp/artifacts/e2e.log \
--junit-dir /tmp/artifacts/junit
12 changes: 12 additions & 0 deletions ci-operator/step-registry/origin/e2e/test/origin-e2e-test-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ref:
as: origin-e2e-test
from: stable:tests
commands: origin-e2e-test-commands.sh
resources:
requests:
cpu: "3"
memory: 600Mi
limits:
memory: 4Gi
documentation: |-
The Origin E2E step executes the common end-to-end test suite.

0 comments on commit a2fd8c3

Please sign in to comment.