-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from jpopelka/jirka
Bunch of various updates
- Loading branch information
Showing
28 changed files
with
632 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
jobs: | ||
- job: copr_build | ||
trigger: pull_request | ||
targets: | ||
- fedora-all | ||
- epel-7 | ||
- epel-8 | ||
- epel-9 | ||
# - job: copr_build | ||
# trigger: commit | ||
# branch: main | ||
# targets: | ||
# - fedora-all | ||
# - epel-7 | ||
# - epel-8 | ||
# - epel-9 | ||
# owner: "@osci" | ||
# project: mini-tps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# HOWTO: https://pre-commit.com/#usage | ||
# dnf install pre-commit | ||
# pre-commit install -t pre-commit -t pre-push | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.6 | ||
hooks: | ||
- id: ruff-format | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: v0.9.0.6 | ||
hooks: | ||
- id: shellcheck | ||
args: [--severity=error] | ||
# unused ? | ||
exclude: (ver_cmp.sh|mtps*-xunit|mtps-tag|mtps-run-mtests|mtps-module-test) | ||
|
||
ci: | ||
autoupdate_schedule: quarterly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,10 @@ rpmbuild --define="_sourcedir $PWD" --define="%_srcrpmdir $PWD" -bs mini-tps.spe | |
``` | ||
xmllint --xpath 'string(//member[name="build_id"]/value/int/text())' list.xml | ||
curl -k --data @xml-list-rpms "${BREWHUB}" > listg | ||
brewbuild echo 'ls //member[value/string="src"]/../member[name="nvr"]/value/string/text()' | xmllint --shell list.xml | ||
echo 'ls //member[value/string="noarch"]/../member[name="nvr"]/value/string/text()' | xmllint --shell listg | sed -n -e 's/^.*[[:space:]]//p' | ||
brewbuild echo 'ls //member[value/string="src"]/../member[name="nvr"]/value/string/text()' | xmllint --shell list.xml | ||
echo 'ls //member[value/string="noarch"]/../member[name="nvr"]/value/string/text()' | xmllint --shell listg | sed -n -e 's/^.*[[:space:]]//p' | ||
curl -k --data @xmldownloadTaskOutput.xml "${BREWHUB}" | ||
brew -d --debug-xmlrpc taskinfo 18326749 | ||
brew -d --debug-xmlrpc taskinfo 18326749 | ||
koji list-api | ||
git archive --format=tar.gz --prefix mini-tps/ -o mini-tps.tar.gz -v master | ||
rpmdev-bumpspec --comment='Build with the latest merged PRs.' --userstring='Andrei Stepanov <[email protected]>' mini-tps.spec | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
Name: mini-tps | ||
Version: 0.1 | ||
Release: 161%{?dist} | ||
Release: 162%{?dist} | ||
Summary: Mini TPS - Test Package Sanity | ||
|
||
License: GPLv2 | ||
URL: https://gitlab.cee.redhat.com/osci/mini-tps | ||
URL: https://github.com/fedora-ci/mini-tps | ||
Source0: %{name}.tar.gz | ||
Requires: yum-utils | ||
# List of packages for wich do not run 'remove' test. | ||
Requires: openssh-server yum | ||
# mtps-mutils | ||
Requires: libmodulemd | ||
BuildArch: noarch | ||
|
||
%if 0%{?rhel} > 7 | ||
|
@@ -18,51 +20,54 @@ Requires: dnf-plugins-core | |
Requires: libselinux-utils | ||
%endif | ||
|
||
# mtps-mutils | ||
%if 0%{?rhel} == 7 | ||
Requires: python2-gobject-base | ||
%else | ||
Requires: python3-gobject-base | ||
%endif | ||
|
||
%description | ||
Light version of TPS | ||
|
||
%prep | ||
%setup -n %{name} | ||
%autosetup -n %{name} | ||
|
||
%build | ||
|
||
%install | ||
mkdir -p %{buildroot}%{_prefix}/local/bin/ | ||
cp -rfp mtps* %{buildroot}%{_prefix}/local/bin/ | ||
mkdir -p %{buildroot}%{_sysconfdir}/dnf/protected.d | ||
cp -pf mini-tps.conf %{buildroot}%{_sysconfdir}/dnf/protected.d/ | ||
|
||
mkdir -p %{buildroot}%{_sbindir} # epel7 | ||
install -pD -m 0755 --target-directory=%{buildroot}%{_sbindir} mtps-* | ||
install -pD -m 0644 mini-tps.conf %{buildroot}%{_sysconfdir}/dnf/protected.d/mini-tps.conf | ||
# viewer | ||
mkdir -p %{buildroot}%{_datarootdir}/mini-tps/viewer/ | ||
cp -pf viewer/viewer.html %{buildroot}%{_datarootdir}/mini-tps/viewer/ | ||
mkdir -p %{buildroot}%{_libexecdir}/mini-tps/viewer/ | ||
cp -pf viewer/generate-result-json %{buildroot}%{_libexecdir}/mini-tps/viewer/ | ||
install -pD -m 0755 viewer/generate-result-json %{buildroot}%{_libexecdir}/mini-tps/viewer/generate-result-json | ||
install -pD -m 0644 viewer/viewer.html %{buildroot}%{_datarootdir}/mini-tps/viewer/viewer.html | ||
|
||
# profiles | ||
mkdir -p %{buildroot}%{_datarootdir}/mini-tps/profiles/{rhel,centos-stream,fedora}/ | ||
# rhel | ||
cp -rfp profiles/rhel/{repos,optrepos}/ %{buildroot}%{_datarootdir}/mini-tps/profiles/rhel/ | ||
# centos-stream | ||
cp -rfp profiles/centos-stream/{repos,optrepos}/ %{buildroot}%{_datarootdir}/mini-tps/profiles/centos-stream/ | ||
# fedora | ||
cp -rfp profiles/fedora/repos/ %{buildroot}%{_datarootdir}/mini-tps/profiles/fedora/ | ||
|
||
# prepare scripts | ||
mkdir -p %{buildroot}%{_libexecdir}/mini-tps/{rhel,centos-stream,fedora}/ | ||
# rhel | ||
cp -pf profiles/rhel/prepare-system %{buildroot}%{_libexecdir}/mini-tps/rhel/ | ||
# centos-stream | ||
cp -pf profiles/centos-stream/prepare-system %{buildroot}%{_libexecdir}/mini-tps/centos-stream/ | ||
# fedora | ||
cp -pf profiles/fedora/prepare-system %{buildroot}%{_libexecdir}/mini-tps/fedora/ | ||
install -pD -m 0755 profiles/rhel/prepare-system %{buildroot}%{_libexecdir}/mini-tps/rhel/prepare-system | ||
install -pD -m 0755 profiles/centos-stream/prepare-system %{buildroot}%{_libexecdir}/mini-tps/centos-stream/prepare-system | ||
install -pD -m 0755 profiles/fedora/prepare-system %{buildroot}%{_libexecdir}/mini-tps/fedora/prepare-system | ||
|
||
%files | ||
%{_prefix}/local/bin/mtps* | ||
%{_sysconfdir}/dnf/protected.d/mini-tps.conf | ||
%{_sbindir}/mtps-* | ||
%config %{_sysconfdir}/dnf/protected.d/mini-tps.conf | ||
%{_datarootdir}/mini-tps/* | ||
%{_libexecdir}/mini-tps/* | ||
|
||
|
||
%changelog | ||
* Fri Nov 24 2023 Jiri Popelka <[email protected]> - 0.1-162 | ||
- URL update | ||
- move mtps-* executables from /usr/local/bin/ to /usr/sbin/ | ||
- use install instead of mkdir & cp | ||
- mtps-mutils Requires: python-gobject-base | ||
|
||
* Mon Jul 31 2023 Andrei Stepanov <[email protected]> - 0.1-161 | ||
- new build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash -efu | ||
#!/usr/bin/bash -efu | ||
|
||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -15,7 +15,7 @@ | |
# Author: Andrei Stepanov <[email protected]> | ||
|
||
|
||
PROG="${PROG:-${0##*/}}" | ||
: "${PROG:=${0##*/}}" | ||
|
||
# Source `mtps-setup' from $PATH | ||
if command -v "mtps-setup" >/dev/null; then source "mtps-setup"; fi | ||
|
@@ -48,7 +48,6 @@ box_out() { | |
echo -e "| ${b//?/ } |\n-${b//?/-}-" | ||
} | ||
|
||
# http://wiki.bash-hackers.org/howto/getopts_tutorial | ||
opt_str="$@" | ||
opt=$(getopt -n "$0" --options "hvt:s:m:" --longoptions "help,verbose,mmd:,test:,selinux:" -- "$@") | ||
eval set -- "$opt" | ||
|
@@ -78,12 +77,9 @@ done | |
|
||
# Entry | ||
|
||
DEBUG="${DEBUG:-}" | ||
MMD="${MMD:-}" | ||
# Put logs by default at CDIR/mtps-logs | ||
LOGS_DIR="${LOGS_DIR:-mtps-logs}" | ||
: "${DEBUG:=}" | ||
|
||
debug "MMD: $MMD" | ||
debug "MMD: ${MMD:=}" | ||
debug "Use ${YUMDNFCMD}" | ||
|
||
# Test correct invocation | ||
|
@@ -107,7 +103,9 @@ box_out "# DEPENDENCY" "" "Modules to be enabled:" "" "${requires_list[@]:-}" | |
|
||
# Prefix all files with common suffix | ||
TESTRUN_ID="$(date +%H%M%S)" | ||
mkdir -p "$LOGS_DIR" | ||
|
||
# Put logs by default at CWD/mtps-logs | ||
mkdir -p "${LOGS_DIR:=mtps-logs}" | ||
|
||
for require in "${requires[@]}"; do | ||
ret=1 | ||
|
@@ -127,7 +125,7 @@ for require in "${requires[@]}"; do | |
"" \ | ||
" Name: $name" \ | ||
" Stream: $stream" | ||
logfname="${LOGS_DIR%%/}/$TESTRUN_ID-enable-$name-$stream.log" | ||
logfname="${LOGS_DIR%%/}/${TESTRUN_ID}-enable-${name}-${stream}.log" | ||
echo "Reset module: $name" | tee -a "$logfname" | ||
"${YUMDNFCMD}" -y module reset "$name" 2>&1 | tee -a "$logfname" | ||
test_status="${PIPESTATUS[0]}" | ||
|
@@ -150,7 +148,7 @@ for require in "${requires[@]}"; do | |
fi | ||
done | ||
if [ "$ret" -ne "0" ]; then | ||
echo "Fail to meet module dependecy. No one can be enabled from: ${require// / or }" | ||
echo "Fail to meet module dependency. No one can be enabled from: ${require// / or }" | ||
exit 1 | ||
fi | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.