From a56a94947c082cd04f8b0303b86aa9961f81e8c8 Mon Sep 17 00:00:00 2001 From: Rachel Sibley Date: Mon, 16 Oct 2017 16:00:11 -0400 Subject: [PATCH] Initial commit for downstream tests using standard test interface --- tests/tests.yml | 12 ++++++++ tests/various/Makefile | 64 ++++++++++++++++++++++++++++++++++++++++ tests/various/PURPOSE | 3 ++ tests/various/runtest.sh | 52 ++++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 tests/tests.yml create mode 100644 tests/various/Makefile create mode 100644 tests/various/PURPOSE create mode 100755 tests/various/runtest.sh diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..b6f2dd1 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +# Test which run in classic and docker environemnt +- hosts: localhost + tags: + - classic + - container + roles: + - role: standard-test-beakerlib + tests: + - various + required_packages: + - util-linux + - util-linux-user 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