Adding new test

This commit is contained in:
Ondrej Mejzlik 2023-06-06 10:35:22 +02:00
commit dabcdce70d
3 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,30 @@
summary: Basic smoke test
description: ''
contact: Ondrej Mejzlik <omejzlik@redhat.com>
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

View file

@ -0,0 +1,11 @@
#include <ncurses.h>
int main()
{
initscr();
printw("Hello World");
refresh();
getch();
endwin();
return 0;
}

53
Sanity/smoke-test/runtest.sh Executable file
View file

@ -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 <mnalband@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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