Compare commits

...

No commits in common. "c8s" and "c8" have entirely different histories.
c8s ... c8

51 changed files with 1 additions and 424 deletions

1
.file.metadata Normal file
View File

@ -0,0 +1 @@
31a67e4dc0a3d7a8d1b850429c3f625314700240 SOURCES/file-5.33.tar.gz

View File

@ -1 +0,0 @@
1

1
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/file-5.33.tar.gz
/file-5.33.tar.gz

2
ci.fmf
View File

@ -1,2 +0,0 @@
# Docs: https://docs.fedoraproject.org/en-US/ci/tmt/#_multiple_plans
resultsdb-testcase: separate

View File

@ -1,7 +0,0 @@
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/file-CI-plan.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}

View File

@ -1,5 +0,0 @@
summary: fedora CI tests plan
discover:
how: fmf
execute:
how: tmt

View File

@ -1,11 +0,0 @@
summary: Internal Tier 1 tests
discover:
how: fmf
url: https://pkgs.devel.redhat.com/git/tests/file
filter: 'tier: 1 | tag: CI-Tier-1'
execute:
how: tmt
adjust:
enabled: false
when: distro == centos-stream or distro == fedora

View File

@ -1 +0,0 @@
SHA512 (file-5.33.tar.gz) = 36c9f2e2aa814b5557eef114fdd3de159688c7a3c9632a9f5c6355c4d2a5694cee81279bda80897616fca07289a7fedb1f797439a2903c76dc84870694773c9e

View File

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of Support-local-additions-to-magic-files
# Description: Support local additions to magic files
# Author: Karel Srot <ksrot@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 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=Support-local-additions-to-magic-files
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: Karel Srot <ksrot@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Support local additions to magic files" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: file" >> $(METADATA)
@echo "Requires: file" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELServer5 -RHELClient5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,9 +0,0 @@
PURPOSE of Support-local-additions-to-magic-files
Description: Test to support local additions to magic files
Author: Karel Srot <ksrot@redhat.com>
Testing custom additions in
/etc/magic
$HOME/.magic
$HOME/.magic.mgc

View File

@ -1,80 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/file/Sanity/Support-local-additions-to-magic-files
# Description: Test to support local additions to magic files
# Author: Karel Srot <ksrot@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 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
. /usr/share/beakerlib/beakerlib.sh
PACKAGE="file"
FILEBACKUP=''
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
[ -f /etc/magic ] && FILEBACKUP=1 && rlFileBackup /etc/magic
[ -f $HOME/.magic ] && FILEBACKUP=1 && rlFileBackup $HOME/.magic
[ -f $HOME/.magic.mgc ] && FILEBACKUP=1 && rlFileBackup $HOME/.magic.mgc
rm -f /etc/magic $HOME/.magic $HOME/.magic.mgc
rlRun "echo '0 string MYFILEFORMAT1 My file format version1' > /etc/magic"
rlRun "echo '0 string MYFILEFORMAT2 My file format version2' > $HOME/.magic"
rlRun "echo 'MYFILEFORMAT1' > testfile1"
rlRun "echo 'MYFILEFORMAT2' > testfile2"
rlRun "echo 'MYFILEFORMAT3' > testfile3"
rlPhaseEnd
rlPhaseStartTest
rlRun "file testfile1 &> out1" 0 "Testing pattern from /etc/magic"
cat out1
rlRun "grep 'My file format version1' out1" 0 "File should be identified as 'My file format version1'"
rlRun "file testfile2 &> out2" 0 "Testing pattern from $HOME/.magic"
cat out2
rlRun "grep 'My file format version2' out2" 0 "File should be identified as 'My file format version2'"
pushd $HOME;
rlRun "file -C -m .magic" 0 "Preparing $HOME/.magic.mgc"
ls -l $HOME/.magic.mgc
rm -f $HOME/.magic
popd
rlRun "file testfile2 &> out3" 0 "Testing pattern from $HOME/.magic.mgc"
cat out3
rlRun "grep 'My file format version2' out3" 0 "File should be identified as 'My file format version2' too"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -rf $TmpDir /etc/magic $HOME/.magic $HOME/.magic.mgc" 0 "Removing tmp directory and test files"
[ -n "$FILEBACKUP" ] && rlFileRestore
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/file/Sanity/command-line-options
# Description: Tests (most of) command line options available for the file command.
# Author: Karel Srot <ksrot@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2010 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/file/Sanity/command-line-options
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE file_cmd_line_options.tar.gz
.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: Karel Srot <ksrot@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Tests (most of) command line options available for the file command." >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: file zlib" >> $(METADATA)
@echo "Requires: file" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,5 +0,0 @@
PURPOSE of /CoreOS/file/Sanity/command-line-options
Description: Tests (most of) command line options available for the file command.
Author: Karel Srot <ksrot@redhat.com>
test multiple cmd line options

View File

@ -1,160 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/file/Sanity/command-line-options
# Description: Test (most of) command line options available for the file command.
# Author: Karel Srot <ksrot@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2010 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/beakerlib/beakerlib.sh
PACKAGE="file"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "cp file_cmd_line_options.tar.gz $TmpDir" 0 "Copying sample files"
rlRun "pushd $TmpDir"
rlRun "tar -xzf file_cmd_line_options.tar.gz" 0 "Extracting sample files"
rlPhaseEnd
rlPhaseStartTest "--brief"
rlRun "file -b dummy_file | grep -q dummy_file" 1 "Checking -b"
rlRun "file --brief dummy_file | grep -q dummy_file" 1 "Checking --brief"
rlPhaseEnd
rlPhaseStartTest "--exclude"
rlRun "file /bin/bash | grep -q 'dynamically linked'"
rlRun "file -e elf /bin/bash | grep -q 'dynamically linked'" 1 "Checking -e elf"
rlRun "file --exclude elf /bin/bash | grep -q 'dynamically linked'" 1 "Checking --exclude elf"
rlPhaseEnd
rlPhaseStartTest "--files-from"
rlRun 'file -f list.txt | grep -q /dev/zero' 0 "Checking -f file"
rlRun 'echo "/dev/zero" | file -f - | grep -q /dev/zero' 0 "Checking -f -"
rlRun 'file --files-from list.txt | grep -q /dev/zero' 0 "Checking --files-from file"
rlRun 'echo "/dev/zero" | file --files-from - | grep -q /dev/zero' 0 "Checking --files-from -"
rlPhaseEnd
rlPhaseStartTest "--separator"
rlRun "file -F '#' dummy_file | grep -q 'dummy_file#'" 0 "Checking -F"
rlRun "file --separator '#' dummy_file | grep -q 'dummy_file#'" 0 "Checking --separator"
rlPhaseEnd
if ! rlIsRHEL 4; then # not for RHEL4
rlPhaseStartTest "--no-dereference"
rlRun "POSIXLY_CORRECT=1 file symlink | grep -q 'symlink: ASCII text'" 0 "Checking -h"
rlRun "POSIXLY_CORRECT=1 file -h symlink | grep -q 'symlink: symbolic link'" 0 "Checking -h"
rlRun "POSIXLY_CORRECT=1 file symlink | grep -q 'symlink: ASCII text'" 0 "Checking --no-dereference"
rlRun "POSIXLY_CORRECT=1 file --no-dereference symlink | grep -q 'symlink: symbolic link'" 0 "Checking --no-dereference"
rlPhaseEnd
fi
rlPhaseStartTest "--mime"
rlRun "file -i dummy_file | grep -q 'text/plain; charset=us-ascii'" 0 "Checking -i"
rlRun "file --mime dummy_file | grep -q 'text/plain; charset=us-ascii'" 0 "Checking --mime"
rlPhaseEnd
rlPhaseStartTest "--dereference"
rlRun "file -L symlink | grep -q 'symbolic link'" 1 "Checking -L"
rlRun "file -L symlink | grep -q 'ASCII text'" 0 "Checking -L"
rlRun "file --dereference symlink | grep -q 'symbolic link'" 1 "Checking --dereference"
rlRun "file --dereference symlink | grep -q 'ASCII text'" 0 "Checking --dereference"
rlPhaseEnd
rlPhaseStartTest "--keep-going"
rlRun "file -k two_types.txt | grep 'Future Composer' | grep 'Apple QuickTime'" 0 "Checking -k"
rlRun "file --keep-going two_types.txt | grep 'Future Composer' | grep 'Apple QuickTime'" 0 "Checking --keep-going"
rlPhaseEnd
rlPhaseStartTest "--no-pad"
rlRun 'WC1=`file dummy_file symlink | grep symlink | wc -c`; echo $WC1'
rlRun 'WC2=`file symlink | wc -c`;echo $WC2'
rlRun 'WC3=`file -N dummy_file symlink | grep symlink | wc -c`;echo $WC3'
rlRun '[ $WC1 -gt $WC3 -a $WC2 -eq $WC3 ]' 0 "Checking -N"
rlRun 'WC3=`file --no-pad dummy_file symlink | grep symlink | wc -c`;echo $WC3'
rlRun '[ $WC1 -gt $WC3 -a $WC2 -eq $WC3 ]' 0 "Checking --no-pad"
rlPhaseEnd
rlPhaseStartTest "--preserve-date"
rlRun 'touch dummy_file; TS1=`stat -c "%X" dummy_file`;echo $TS1; sleep 3'
rlRun 'file -p dummy_file; TS2=`stat -c "%X" dummy_file`;echo $TS2'
rlRun 'file dummy_file; TS3=`stat -c "%X" dummy_file`;echo $TS3'
rlRun '[ $TS3 -gt $TS1 -a $TS1 -eq $TS2 ]' 0 "Checking -p"
rlRun 'touch dummy_file; TS1=`stat -c "%X" dummy_file`;echo $TS1; sleep 3'
rlRun 'file --preserve-date dummy_file; TS2=`stat -c "%X" dummy_file`;echo $TS2'
rlRun 'file dummy_file; TS3=`stat -c "%X" dummy_file`;echo $TS3'
rlRun '[ $TS3 -gt $TS1 -a $TS1 -eq $TS2 ]' 0 "Checking --preserve-date"
rlPhaseEnd
rlPhaseStartTest "--special-files"
rlRun "file /dev/zero | grep -q 'character special'"
rlRun "file -s /dev/zero | grep -q 'data'" 0 "Checking -s"
rlRun "file --special-files /dev/zero | grep -q 'data'" 0 "Checking --special-files"
rlPhaseEnd
rlPhaseStartTest "--version"
rlRun "file -v 2>&1 | egrep 'file-[[:digit:]]\.[[:digit:]]'" 0 "Checking -v"
rlRun "file --version 2>&1 | egrep 'file-[[:digit:]]\.[[:digit:]]'" 0 "Checking --version"
rlPhaseEnd
if ! rlIsRHEL 4; then # not for RHEL4 - this will never be fixed
rlPhaseStartTest "--uncompress"
rlRun "file dummy_file.bz2 | grep -q 'ASCII text'" 1
rlRun "file -z dummy_file.bz2 | grep -q 'ASCII text'" 0 "Checking -z"
rlRun "file --uncompress dummy_file.bz2 | grep -q 'ASCII text'" 0 "Checking --uncompress"
rlPhaseEnd
rlPhaseStartTest "--help"
rlRun "file --help 2>&1 | grep -iq 'usage:'" 0 "Checking --help"
rlPhaseEnd
fi
if [ `rlGetDistroRelease` -ge 6 ]; then
rlPhaseStartTest "--mime-type"
rlRun "file --mime-type dummy_file | grep -q 'text/plain'" 0 "Checking --mime-type"
rlRun "file --mime-type dummy_file | grep -q 'us-ascii'" 1 "Checking --mime-type"
rlPhaseEnd
rlPhaseStartTest "--mime-encoding"
rlRun "file --mime-encoding dummy_file | grep -q 'text/plain'" 1 "Checking --mime-encoding"
rlRun "file --mime-encoding dummy_file | grep -q 'us-ascii'" 0 "Checking --mime-encoding"
rlPhaseEnd
rlPhaseStartTest "--print0"
rlRun "file -0 dummy_file | cat -A | grep -q 'dummy_file^@:'" 0 "Checking -0"
rlRun "file --print0 dummy_file | cat -A | grep -q 'dummy_file^@:'" 0 "Checking --print0"
rlPhaseEnd
fi
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -rf $TmpDir" 0 "Deleting tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,15 +0,0 @@
---
# This first play always runs on the local staging system
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
- atomic
tests:
- Support-local-additions-to-magic-files
- command-line-options
required_packages:
- file # file package required for both tests
- bzip2 # bunzip2 command required for cmd-line-options test