Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: initial Packit configuration #1

Open
wants to merge 7 commits into
base: rhel-9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .packit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
# vi:ts=2 sw=2 et:
#
# Docs: https://packit.dev/docs/

specfile_path: .packit_rpm/util-linux.spec
synced_files:
- .packit.yaml
- src: .packit_rpm/util-linux.spec
dest: util-linux.spec
upstream_package_name: util-linux
downstream_package_name: util-linux
# `git describe` returns in util-linux's case 'v2.37.2-xxx' which breaks RPM version
# # detection (that expects 2.37.2-xxx'). Let's tweak the version string accordingly
upstream_tag_template: "v{version}"

actions:
post-upstream-clone:
# Use the CentOS Stream specfile
- "git clone https://gitlab.com/redhat/centos-stream/rpms/util-linux.git .packit_rpm --depth=1"
# Drop the "sources" file so rebase-helper doesn't think we're a dist-git
- "rm -fv .packit_rpm/sources"
# Drop all patches, since they're already included in the tarball
- "sed -ri '/^Patch[0-9]+:/d' .packit_rpm/util-linux.spec"
# We need to call autogen, since we use a custom tarball
- "sed -i '/^### Dependencies/aBuildRequires: bison' .packit_rpm/util-linux.spec"
- "sed -i '/^unset LINGUAS/a./autogen.sh' .packit_rpm/util-linux.spec"
# Enable tests after build
- "sed -i '/^### Macros/a%define _with_check 1' .packit_rpm/util-linux.spec"
create-archive:
# We need to override the default create-archive action, since we need to tweak
# the resulting tarball and add a .tarball-version file to it, otherwise
# util-linux fails to detect its version during build
- "bash -c 'echo $PACKIT_PROJECT_VERSION >.tarball-version'"
- "bash -c 'git archive --prefix ${PACKIT_PROJECT_NAME_VERSION}/ --add-file .tarball-version --output .packit_rpm/${PACKIT_PROJECT_NAME_VERSION}.tar.gz HEAD'"
- "bash -c 'echo .packit_rpm/${PACKIT_PROJECT_NAME_VERSION}.tar.gz'"

# Available targets can be listed via `copr-cli list-chroots`
jobs:
# Build test
- job: copr_build
trigger: commit
metadata:
branch: rhel-9
targets:
# FIXME: change to CentOS 9 once it's available
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CentOS 9 targets are now available

- fedora-34-aarch64
- fedora-34-ppc64le
- fedora-34-x86_64

# TODO: configure TFT
# Run tests (via testing farm)
#- job: tests
# trigger: pull_request
# metadata:
# targets:
# # FIXME: change to CentOS 9 once it's available
# - fedora-34-x86_64
2 changes: 1 addition & 1 deletion include/pathnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR "/var/spool/mail"
#endif
#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
#ifndef _PATH_NOLOGIN
# define _PATH_NOLOGIN "/etc/nologin"
#endif
Expand Down
2 changes: 1 addition & 1 deletion login-utils/login.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ static void log_lastlog(struct login_context *cxt)
sa.sa_handler = SIG_IGN;
sigaction(SIGXFSZ, &sa, &oldsa_xfsz);

fd = open(_PATH_LASTLOG, O_RDWR, 0);
fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
if (fd < 0)
goto done;
offset = cxt->pwd->pw_uid * sizeof(ll);
Expand Down
2 changes: 1 addition & 1 deletion tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ OPTS="$OPTS --srcdir=$top_srcdir --builddir=$top_builddir"
if [ -z "$has_asan_opt" ]; then
if [ -e "$top_builddir/Makefile" ]; then
asan=$(awk '/^ASAN_LDFLAGS/ { print $3 }' $top_builddir/Makefile)
else
elif [ -f "$top_builddir/meson.conf" ]; then
. "$top_builddir/meson.conf"
fi
if [ -n "$asan" ]; then
Expand Down
3 changes: 3 additions & 0 deletions tests/ts/eject/umount
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ mkfs.ext2 -q -F $TS_DEVICE
udevadm settle
mkdir -p $TS_MOUNTPOINT
$TS_CMD_MOUNT $TS_DEVICE $TS_MOUNTPOINT
udevadm settle
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
deinit_device
ts_finalize_subtest
Expand All @@ -95,6 +96,7 @@ mkdir -p ${TS_MOUNTPOINT}1
mkdir -p ${TS_MOUNTPOINT}2
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
udevadm settle
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
deinit_device
ts_finalize_subtest
Expand All @@ -115,6 +117,7 @@ mkdir -p ${TS_MOUNTPOINT}1
mkdir -p ${TS_MOUNTPOINT}2
$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
udevadm settle
$TS_CMD_EJECT --force ${TS_DEVICE}1 && ts_log "Success"
deinit_device
ts_finalize_subtest
Expand Down
6 changes: 6 additions & 0 deletions tests/ts/mount/fstab-all
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ echo "${TS_DEVICE}4 ${MOUNTPOINT}D ext4 rw,defaults 0 0" >> $MY_FSTAB
ts_init_subtest "basic"
$TS_CMD_MOUNT --all --fstab $MY_FSTAB >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "mount failed"
udevadm settle
$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D}
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
Expand All @@ -87,6 +88,7 @@ ts_finalize_subtest
ts_init_subtest "filter-type"
$TS_CMD_MOUNT --all --fstab $MY_FSTAB -t ext4 >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "mount failed"
udevadm settle
$TS_CMD_UMOUNT ${MOUNTPOINT}D
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
Expand All @@ -95,6 +97,7 @@ ts_finalize_subtest
ts_init_subtest "filter-notype"
$TS_CMD_MOUNT --all --fstab $MY_FSTAB -t noext4 >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "mount failed"
udevadm settle
$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C}
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
Expand All @@ -103,6 +106,7 @@ ts_finalize_subtest
ts_init_subtest "filter-option"
$TS_CMD_MOUNT --all --fstab $MY_FSTAB -O ro >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "mount failed"
udevadm settle
$TS_CMD_UMOUNT ${MOUNTPOINT}C
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
Expand All @@ -111,6 +115,7 @@ ts_finalize_subtest
ts_init_subtest "override-option"
$TS_CMD_MOUNT --all --fstab $MY_FSTAB -o ro >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "mount failed"
udevadm settle
$TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D}
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
Expand All @@ -132,6 +137,7 @@ $TS_CMD_MOUNT --all \
--target-prefix $MY_ROOT \
-o X-mount.mkdir >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "mount failed"
udevadm settle
$TS_CMD_UMOUNT $MY_ROOT/foo/{A,B,C,D}
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
Expand Down