From dabcdce70daf7f2075dc877d43660bf36ee03bd7 Mon Sep 17 00:00:00 2001 From: Ondrej Mejzlik Date: Tue, 6 Jun 2023 10:35:22 +0200 Subject: [PATCH] Adding new test --- Sanity/smoke-test/main.fmf | 30 ++++++++++++++++++ Sanity/smoke-test/reproducer.cpp | 11 +++++++ Sanity/smoke-test/runtest.sh | 53 ++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 Sanity/smoke-test/main.fmf create mode 100755 Sanity/smoke-test/reproducer.cpp create mode 100755 Sanity/smoke-test/runtest.sh diff --git a/Sanity/smoke-test/main.fmf b/Sanity/smoke-test/main.fmf new file mode 100644 index 0000000..d1d5c46 --- /dev/null +++ b/Sanity/smoke-test/main.fmf @@ -0,0 +1,30 @@ +summary: Basic smoke test +description: '' +contact: Ondrej Mejzlik +component: + - ncurses +test: ./runtest.sh +framework: beakerlib +recommend: + - ncurses + - gcc-c++ + - ncurses-devel +duration: 5m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - TIPfail_infra + - TIPfail_samba + - TIPfail_systemd + - TIPpass_Apps + - Tier1 +tier: '1' +adjust: + - enabled: false + when: distro == rhel-4, rhel-5 + continue: false +extra-nitrate: TC#0560451 +extra-summary: /CoreOS/ncurses/Sanity/smoke-test +extra-task: /CoreOS/ncurses/Sanity/smoke-test +id: 9821ef80-3aec-4dc7-a0cd-25726de97638 diff --git a/Sanity/smoke-test/reproducer.cpp b/Sanity/smoke-test/reproducer.cpp new file mode 100755 index 0000000..7d65513 --- /dev/null +++ b/Sanity/smoke-test/reproducer.cpp @@ -0,0 +1,11 @@ +#include + +int main() +{ + initscr(); + printw("Hello World"); + refresh(); + getch(); + endwin(); + return 0; +} diff --git a/Sanity/smoke-test/runtest.sh b/Sanity/smoke-test/runtest.sh new file mode 100755 index 0000000..75bfeaf --- /dev/null +++ b/Sanity/smoke-test/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/ncurses/Sanity/smoke-test +# Description: Basic smoke test +# Author: Maryna Nalbandian +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 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/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="ncurses" +PACKAGE_2="gcc-c++" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlAssertRpm $PACKAGE_2 + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp reproducer.cpp $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "g++ reproducer.cpp -lncurses" 0 "Run simple hello_world test" + rlRun "./a.out &" 0 "Run compiled file" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd