From 12b7334ca7981742dfb6166e7642d5df62fdaee7 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 23 Jan 2020 16:59:37 +0100 Subject: [PATCH] added gating tests --- .../Sanity-test-for-librabbitmq/Makefile | 63 +++++++++++++++++++ .../Sanity-test-for-librabbitmq/PURPOSE | 3 + .../Sanity-test-for-librabbitmq/runtest.sh | 58 +++++++++++++++++ tests/tests.yml | 11 ++++ 4 files changed, 135 insertions(+) create mode 100644 tests/Sanity/Sanity-test-for-librabbitmq/Makefile create mode 100644 tests/Sanity/Sanity-test-for-librabbitmq/PURPOSE create mode 100755 tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh create mode 100644 tests/tests.yml diff --git a/tests/Sanity/Sanity-test-for-librabbitmq/Makefile b/tests/Sanity/Sanity-test-for-librabbitmq/Makefile new file mode 100644 index 0000000..d50938a --- /dev/null +++ b/tests/Sanity/Sanity-test-for-librabbitmq/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/librabbitmq/Sanity/Sanity-test-for-librabbitmq +# Description: Tests the sanity of librabbitmq +# Author: Than Ngo +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# 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/librabbitmq/Sanity/Sanity-test-for-librabbitmq +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: Than Ngo " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: tests basic functionality" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: librabbitmq" >> $(METADATA) + @echo "Requires: librabbitmq librabbitmq-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: MIT" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/Sanity-test-for-librabbitmq/PURPOSE b/tests/Sanity/Sanity-test-for-librabbitmq/PURPOSE new file mode 100644 index 0000000..d4111a3 --- /dev/null +++ b/tests/Sanity/Sanity-test-for-librabbitmq/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/librabbitmq/Sanity/Sanity-test-for-librabbitmq +Description: Tests the sanity +Author: Than Ngo diff --git a/tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh b/tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh new file mode 100755 index 0000000..76ed9f6 --- /dev/null +++ b/tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/librabbitmq/Sanity/Sanity-test-for-librabbitmq +# Description: Tests the sanity +# Author: Than Ngo , Brock Organ +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# 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. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +PACKAGES="librabbitmq librabbitmq-devel" + +# source the test script helpers +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + for p in $PACKAGES ; do + rlAssertRpm $p + done + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest "Smoke, sanity and function tests" + for o in $(ls -1 /usr/lib64/librabbitmq.so*) ; do + rlRun "ldd $o" 0 "validate the shared objects" + rlRun "objdump -T $o" 0 "validate the shared objects" + done + rlRun "head /usr/share/doc/librabbitmq-devel/README.md" 0 "correct form for doc file" + rlRun "head /usr/share/licenses/librabbitmq/LICENSE-MIT" 0 "correct form for doc file" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -fr $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..96c2b94 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,11 @@ +--- +# Run tests in all contexts +- hosts: localhost + tags: + - classic + roles: + - role: standard-test-beakerlib + tests: + - Sanity + required_packages: + - librabbitmq