diff --git a/Makefile b/Makefile index b32b21e62b..1747826396 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,10 @@ feature-wait: @echo "Waiting for features" SKIP_TESTS="$(SKIP_TESTS)" FEATURES="$(FEATURES)" hack/feature-wait.sh +custom-rpms: + @echo "Installing rpms" + RPMS_SRC="$(RPMS_SRC)" hack/custom_rpms.sh + test-bin: @echo "Making test binary" cnf-tests/hack/build-test-bin.sh diff --git a/README.md b/README.md index bec169b861..aa33587fdd 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,17 @@ The full test suite can be found at [https://github.com/openshift/openshift-test - optionally run `ORIGIN_TESTS_REPOSITORY=test.repository.com:5000/origin-tests make origin-tests-disconnected-environment` to mirror all the required test images to a container image repository and source required test images from your repository when running origin-tests in a disconnected environment. +### Custom RPMs +The custom RPMs utility allows to install RPMs from an external source on an OCP node. +RPMS_SRC (RPMs download source URL) must be provided. +REMOVE_PACKAGES should be set when installing RT kernel RPMs to override the installed kernel packages. +RPMS_NODE_ROLE is optional and defaults to `node-role.kubernetes.io/worker`. + +- run `RPMS_SRC="http://test.download.com/example1.rpm http://test.download.com/example2.rpm" make custom-rpms`. + This will install all the RPMs listed in RPMS_SRC on the selected nodes. + +- optionally run `RPMS_SRC="http://test.download.com/rt-kernel-package1.rpm http://test.download.com/rt-kernel-package1.rpm http://test.download.com/rt-kernel-package3.rpm" REMOVE_PACKAGES="kernel kernel-core kernel-modules kernel-modules-extra" make custom-rpms` to install RT kernel RPMs listed in RPMS_SRC on the selected nodes and override the installed kernel packages listed in REMOVE_PACKAGES. + ### Dockerized version A dockerized version of CNF tests is available at [quay.io/openshift-kni/cnf-tests](https://quay.io/openshift-kni/cnf-tests). diff --git a/hack/custom_rpms.sh b/hack/custom_rpms.sh new file mode 100755 index 0000000000..ba07ec0b47 --- /dev/null +++ b/hack/custom_rpms.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +set -e + +. $(dirname "$0")/common.sh + +RPMS_SRC="${RPMS_SRC:-}" +REMOVE_PACKAGES="${REMOVE_PACKAGES:-}" +RPMS_NODE_ROLE="${RPMS_NODE_ROLE:-node-role.kubernetes.io/worker}" + +if [ "$RPMS_SRC" == "" ]; then + echo "[ERROR]: No RPMS_SRC provided" + exit 1 +fi + +cat < \${LOG_FILE} + + rm -Rf \${TEMP_DIR} + + # Reboot to apply changes + systemctl reboot +EOF + +cm_id=$(${OC_TOOL} get configmap rpms-entrypoint -o json | jq '.metadata.resourceVersion' | tr -d '"') + +cat <