Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into chore/update-kn-e…
Browse files Browse the repository at this point in the history
…vent-jobs
  • Loading branch information
cardil committed May 9, 2024
2 parents 0b94b87 + b8243c5 commit de534b1
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 1 deletion.
Expand Up @@ -4,4 +4,60 @@ set -xeuo pipefail

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

KUBECONFIG="${SHARED_DIR}/kubeconfig" openshift-tests run openshift/conformance -v 2 --provider=none -o "${ARTIFACT_DIR}/e2e.log" --junit-dir "${ARTIFACT_DIR}/junit"
IP_ADDRESS="$(cat "${SHARED_DIR}"/public_address)"
MICROSHIFT_URL="https://${IP_ADDRESS}:6443"
CONFORMANCE_SKIP="/tmp/skip.txt"
touch "${CONFORMANCE_SKIP}"
CONFORMANCE_TEST_LIST="/tmp/tests.txt"
touch "${CONFORMANCE_TEST_LIST}"
export STATIC_CONFIG_MANIFEST_DIR=/tmp/manifests
mkdir "${STATIC_CONFIG_MANIFEST_DIR}"
export KUBECONFIG="${SHARED_DIR}/kubeconfig"


# The base image for this step is incapable of ssh-ing to MicroShift's VM because
# of user configuration. Since this image comes from promotion of origin we would
# like to leave it untouched. The skip list is within MicroShift's code, which is
# inside the VM that we need to ssh. Use the previous step (openshift-microshift-infra-conformance-setup)
# to put the list in the $SHARED_DIR so its available for any other step that may
# need it.
if [ -f "${SHARED_DIR}/conformance-skip.txt" ]; then
cp ${SHARED_DIR}/conformance-skip.txt "${CONFORMANCE_SKIP}"
fi

# Remove skipped tests from current complete test list. This will automatically take new
# tests in and we shall see whether they fail in the very first run in which they are included.
# The test list belongs to MicroShift repo to control this by release.
while read -r test; do
grep -F "$test" "${CONFORMANCE_SKIP}" > /dev/null || echo "$test" >> "${CONFORMANCE_TEST_LIST}"
done < <(openshift-tests run openshift/conformance --dry-run --provider none 2>/dev/null | egrep '^"\[')
cp "${CONFORMANCE_TEST_LIST}" "${ARTIFACT_DIR}/tests.txt"

cat > "${STATIC_CONFIG_MANIFEST_DIR}/infrastructure.yaml" <<EOF
apiVersion: "config.openshift.io/v1"
kind: Infrastructure
metadata:
name: cluster
spec:
platformSpec:
type: None
status:
apiServerURL: ${MICROSHIFT_URL}
controlPlaneTopology: SingleReplica
infrastructureTopology: SingleReplica
platform: None
platformStatus:
type: None
EOF
cat > "${STATIC_CONFIG_MANIFEST_DIR}/network.yaml" <<EOF
apiVersion: config.openshift.io/v1
kind: Network
metadata:
name: cluster
spec:
networkType: OVNKubernetes
status:
networkType: OVNKubernetes
EOF

openshift-tests run openshift/conformance -f "${CONFORMANCE_TEST_LIST}" -v 2 --provider=none -o "${ARTIFACT_DIR}/e2e.log" --junit-dir "${ARTIFACT_DIR}/junit"
Expand Up @@ -4,6 +4,7 @@ workflow:
allow_best_effort_post_steps: true
pre:
- chain: openshift-microshift-infra-aws-pre
- ref: openshift-microshift-infra-conformance-setup
test:
- ref: openshift-microshift-e2e-origin-conformance
post:
Expand Down
@@ -0,0 +1,5 @@
approvers:
- microshift-approvers
options: {}
reviewers:
- microshift-reviewers
@@ -0,0 +1,23 @@
#!/bin/bash
set -xeuo pipefail


IP_ADDRESS="$(cat "${SHARED_DIR}"/public_address)"
HOST_USER="$(cat "${SHARED_DIR}"/ssh_user)"
INSTANCE_PREFIX="${HOST_USER}@${IP_ADDRESS}"

echo "Using Host $IP_ADDRESS"

mkdir -p "${HOME}/.ssh"
cat <<EOF >"${HOME}/.ssh/config"
Host ${IP_ADDRESS}
User ${HOST_USER}
IdentityFile ${CLUSTER_PROFILE_DIR}/ssh-privatekey
StrictHostKeyChecking accept-new
ServerAliveInterval 30
ServerAliveCountMax 1200
EOF
chmod 0600 "${HOME}/.ssh/config"

ssh "${INSTANCE_PREFIX}" "cat ~/microshift/origin/skip.txt || true" > "${SHARED_DIR}/conformance-skip.txt"
cp "${SHARED_DIR}/conformance-skip.txt" "${ARTIFACT_DIR}/conformance-skip.txt"
@@ -0,0 +1,11 @@
{
"path": "openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.yaml",
"owners": {
"approvers": [
"microshift-approvers"
],
"reviewers": [
"microshift-reviewers"
]
}
}
@@ -0,0 +1,18 @@
ref:
as: openshift-microshift-infra-conformance-setup
from: test-runtime
grace_period: 10m
commands: openshift-microshift-infra-conformance-setup-commands.sh
resources:
requests:
cpu: 50m
memory: 100Mi
env:
- name: HOME
default: /tmp/secret
credentials:
- namespace: test-credentials
name: microshift-rhsm-creds
mount_path: /var/run/rhsm/
documentation: >-
This step copies conformance tests relevant files from MicroShift VM into $SHARED_DIR for later use.

0 comments on commit de534b1

Please sign in to comment.