diff --git a/tests/README.rst b/tests/README.rst new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/README.rst diff --git a/tests/sanity-test/Makefile b/tests/sanity-test/Makefile new file mode 100644 index 0000000..49f910c --- /dev/null +++ b/tests/sanity-test/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/brltty/Sanity/sanity-test +# Description: it check basic sanity of packahe +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 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. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/brltty/Sanity/sanity-test +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Jan Scotka " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: it check basic sanity of packahe" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: brltty" >> $(METADATA) + @echo "Requires: brltty Xvfb ImageMagick psmisc xorg-x11-utils nc orca" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/sanity-test/PURPOSE b/tests/sanity-test/PURPOSE new file mode 100644 index 0000000..a0b7600 --- /dev/null +++ b/tests/sanity-test/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/brltty/Sanity/sanity-test +Description: it check basic sanity of packahe +Author: Jan Scotka diff --git a/tests/sanity-test/runtest.sh b/tests/sanity-test/runtest.sh new file mode 100755 index 0000000..4a1266e --- /dev/null +++ b/tests/sanity-test/runtest.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/brltty/Sanity/sanity-test +# Description: it check basic sanity of packahe +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 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/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="brltty" +DISPLAY=99 + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "Xvfb :$DISPLAY -screen 0 1024x768x24&" + rlRun "sleep 5" + rlPhaseEnd + + rlPhaseStartTest + rlRun "DISPLAY=:$DISPLAY orca&" + rlRun "sleep 5" + rlRun "sleep 5" + rlRun "DISPLAY=:$DISPLAY brltty -b xw -x a2 -A auth=none" + rlRun "sleep 5" + rlRun "BRPID=`pidof brltty`" + rlRun "cat /proc/$BRPID/cmdline" + rlRun "DISPLAY=:$DISPLAY import -window root example.png" + rlRun "DISPLAY=:$DISPLAY xwininfo -tree -root" + #rlRun "DISPLAY=:$DISPLAY xwininfo -tree -root| grep -A 2 children |grep brltty" + #rlRun "DISPLAY=:$DISPLAY xwininfo -tree -root|grep +664+36" + rlRun "killall brltty" + rlRun "sleep 5" + rlRun "DISPLAY=:$DISPLAY brltty -b vr -d server:127.0.0.1 -x a2 -A auth=none" + rlRun "sleep 5" + rlRun "echo cells 20 | ncat 127.0.0.1 35752 |grep 'Visual \"BRLTTY'" + rlRun "echo cells 20 | ncat 127.0.0.1 35752 |grep '127.12357.1237.23457.23457.134567'" + rlRun "echo quit | ncat 127.0.0.1 35752" + rlRun "sleep 2" + rlRun "test -x /usr/bin/brltty-config" + rlRun "brltty-config" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "killall brltty" + rlRun "killall Xvfb" + rlFileSubmit example.png + rlPhaseEnd +rlJournalPrintText +rlJournalEnd + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..b294380 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,17 @@ +- hosts: localhost + tags: + - classic + - container + roles: + - role: standard-test-beakerlib + tests: + - sanity-test + required_packages: + - ImageMagick + - Xvfb + - brltty + - nc + - orca + - psmisc + - xorg-x11-utils +