From 216d34b39e58e9274fe14cdc4af11e2baba69940 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Feb 20 2019 08:49:06 +0000 Subject: sanity-test-create-extract: move to Sanity/ subdir This is to simplify synchronization with Red Hat tests/ namespace. --- diff --git a/Sanity/sanity-test-create-extract/Makefile b/Sanity/sanity-test-create-extract/Makefile new file mode 100644 index 0000000..e2bf33d --- /dev/null +++ b/Sanity/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/sanity-test-create-extract/PURPOSE b/Sanity/sanity-test-create-extract/PURPOSE new file mode 100644 index 0000000..68d152f --- /dev/null +++ b/Sanity/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/sanity-test-create-extract/main.fmf b/Sanity/sanity-test-create-extract/main.fmf new file mode 100644 index 0000000..8133e3e --- /dev/null +++ b/Sanity/sanity-test-create-extract/main.fmf @@ -0,0 +1,3 @@ +summary: create/extract (sanity) +description: ssia +tier: 1 diff --git a/Sanity/sanity-test-create-extract/runtest.sh b/Sanity/sanity-test-create-extract/runtest.sh new file mode 100644 index 0000000..1a883c1 --- /dev/null +++ b/Sanity/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 diff --git a/sanity-test-create-extract/Makefile b/sanity-test-create-extract/Makefile deleted file mode 100644 index e2bf33d..0000000 --- a/sanity-test-create-extract/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 deleted file mode 100644 index 68d152f..0000000 --- a/sanity-test-create-extract/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -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/main.fmf b/sanity-test-create-extract/main.fmf deleted file mode 100644 index 8133e3e..0000000 --- a/sanity-test-create-extract/main.fmf +++ /dev/null @@ -1,3 +0,0 @@ -summary: create/extract (sanity) -description: ssia -tier: 1 diff --git a/sanity-test-create-extract/runtest.sh b/sanity-test-create-extract/runtest.sh deleted file mode 100644 index 1a883c1..0000000 --- a/sanity-test-create-extract/runtest.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/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