From d466c8f4447b44663efb3ed82f5eab5bf7ee677f Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Tue, 11 Jul 2023 10:37:50 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 66 +++++++++++++++++++++++++++++++++++++++ STAGE1-util-linux | 12 +++++++ tests/tests.yml | 57 +++++++++++++++++++++++++++++++++ tests/upstream/runtest.sh | 37 ++++++++++++++++++++++ tests/various/Makefile | 64 +++++++++++++++++++++++++++++++++++++ tests/various/PURPOSE | 3 ++ tests/various/runtest.sh | 52 ++++++++++++++++++++++++++++++ 7 files changed, 291 insertions(+) create mode 100644 STAGE1-util-linux create mode 100644 tests/tests.yml create mode 100755 tests/upstream/runtest.sh create mode 100644 tests/various/Makefile create mode 100644 tests/various/PURPOSE create mode 100755 tests/various/runtest.sh diff --git a/.gitignore b/.gitignore index 36c1fbc..8b3baae 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,67 @@ +/floppy-0.16.tar.bz2 +/util-linux-2.19-rc1.tar.bz2 +/util-linux-2.19-rc1-32-gbded43d.tar.bz2 +/util-linux-2.19-rc2.tar.bz2 +/util-linux-2.19-rc3.tar.bz2 +/util-linux-2.19.tar.bz2 +*~ +.*.log +*.rpm +/floppy-0.18.tar.bz2 +/util-linux-2.19.1-rc1.tar.bz2 +/util-linux-2.19.1.tar.bz2 +/util-linux-2.20-rc1.tar.bz2 +/util-linux-2.20-rc2.tar.bz2 +/util-linux-2.20.tar.bz2 +/util-linux-2.20.1.tar.bz2 +/util-linux-2.21-rc2.tar.xz +/util-linux-2.21.tar.xz +/util-linux-2.21.1.tar.xz +/util-linux-2.21.2.tar.xz +/util-linux-2.22-rc2.tar.xz +/util-linux-2.22.tar.xz +/util-linux-2.22.1.tar.xz +/util-linux-2.22.2.tar.xz +/util-linux-2.23-rc1.tar.xz +/util-linux-2.23-rc2.tar.xz +/util-linux-2.23.tar.xz +/util-linux-2.23.1.tar.xz +/util-linux-2.23.2.tar.xz +/util-linux-2.24-rc1.tar.xz +/util-linux-2.24.tar.xz +/util-linux-2.24.1.tar.xz +/util-linux-2.24.2.tar.xz +/util-linux-2.25-rc1.tar.xz +/util-linux-2.25-rc2.tar.xz +/util-linux-2.25.tar.xz +/util-linux-2.25.1-rc1.tar.xz +/util-linux-2.25.1.tar.xz +/util-linux-2.25.2.tar.xz +/util-linux-2.26-rc1.tar.xz +/util-linux-2.26-rc2.tar.xz +/util-linux-2.26.tar.xz +/util-linux-2.26.2.tar.xz +/util-linux-2.27-rc1.tar.xz +/util-linux-2.27-rc2.tar.xz +/util-linux-2.27.tar.xz +/util-linux-2.27.1.tar.xz +/util-linux-2.28-rc1.tar.xz +/util-linux-2.28-rc2.tar.xz +/util-linux-2.28.tar.xz +/util-linux-2.28.1.tar.xz +/util-linux-2.28.2.tar.xz +/util-linux-2.29-rc1.tar.xz +/util-linux-2.29-rc2.tar.xz +/util-linux-2.29.tar.xz +/util-linux-2.29.1.tar.xz +/util-linux-2.29.2.tar.xz +/util-linux-2.30-rc1.tar.xz +/util-linux-2.30.tar.xz +/util-linux-2.30.1.tar.xz +/util-linux-2.30.2.tar.xz +/util-linux-2.31-rc1.tar.xz +/util-linux-2.31-rc2.tar.xz +/util-linux-2.31.tar.xz +/util-linux-2.32-rc1.tar.xz +/util-linux-2.32.tar.xz /util-linux-2.32.1.tar.xz diff --git a/STAGE1-util-linux b/STAGE1-util-linux new file mode 100644 index 0000000..f492ecb --- /dev/null +++ b/STAGE1-util-linux @@ -0,0 +1,12 @@ +srpm util-linux +mcd $BUILDDIR/$1 +cat < config.cache +ax_cv_have_tls=yes +scanf_cv_alloc_modifier=ms +EOF +$SRC/${1}-*/configure $TCONFIGARGS --without-ncurses --without-tinfo \ + --prefix=/usr --libexecdir=/usr/lib${SUFFIX} --libdir=/usr/lib${SUFFIX} \ + --disable-wall --cache-file=config.cache --without-python --without-systemd +notparallel +make $J V=1 +make $J install DESTDIR=${ROOTFS} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..f1ea549 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,57 @@ +- hosts: localhost + tags: + - classic + - container + - atomic + vars: + # standard-test-basic directory for tests are relative to {{ tenv_workdir }} + tenv_workdir: /var/test + pre_tasks: + - import_role: + name: standard-test-source + vars: + fetch_only: True + + - name: Copy files including source to test environment + synchronize: + src: "{{ playbook_dir }}/.." + dest: "{{ tenv_workdir }}" + mode: push + ssh_args: "-o UserKnownHostsFile=/dev/null" + + roles: + - role: standard-test-beakerlib + required_packages: + - util-linux + - util-linux-user + tests: + - various + - role: standard-test-basic + required_packages: + - util-linux + - util-linux-user + - coreutils + - bzip2 + - xz + - bc + - device-mapper + - iproute + - mdadm + - e2fsprogs + - binutils + - procps-ng + - sed + - gawk + - file + - git + - rpm-build + tests: + - prepare-source: + dir: ./ + run: rpmbuild -bp {{tenv_workdir}}/*.spec --nodeps --define "_sourcedir {{tenv_workdir}}" --define "_builddir {{tenv_workdir}}/source" + - flatten-source: + dir: ./ + run: shopt -s dotglob; mv {{tenv_workdir}}/source/*/* {{tenv_workdir}}/source + - upstream: + dir: upstream + run: ./runtest.sh diff --git a/tests/upstream/runtest.sh b/tests/upstream/runtest.sh new file mode 100755 index 0000000..f67c86b --- /dev/null +++ b/tests/upstream/runtest.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Copyright (C) 2019 Karel Zak + +srcdir="../source" +testdir="${srcdir}/tests" + +if [ ! -x "${testdir}/run.sh" ]; then + echo "upstream tests not found" + exit 1 +fi + +# We don't compile the tests, but it still needs some hints. +# +echo > ${srcdir}/config.h +echo "#define HAVE_WIDECHAR 1" >> ${srcdir}/config.h +echo "#define HAVE_LINUX_NET_NAMESPACE_H 1" >> ${srcdir}/config.h + +# Remove stuff we don't have in RHEL +# +rm -rf ${testdir}/ts/misc/line + + +version_tests=$(cat ${srcdir}/.version) +version_system=$(rpm -q util-linux) + +echo +echo "Used versions: " +echo " upstream tests: $version_tests" +echo " installed util-linux: $version_system" +echo + +# Run upstream tests +# +${testdir}/run.sh --use-system-commands --noskip-commands --show-diff + +exit $? diff --git a/tests/various/Makefile b/tests/various/Makefile new file mode 100644 index 0000000..2357934 --- /dev/null +++ b/tests/various/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/util-linux/various +# Description: This test groups small sanity and regression tests for util-linux +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/util-linux/Sanity/various +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Miroslav Vadkerti " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: This test groups small sanity and regression tests for util-linux" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: util-linux" >> $(METADATA) + @echo "Requires: util-linux util-linux-user" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL3 -RHEL4 -RHEL5Server -RHEL5Client -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/various/PURPOSE b/tests/various/PURPOSE new file mode 100644 index 0000000..b4de79a --- /dev/null +++ b/tests/various/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/util-linux/various +Description: This test groups small sanity and regression tests for util-linux +Author: Miroslav Vadkerti diff --git a/tests/various/runtest.sh b/tests/various/runtest.sh new file mode 100755 index 0000000..32871f4 --- /dev/null +++ b/tests/various/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/util-linux/various +# Description: This test groups small sanity and regression tests for util-linux +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +#. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="util-linux" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest "return code of chfn should be always 1 in case failure" + rlRun "chfn -f a:b" 1 + rlRun "chfn -o a:b" 1 + rlRun "chfn -p a:b" 1 + rlRun "chfn -h a:b" 1 + rlRun "chfn -x a:b" 1 + rlRun "chfn -f a -o b -p c -h d unknown-user" 1 + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd