Skip to content

Commit

Permalink
packit: add fedora latest
Browse files Browse the repository at this point in the history
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
  • Loading branch information
dougsland committed Oct 31, 2024
1 parent 561050f commit 69c3e60
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
- &bluechi_copr_repo
type: repository-file
id: https://copr.fedorainfracloud.org/coprs/g/centos-automotive-sig/bluechi-snapshot/repo/centos-stream-9
- &bluechi_copr_repo_fedora
type: repository-file
id: https://copr.fedorainfracloud.org/coprs/g/centos-automotive-sig/bluechi-snapshot/repo/fedora
hardware:
disk:
- size: ">= 20 GB"
Expand Down Expand Up @@ -84,11 +87,13 @@ jobs:
identifier: qm-tier-0
tmt_plan: /plans/e2e/tier-0
targets:
- fedora-latest
- epel-9-x86_64
tf_extra_params:
environments:
- artifacts:
- *bluechi_copr_repo
- *bluechi_copr_repo_fedora
hardware:
disk:
- size: ">= 20 GB"
Expand Down
50 changes: 41 additions & 9 deletions tests/e2e/set-ffi-env-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,53 @@ while [ $# -gt 0 ]; do
esac
done

install_qm_rpms() {
install_fedora_base_repo() {
local repo_file="/etc/yum.repos.d/fedora.repo"

if [[ ! -f $repo_file ]]; then
echo "Creating Fedora repository file at $repo_file..."
cat <<EOL > "$repo_file"
[fedora]
name=Fedora \$releasever - \$basearch
#baseurl=http://download.example/pub/fedora/linux/releases/\$releasever/Everything/\$basearch/os/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-\$releasever&arch=\$basearch
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-\$releasever-\$basearch
skip_if_unavailable=False
EOL
echo "Fedora repository created."
else
echo "Fedora repository file already exists at $repo_file."
fi
}

install_qm_rpms() {
info_message "Installing qm setup rpm"
info_message "Installing qm using ${USE_QM_COPR} repo"
info_message "=============================="
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb

# skip if it's fedora
if ! grep -iq "fedora" /etc/os-release; then
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
fi

local release_id
release_id=$(grep ^ID= /etc/os-release | cut -d = -f 2)

if [[ -n "${USE_QM_COPR}" ]]; then
if [[ "${USE_QM_COPR}" != "release" ]]; then
dnf copr enable -y @centos-automotive-sig/bluechi-snapshot centos-stream-9
dnf copr enable -y "${USE_QM_COPR}" centos-stream-9
elif [[ "${USE_QM_COPR}" == "release" && "${release_id}" =~ "centos" ]]; then
if [ ! -f /etc/yum.repos.d/autosd.repo ]; then
dnf copr enable -y @centos-automotive-sig/bluechi-snapshot $1
dnf copr enable -y "${USE_QM_COPR}" $1
if [ ! -f /etc/yum.repos.d/autosd.repo ]; then
info_message "Installing autosd repository"
info_message "=============================="
install_autosd_repo
fi
fi
fi

Expand Down Expand Up @@ -286,7 +312,13 @@ echo
info_message "Preparing QM environment"
info_message "=============================="

install_qm_rpms
if grep -iq "fedora" /etc/os-release; then
install_fedora_base_repo
install_qm_rpms "fedora"
else
install_qm_rpms "centos-stream-9"
fi

setup_qm_services

info_message "${GRN}QM environment${CLR}"
Expand Down

0 comments on commit 69c3e60

Please sign in to comment.