From c0f2c7f4650a428a4a938c7a38d51f4a4398d143 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Mon, 10 Jul 2023 16:07:52 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 3 +- EMPTY | 1 - STAGE1-findutils | 9 ++++ findutils-4.6.0.tar.gz.sig | Bin 0 -> 152 bytes tests/smoke/Makefile | 63 ++++++++++++++++++++++++++ tests/smoke/PURPOSE | 3 ++ tests/smoke/runtest.sh | 64 ++++++++++++++++++++++++++ tests/tests.yml | 14 ++++++ tests/xautofs/Makefile | 65 +++++++++++++++++++++++++++ tests/xautofs/PURPOSE | 8 ++++ tests/xautofs/runtest.sh | 90 +++++++++++++++++++++++++++++++++++++ 11 files changed, 317 insertions(+), 3 deletions(-) delete mode 100644 EMPTY create mode 100644 STAGE1-findutils create mode 100644 findutils-4.6.0.tar.gz.sig create mode 100644 tests/smoke/Makefile create mode 100644 tests/smoke/PURPOSE create mode 100755 tests/smoke/runtest.sh create mode 100644 tests/tests.yml create mode 100644 tests/xautofs/Makefile create mode 100644 tests/xautofs/PURPOSE create mode 100755 tests/xautofs/runtest.sh diff --git a/.gitignore b/.gitignore index bb375a2..3c70664 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/findutils-4.6.0.tar.gz -/findutils-4.6.0.tar.gz +/findutils-4.*.*.tar.gz diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/STAGE1-findutils b/STAGE1-findutils new file mode 100644 index 0000000..c3f338d --- /dev/null +++ b/STAGE1-findutils @@ -0,0 +1,9 @@ +srpm $1 +mcd $BUILDDIR/$1 +sed -i~ -e "s,locate/Makefile locate/testsuite/Makefile ,," $SRC/${1}-*/configure +FINDLIBS="-lselinux -ldl" $SRC/${1}-*/configure $TCONFIGARGS +sed -i~ -e "s/ locate / /" Makefile +notparallel +test -d tools/gnulib/lib && make $J V=1 -C tools/gnulib/lib +make $J V=1 +make $J install DESTDIR=${ROOTFS} diff --git a/findutils-4.6.0.tar.gz.sig b/findutils-4.6.0.tar.gz.sig new file mode 100644 index 0000000000000000000000000000000000000000..16a395934e9949f697047a451973c6c5d3fe7496 GIT binary patch literal 152 zcmV;J0B8S+0F?s;09Jvm>!Dk6S!AhR(zXGDRmDynB{ZQw4MVEkkATq4<`x4>k^q_q|OiWH5Dt*gT4|LOBSZjkE` GR?lKA*iGU9 literal 0 HcmV?d00001 diff --git a/tests/smoke/Makefile b/tests/smoke/Makefile new file mode 100644 index 0000000..a68f70e --- /dev/null +++ b/tests/smoke/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/findutils/Sanity/smoke +# Description: Smoke test for find and xargs. +# Author: Branislav Nater +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 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/findutils/Sanity/smoke +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: Branislav Nater " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Smoke test for find and xargs." >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: findutils" >> $(METADATA) + @echo "Requires: findutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/smoke/PURPOSE b/tests/smoke/PURPOSE new file mode 100644 index 0000000..87a1ce1 --- /dev/null +++ b/tests/smoke/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/findutils/Sanity/smoke +Description: Smoke test for find and xargs. +Author: Branislav Nater diff --git a/tests/smoke/runtest.sh b/tests/smoke/runtest.sh new file mode 100755 index 0000000..438548d --- /dev/null +++ b/tests/smoke/runtest.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/findutils/Sanity/smoke +# Description: Smoke test for find and xargs. +# Author: Branislav Nater +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 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 rhts environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/lib/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="findutils" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "touch \"file with spaces\"" 0 + rlRun "mkdir dir" 0 + rlRun "touch dir/file1" 0 + rlPhaseEnd + + rlGetTestState && { + rlPhaseStartTest + rlRun "find . -name \"file*\" -type f | tee output | wc -l > wcout" 0 + cat output + rlAssertGrep 2 wcout + rlRun "find $TmpDir -mindepth 1 -type d | tee output | wc -l > wcout" 0 + cat output + rlAssertGrep 1 wcout + rlRun "find $TmpDir -name \"file*\" -print0 | xargs -0 ls -l | tee output | wc -l > wcout" 0 + cat output + rlAssertGrep 2 wcout + rlPhaseEnd + } + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalEnd +rlJournalPrintText diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..636db22 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,14 @@ +--- +# Tests which will run in all contexts +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + - container + - atomic + tests: + - smoke + - xautofs + required_packages: + - autofs # autofs required for xautofs test diff --git a/tests/xautofs/Makefile b/tests/xautofs/Makefile new file mode 100644 index 0000000..d273b6f --- /dev/null +++ b/tests/xautofs/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/findutils/Sanity/options/xautofs +# Description: Check xautofs option +# Author: Petr Splichal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 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/findutils/Sanity/options/xautofs +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) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Branislav Nater " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Check xautofs option" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: findutils" >> $(METADATA) + @echo "Requires: autofs findutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 485672 529391" >> $(METADATA) + @echo "Releases: -RHEL3 -RHEL4" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/xautofs/PURPOSE b/tests/xautofs/PURPOSE new file mode 100644 index 0000000..e20bfd1 --- /dev/null +++ b/tests/xautofs/PURPOSE @@ -0,0 +1,8 @@ +PURPOSE of /CoreOS/findutils/Sanity/options/xautofs +Description: Check xautofs option +Author: Petr Splichal +Bug summary: [RFE] Modify find to be able to skip direct mapped autofs mounts +Bugzilla link: None + +Check that the new -xautofs option works as expected: make sure +find does not descend into directories on autofs filesystems. diff --git a/tests/xautofs/runtest.sh b/tests/xautofs/runtest.sh new file mode 100755 index 0000000..a0a2cb1 --- /dev/null +++ b/tests/xautofs/runtest.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/findutils/Sanity/options/xautofs +# Description: Check xautofs option +# Author: Petr Splichal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 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 rhts environment +. /usr/bin/rhts-environment.sh +. /usr/share/rhts-library/rhtslib.sh + +PACKAGE="findutils" + +MasterConf="/etc/auto.master" +DirectConf="/etc/auto.direct" + +MountDir="/mnt/findutils" +AutomountDir="$MountDir/etc" +RegularDir="$MountDir/regular/directory/master" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlAssertRpm "autofs" + rlRun "set -o pipefail" + + # create dirs & back up + rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" + rlRun "mkdir -p $RegularDir" 0 "Creating regular directory" + rlRun "rlFileBackup $MasterConf" + + # set up autofs + rlRun "echo '/- /etc/auto.direct' > $MasterConf" \ + 0 "Setting up autofs master map" + rlRun "echo '$AutomountDir localhost:/etc' > $DirectConf" \ + 0 "Setting up autofs direct map" + + # RHEL-7 is using xfs + rlIsRHEL 4 5 6 && fs="ext[34]" || fs="xfs" + + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest "Without -xautofs option" + rlRun "rlServiceStart autofs" 0 "Starting autofs" + rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts" + rlRun "find $MountDir -noleaf -name '*master*' | tee filelist" + rlAssertGrep "$RegularDir" "filelist" + rlAssertGrep "$MountDir$MasterConf" "filelist" + rlAssertGrep "$AutomountDir.*$fs" "/proc/mounts" + rlPhaseEnd + + rlPhaseStartTest "With -xautofs option" + rlRun "rlServiceStart autofs" 0 "Starting autofs" + rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts" + rlRun "find $MountDir -xautofs -noleaf -name '*master*' | tee filelist" + rlAssertGrep "$RegularDir" "filelist" + rlAssertNotGrep "$MountDir$MasterConf" "filelist" + rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rlFileRestore" + rlRun "rlServiceRestore autofs" + rlRun "rm -r $TmpDir $DirectConf $MountDir" 0 "Removing tmp files" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd