From 31840c3d2003250a7af298c85a8392b81530367c Mon Sep 17 00:00:00 2001 From: Iveta Cesalova Date: Thu, 11 Mar 2021 17:21:43 +0100 Subject: [PATCH] add new test --- core/php-pecl-rdd-smoke/main.fmf | 20 +++++++++++ core/php-pecl-rdd-smoke/rrd.php | 34 +++++++++++++++++++ core/php-pecl-rdd-smoke/runtest.sh | 53 ++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 core/php-pecl-rdd-smoke/main.fmf create mode 100644 core/php-pecl-rdd-smoke/rrd.php create mode 100755 core/php-pecl-rdd-smoke/runtest.sh diff --git a/core/php-pecl-rdd-smoke/main.fmf b/core/php-pecl-rdd-smoke/main.fmf new file mode 100644 index 0000000..c197342 --- /dev/null +++ b/core/php-pecl-rdd-smoke/main.fmf @@ -0,0 +1,20 @@ +summary: Smoke test for php-pecl-rdd package. +description: | + Smoke test for php-pecl-rrd. Creates a database and creates graph from it. +contact: None +component: [] +test: ./runtest.sh +framework: beakerlib +recommend: +- php +- php-pecl-rrd +duration: 5m +enabled: true +tier: '1' +relevancy: | + distro = rhel-alt: False + distro < rhel-8: False + # Only available since 8.2 + distro < rhel-8.2: False +extra-summary: /CoreOS/php/Sanity/php-pecl-rdd-smoke +extra-task: /CoreOS/php/Sanity/php-pecl-rdd-smoke diff --git a/core/php-pecl-rdd-smoke/rrd.php b/core/php-pecl-rdd-smoke/rrd.php new file mode 100644 index 0000000..fbab3b3 --- /dev/null +++ b/core/php-pecl-rdd-smoke/rrd.php @@ -0,0 +1,34 @@ + + diff --git a/core/php-pecl-rdd-smoke/runtest.sh b/core/php-pecl-rdd-smoke/runtest.sh new file mode 100755 index 0000000..90b3d66 --- /dev/null +++ b/core/php-pecl-rdd-smoke/runtest.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/php/Sanity/php-pecl-rdd-smoke +# Description: Smoke test for php-pecl-rdd package. +# Author: Jakub Heger +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="php" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp rrd.php $TmpDir" 0 "Copying reproducer to TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "php rrd.php" 0 "Creating rrd file and graph output" + rlAssertExists "./speed.rrd" + rlAssertExists "./speed.png" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd