From fdcd11f16140aba529223535756edfac1e487270 Mon Sep 17 00:00:00 2001 From: Ondrej Mejzlik Date: Tue, 10 Jan 2023 11:58:06 +0100 Subject: [PATCH] add test --- Sanity/smoke/main.fmf | 25 +++++++++++++++++++ Sanity/smoke/runtest.sh | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 Sanity/smoke/main.fmf create mode 100755 Sanity/smoke/runtest.sh diff --git a/Sanity/smoke/main.fmf b/Sanity/smoke/main.fmf new file mode 100644 index 0000000..9f27eb3 --- /dev/null +++ b/Sanity/smoke/main.fmf @@ -0,0 +1,25 @@ +summary: Simple smoke test using library httpd/Library/http +description: '' +component: +- wget +test: ./runtest.sh +framework: beakerlib +require: +- library(httpd/http) +recommend: +- httpd +- wget +duration: 5m +enabled: true +tag: +- TIPfail_infra +- TIPfail_samba +- TIPfail_systemd +- TIPpass +- TIPpass_Apps +- Tier1 +- TierSecurity +tier: '1' +extra-nitrate: TC#0325124 +extra-summary: /CoreOS/wget/Sanity/smoke +extra-task: /CoreOS/wget/Sanity/smoke diff --git a/Sanity/smoke/runtest.sh b/Sanity/smoke/runtest.sh new file mode 100755 index 0000000..cc39f95 --- /dev/null +++ b/Sanity/smoke/runtest.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/wget/Sanity/smoke +# Description: Simple smoke test using library httpd/Library/http +# Author: Ondrej Ptak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES="wget" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm --all + rlRun "rlImport httpd/http" 0 "import httpd/http library" + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "httpStart" 0 "start http server" + rlPhaseEnd + + rlPhaseStartTest + rlRun "wget http://localhost/http_testfile" 0 "download test file" + rlAssertExists http_testfile + rlAssertGrep "ok" http_testfile + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "httpStop" 0 "stop http server" + rlRun "popd" + rlRun "rm -rf $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd