Adding new test

This commit is contained in:
Ondrej Mejzlik 2023-05-22 10:47:29 +02:00
commit 8490da5aab
4 changed files with 102 additions and 0 deletions

5
Sanity/smoke-test/hello.tk Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/wish
label .t -text "Hello world!"
button .b -text "Close" -command {destroy .}
pack .t .b

View file

@ -0,0 +1,31 @@
summary: smoke test
description: ''
contact: Petr Sklenar <psklenar@redhat.com>
component:
- tk
test: ./runtest.sh
framework: beakerlib
recommend:
- tk
- xwininfo
- xorg-x11-server-Xvfb
- xorg-x11-utils
duration: 5m
enabled: true
tag:
- NoRHEL4
- NoRHEL5
- TIPfail_infra
- TIPfail_samba
- TIPfail_systemd
- TIPpass
- Tier1
tier: '1'
adjust:
- enabled: false
when: distro == rhel-4, rhel-5
continue: false
extra-nitrate: TC#0598798
extra-summary: /CoreOS/tk/Sanity/smoke-test
extra-task: /CoreOS/tk/Sanity/smoke-test
id: ea51d113-c9c2-46f7-a37b-c6329cb2b337

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

@ -0,0 +1,63 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/tk/Sanity/smoke-test
# Description: smoke test
# Author: Jaroslav Škarvada <jskarvad@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="tk"
# in seconds
SLEEP_TIME="15"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp ./hello.tk $TmpDir/" 0 "Copy Tk script"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlVirtualXStart "tk"
export DISPLAY="$( rlVirtualXGetDisplay \"tk\" )"
rlRun "./hello.tk &" 0 "Running Tk script"
PS_TK="$!"
rlRun "sleep $SLEEP_TIME" 0 "Sleeping for $SLEEP_TIME s"
rlRun "xwininfo -name \"hello.tk\"" 0 "Looking for Tk window"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "kill $PS_TK" 0,1 "Killing Tk"
rlVirtualXStop "tk"
rlRun "sleep $SLEEP_TIME" 0 "Sleeping for $SLEEP_TIME s"
rlRun "kill -9 $PS_TK" 0,1 "Hard killing possible leftover processes"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,3 @@
# Setup
Unreliable test case, rerun in beaker if fails.