Compare commits
7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22c7d8cc46 | ||
|
|
34279f6641 | ||
|
|
f9efbfabb3 | ||
|
|
3caf8cddfa | ||
|
|
ad0af4abde | ||
|
|
3289ef9203 | ||
|
|
c5d7ab8674 |
2 changed files with 45 additions and 69 deletions
|
|
@ -1,45 +1,64 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#KOJI_TASK_ID=2596437
|
|
||||||
KOJI_TASK_ID=${KOJI_TASK_ID:-} # Use the environment variable, or an empty string if not set
|
set -e # Exit immediately on any command failure
|
||||||
|
set -u # Treat unset variables as errors
|
||||||
|
|
||||||
|
# Manual way to test any task or build locally
|
||||||
|
#KOJI_TASK_ID=2586515
|
||||||
|
|
||||||
|
KOJI_TASK_ID=${KOJI_TASK_ID:-} # Use environment variable or default to an empty string
|
||||||
|
|
||||||
# Check if KOJI_TASK_ID is set
|
# Check if KOJI_TASK_ID is set
|
||||||
[ -n "$KOJI_TASK_ID" ] || {
|
if [ -z "$KOJI_TASK_ID" ]; then
|
||||||
echo "WARN: KOJI_TASK_ID not set!"
|
echo "WARN: KOJI_TASK_ID not set!"
|
||||||
echo "WARN: not able to find scratch build, RPMS will be pulled from repo" >&2
|
echo "WARN: RPMS will be pulled from the repo as fallback." >&2
|
||||||
echo "WARN: this variable should be either provided or passed from Testing Farm" >&2
|
echo "INFO: This variable should be either provided or passed from Testing Farm." >&2
|
||||||
exit 0
|
exit 0
|
||||||
}
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Get the current architecture
|
# Get the current architecture
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
echo "INFO: Detected architecture: $ARCH"
|
||||||
|
|
||||||
# Download the build for the current architecture
|
# Function to download build using `koji download-build` with progress
|
||||||
koji download-build $KOJI_TASK_ID --arch=$ARCH || {
|
download_with_koji_build() {
|
||||||
echo "Failed to download build $KOJI_TASK_ID for architecture $ARCH using koji" >&2
|
echo "INFO: Attempting to download build for task ID $KOJI_TASK_ID using 'koji download-build'."
|
||||||
exit 1
|
koji download-build --arch "$ARCH" "$KOJI_TASK_ID"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to download using `koji download-task` as fallback
|
||||||
|
download_with_koji_task() {
|
||||||
|
echo "INFO: Attempting to download build for task ID $KOJI_TASK_ID using 'koji download-task'."
|
||||||
|
koji download-task --arch "$ARCH" "$KOJI_TASK_ID"
|
||||||
|
}
|
||||||
|
|
||||||
#( koji download-build --debuginfo --task-id --arch noarch --arch x86_64 --arch i686 --arch src $KOJI_TASK_ID || koji download-task --arch noarch --arch x86_64 --arch i686 --arch src $KOJI_TASK_ID ) | egrep Downloading | cut -d " " -f 3 | tee rpms-list-$KOJI_TASK_ID
|
# Attempt both download methods
|
||||||
#ls *[^.src].rpm | sed -r "s/(.*)-.*-.*/\1 \0/" | egrep -v "i686" | awk "{print \$2}" | tee rpms-list
|
if ! download_with_koji_build && ! download_with_koji_task; then
|
||||||
#dnf -y reinstall $(cat rpms-list) || true
|
echo "WARN: Failed to download RPMS from task $KOJI_TASK_ID for architecture $ARCH." >&2
|
||||||
#if [ ! -z "$(sed 's/\s//g' rpms-list)" ];then dnf -y install --allowerasing $(cat rpms-list);else echo "Nothing to install, rpms-list is empty"; fi
|
echo "WARN: Proceeding with fallback mechanism."
|
||||||
#if [ ! -z "$(sed 's/\s//g' rpms-list)" ];then sed 's/.rpm$//' rpms-list | xargs -n1 command printf '%q\n' | xargs -d'\n' rpm -q;else echo 'Nothing to verify, rpms-list is empty'; fi
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Ensure the required RPMs exist
|
# List downloaded RPMs
|
||||||
|
echo "INFO: Listing downloaded RPM files:"
|
||||||
|
ls -1 *.rpm || echo "INFO: No RPM files found in the current directory."
|
||||||
|
|
||||||
|
# Ensure required RPMs are downloaded
|
||||||
MAIN_RPM=$(ls nodejs-*.$ARCH.rpm 2>/dev/null | head -n 1)
|
MAIN_RPM=$(ls nodejs-*.$ARCH.rpm 2>/dev/null | head -n 1)
|
||||||
DEPENDENCY_RPM=$(ls nodejs-libs-*.$ARCH.rpm 2>/dev/null | head -n 1)
|
DEPENDENCY_RPM=$(ls nodejs-libs-*.$ARCH.rpm 2>/dev/null | head -n 1)
|
||||||
NPM_RPM=$(ls nodejs-npm-*.$ARCH.rpm 2>/dev/null | head -n 1)
|
NPM_RPM=$(ls nodejs-npm-*.$ARCH.rpm 2>/dev/null | head -n 1)
|
||||||
|
DEVEL_RPM=$(ls nodejs-devel-*.$ARCH.rpm 2>/dev/null | head -n 1)
|
||||||
|
|
||||||
# Check if all necessary RPMs are found
|
if [ -z "$MAIN_RPM" ] || [ -z "$DEPENDENCY_RPM" ] || [ -z "$NPM_RPM" ] || [ -z "$DEVEL_RPM" ]; then
|
||||||
if [ -z "$MAIN_RPM" ] || [ -z "$DEPENDENCY_RPM" ] || [ -z "$NPM_RPM" ]; then
|
echo "WARN: Required RPMs not found for $ARCH architecture. Proceeding without installation." >&2
|
||||||
echo "Required RPMs not found for x86_64 architecture." >&2
|
exit 0
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install the main package, its dependency, and npm package
|
# Install the RPMs
|
||||||
rpm -ivh "$MAIN_RPM" "$DEPENDENCY_RPM" "$NPM_RPM" || {
|
echo "INFO: Installing RPMs:"
|
||||||
echo "Failed to install RPMs" >&2
|
echo "INFO: $MAIN_RPM, $DEPENDENCY_RPM, $NPM_RPM, $DEVEL_RPM"
|
||||||
exit 1
|
if ! dnf install -y --allowerasing "$MAIN_RPM" "$DEPENDENCY_RPM" "$NPM_RPM" "$DEVEL_RPM"; then
|
||||||
}
|
echo "WARN: Failed to install some RPMs using DNF. Continuing with tmt require standart installation." >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "INFO: Script completed."
|
||||||
|
|
|
||||||
43
plans.fmf
43
plans.fmf
|
|
@ -1,43 +0,0 @@
|
||||||
# Shared metadata
|
|
||||||
discover:
|
|
||||||
how: fmf
|
|
||||||
execute:
|
|
||||||
how: tmt
|
|
||||||
# Will be overwritten by CI
|
|
||||||
#environment:
|
|
||||||
# KOJI_BUILD_ID: 123
|
|
||||||
provision:
|
|
||||||
how: container
|
|
||||||
image: 'fedora:rawhide'
|
|
||||||
prepare:
|
|
||||||
- name: Install test deps
|
|
||||||
how: install
|
|
||||||
package:
|
|
||||||
- koji
|
|
||||||
- libuv
|
|
||||||
- name: Install fresh packages from Koji
|
|
||||||
how: shell
|
|
||||||
script: ./install-rpms.sh
|
|
||||||
|
|
||||||
# Filtering
|
|
||||||
/all:
|
|
||||||
summary: Run all available tests
|
|
||||||
|
|
||||||
/smoke:
|
|
||||||
summary: Run all smoke tests
|
|
||||||
discover:
|
|
||||||
how: fmf
|
|
||||||
filter: "tag:smoke"
|
|
||||||
|
|
||||||
/integration:
|
|
||||||
summary: Run all intergraion tests
|
|
||||||
discover:
|
|
||||||
how: fmf
|
|
||||||
filter: "tag: integration"
|
|
||||||
|
|
||||||
# Way to test new TCs
|
|
||||||
#/new:
|
|
||||||
# summary: Test new TC
|
|
||||||
# discover:
|
|
||||||
# how: fmf
|
|
||||||
# filter: "tag: new"
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue