diff --git a/README b/README deleted file mode 100644 index 8c89006..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -testsuite for 'cpio' RPM diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..af6b6c9 --- /dev/null +++ b/README.rst @@ -0,0 +1,4 @@ +Cpio Tests +=========== + +repository for cpio tests diff --git a/sanity-test-create-extract/Makefile b/sanity-test-create-extract/Makefile new file mode 100644 index 0000000..e2bf33d --- /dev/null +++ b/sanity-test-create-extract/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cpio/Sanity/sanity-test-create-extract +# Description: it creates archive in file and extract files then +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# 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 the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/cpio/Sanity/sanity-test-create-extract +export TESTVERSION=1.1 + +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: Jan Scotka " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: it creates archive in file and extract files then" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cpio" >> $(METADATA) + @echo "Requires: cpio tar gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) + diff --git a/sanity-test-create-extract/PURPOSE b/sanity-test-create-extract/PURPOSE new file mode 100644 index 0000000..68d152f --- /dev/null +++ b/sanity-test-create-extract/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cpio/Sanity/sanity-test-create-extract +Description: it creates archive in file and extract files then +Author: Jan Scotka diff --git a/sanity-test-create-extract/runtest.sh b/sanity-test-create-extract/runtest.sh new file mode 100644 index 0000000..1a883c1 --- /dev/null +++ b/sanity-test-create-extract/runtest.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cpio/Sanity/sanity-test-create-extract +# Description: it creates archive in file and extract files then +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/lib/beakerlib/beakerlib.sh + +PACKAGE="cpio" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + tmp=`mktemp -d` + cd $tmp + mkdir arch +# creating thousand of files + rlRun 'for foo in `seq 1000`;do touch x.$foo;done' +# creating bigger files + rlRun 'for foo in `seq 10`;do dd if=/dev/zero of=y.$foo bs=1k seek=$foo count=1;ls -sh y.$foo;done' + rlPhaseEnd + + rlPhaseStartTest + rlRun 'ls x.* | cpio -ov > arch/x.cpio' + rlRun 'ls y.* | cpio -ov > arch/y.cpio' + rlRun 'find . -type f -maxdepth 1 | cpio -ov > arch/z.cpio' + + cd arch + + + rlRun 'cpio -i < x.cpio' + rlRun 'cpio -i < y.cpio' + rlLog "thereis `ls y.* |wc -w` words in y.*" + rlLog "thereis `ls x.* |wc -w` words in x.*" + rlRun 'ls y.* |wc -w |grep 11' + rlRun 'ls x.* |wc -w |grep 1001' + + rm x.* y.* + rlRun 'cpio -i < z.cpio' + rlRun 'ls * |wc -w |grep 1011' + cd / + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm -r $tmp" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd