From d964bf54c5b99331b1565990e807fabf058c203e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Kon=C4=8Dit=C3=BD?= <44195706+Koncpa@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:06:28 +0200 Subject: [PATCH] Remove install setup and use from common repo Also adjust upstream .fmf plan and check channel just under condition, if it's deployment provided via oc client. --- .packit.yaml | 14 ----- Plans/packit-ci.fmf | 1 + Plans/upstream-operator-all-tests.fmf | 6 +- Setup/clean_cluster/runtest.sh | 2 +- Setup/creating_test_namespace/main.fmf | 4 +- Setup/creating_test_namespace/runtest.sh | 4 +- Setup/install_upstream_tang-operator/main.fmf | 15 ----- .../install_upstream_tang-operator/runtest.sh | 58 ------------------- TestHelpers/functions.sh | 4 +- 9 files changed, 13 insertions(+), 95 deletions(-) delete mode 100644 Setup/install_upstream_tang-operator/main.fmf delete mode 100755 Setup/install_upstream_tang-operator/runtest.sh diff --git a/.packit.yaml b/.packit.yaml index 6243039..c31753d 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -6,20 +6,6 @@ jobs: targets: - fedora-rawhide skip_build: true - tf_extra_params: - environments: - - tmt: - context: - target_PR_branch: main - OC: "false" - UPSTREAM_CODE: "false" - - job: tests - trigger: pull_request - identifier: image_upstream_code - branch: main - targets: - - fedora-stable - skip_build: true tf_extra_params: environments: - tmt: diff --git a/Plans/packit-ci.fmf b/Plans/packit-ci.fmf index bc9c7bf..8af1854 100644 --- a/Plans/packit-ci.fmf +++ b/Plans/packit-ci.fmf @@ -11,6 +11,7 @@ prepare: environment: TANG_IMAGE: "quay.io/sec-eng-special/fedora_tang_server" CI: "true" + EXECUTION_MODE: "MINIKUBE" discover: - name: Configure_test_system diff --git a/Plans/upstream-operator-all-tests.fmf b/Plans/upstream-operator-all-tests.fmf index 7bb5eff..d4ef0d0 100644 --- a/Plans/upstream-operator-all-tests.fmf +++ b/Plans/upstream-operator-all-tests.fmf @@ -10,7 +10,9 @@ prepare: environment: TANG_IMAGE: "quay.io/sec-eng-special/fedora_tang_server" - UPSTREAM_TANG: "true" + UPSTREAM_OPERATOR: "true" + REPO_CLONE: "tang" + EXECUTION_MODE: "minikube" discover: - name: Configure_test_system @@ -19,10 +21,10 @@ discover: ref: main test: - /Setup/setup_local_cluster + - /Setup/install_upstream_operator - name: Run_tests how: fmf test: - - /Setup/install_upstream_tang-operator - /Setup/creating_test_namespace - /Sanity - /Setup/clean_cluster diff --git a/Setup/clean_cluster/runtest.sh b/Setup/clean_cluster/runtest.sh index 6648225..7423d8e 100755 --- a/Setup/clean_cluster/runtest.sh +++ b/Setup/clean_cluster/runtest.sh @@ -50,7 +50,7 @@ rlJournalStart fi rlRun "${OC_CLIENT} delete -f ${TEST_NAMESPACE_FILE}" 0 "Deleting test namespace:${TEST_NAMESPACE}" - if [ "${UPSTREAM_TANG}" == "true" ]; then + if [ "${UPSTREAM_OPERATOR}" == "true" ]; then rlLog "Stop running registry container." rlRun "podman rm --force -t 2 registry" fi diff --git a/Setup/creating_test_namespace/main.fmf b/Setup/creating_test_namespace/main.fmf index f16255b..605ebce 100644 --- a/Setup/creating_test_namespace/main.fmf +++ b/Setup/creating_test_namespace/main.fmf @@ -10,5 +10,5 @@ tag: require+: - libvirt-daemon - podman -duration: 5m -enabled: true \ No newline at end of file +duration: 15m +enabled: true diff --git a/Setup/creating_test_namespace/runtest.sh b/Setup/creating_test_namespace/runtest.sh index 68cc90a..acf6df1 100755 --- a/Setup/creating_test_namespace/runtest.sh +++ b/Setup/creating_test_namespace/runtest.sh @@ -59,6 +59,8 @@ rlJournalStart rlRun "ocpopCheckPodStateAndContinues Running ${TIMEOUT_CONTROLLER_KEEPS_RUNNING} ${OPERATOR_NAMESPACE} ${controller_name}" 0 \ "Checking controller POD continues Running [${TIMEOUT_CONTROLLER_KEEPS_RUNNING} secs.]" #SECENGSP-5573 Issue - rlRun "ocpopCheckOperatorChannel tang-operator stable" + if [ "${DOWNSTREAM_OPERATOR_DEPLOYMENT_CLI}" == "true" ]; then + rlRun "ocpopCheckOperatorChannel tang-operator stable" + fi rlPhaseEnd rlJournalEnd diff --git a/Setup/install_upstream_tang-operator/main.fmf b/Setup/install_upstream_tang-operator/main.fmf deleted file mode 100644 index 3ea070b..0000000 --- a/Setup/install_upstream_tang-operator/main.fmf +++ /dev/null @@ -1,15 +0,0 @@ -summary: Build upstream tang operator. -description: | - Build tang operator from upstream code. -contact: Patrik Koncity -component: - - tang -test: ./runtest.sh -tag: - - CI-Tier-1 -require: - - podman - - go - - git -duration: 10m -enabled: true diff --git a/Setup/install_upstream_tang-operator/runtest.sh b/Setup/install_upstream_tang-operator/runtest.sh deleted file mode 100755 index aed97b8..0000000 --- a/Setup/install_upstream_tang-operator/runtest.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# Copyright 2023. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -[ -n "${TANG_OPERATOR_UPSTREAM_URL}" ] || TANG_OPERATOR_UPSTREAM_URL="https://github.com/latchset/tang-operator.git" -[ -n "${TANG_OPERATOR_UPSTREAM_BRANCH}" ] || TANG_OPERATOR_UPSTREAM_BRANCH="main" - -rlJournalStart - - rlPhaseStartTest "Build tang operator bundle from upstream code" - export IP=$(hostname -I | awk '{print $1}') - if [ -d /var/tmp/tang-operator_sources ]; then - rlLogInfo "Compiling tang-operator bits from /var/tmp/tang-operator_sources" - else - rlLogInfo "Compiling tang-operator from cloned upstream repo" - rlRun "git clone -b ${TANG_OPERATOR_UPSTREAM_BRANCH} ${TANG_OPERATOR_UPSTREAM_URL} /var/tmp/tang-operator_sources" - fi - rlRun "pushd /var/tmp/tang-operator_sources" - rlRun "sed -i 's/FROM golang:1.21 as builder/FROM docker.io\/library\/golang:1.21 as builder/g' Dockerfile" -cat <> /etc/containers/registries.conf -[[registry]] -location = "${IP}:5000" -insecure = true -EOF - rlRun "mkdir -p /var/lib/registry" - #Need to export to use it in make build commands - export IMG="${IP}:5000/tang-controller:latest" - export BUNDLE_IMG="${IP}:5000/tang-operator-bundle:latest" - rlRun "podman container run -dt -p 5000:5000 --name registry --volume registry:/var/lib/registry:Z docker.io/library/registry:2" - #Check if it's registry accesible - rlRun "curl ${IP}:5000/v2/_catalog" 0 "Checking registry availability" - rlRun "make podman-build podman-push" - rlRun "make bundle" - rlRun "make podman-bundle-build podman-bundle-push" - #For another shell sessions - cat < /etc/profile.d/upstream_tang_init.sh -#!/bin/bash -export IMAGE_VERSION=${BUNDLE_IMG} -export RUN_BUNDLE_PARAMS="--use-http" -EOF - popd - rlPhaseEnd - - -rlJournalEnd diff --git a/TestHelpers/functions.sh b/TestHelpers/functions.sh index f137bf6..07ac690 100755 --- a/TestHelpers/functions.sh +++ b/TestHelpers/functions.sh @@ -44,8 +44,8 @@ TO_POD_STOP=5 #seconds TO_SERVICE_START=120 #seconds TO_SERVICE_STOP=120 #seconds -if [ -d /etc/profile.d/upstream_tang_init.sh ]; then - sh /etc/profile.d/upstream_tang_init.sh +if [ -d /etc/profile.d/upstream_operator_init.sh ]; then + sh /etc/profile.d/upstream_operator_init.sh fi TO_ALL_POD_CONTROLLER_TERMINATE=120 #seconds