#6 Add brltty tests from the upstreamfirst (OSCI) project.
Merged 10 months ago by jskarvad. Opened 10 months ago by mgahagan.
rpms/ mgahagan/brltty brltty-tests  into  master

empty or binary file added

@@ -0,0 +1,64 @@ 

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of /CoreOS/brltty/Sanity/sanity-test

+ #   Description: it check basic sanity of packahe

+ #   Author: Jan Scotka <jscotka@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   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 <jscotka@redhat.com>" > $(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)

@@ -0,0 +1,3 @@ 

+ PURPOSE of /CoreOS/brltty/Sanity/sanity-test

+ Description: it check basic sanity of packahe

+ Author: Jan Scotka <jscotka@redhat.com>

@@ -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 <jscotka@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   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

+ 

file added
+17

@@ -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

+ 

Adds tests according to the CI wiki [0] specifically the standard test interface in the spec [1].

The playbook includes Tier1 level test cases that have been tested in the following contexts and is passing reliably: Docker, and Classic. There are no tests for Atomic Host at this time due to package dependancies. Test logs are stored in the artifacts directory.

The following steps are used to execute the tests using the standard test interface:

Docker
sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS=docker:docker.io/library/fedora:28 TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags container tests.yml

Classic
sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS="" TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags classic tests.yml

[0] https://fedoraproject.org/wiki/CI
[1] https://fedoraproject.org/wiki/Changes/InvokingTests

Test results (duplicated lines are a known issue with standard-test-roles and restraint):

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 15:31:02 ] :: [ PASS ] :: Command 'DISPLAY=:99 orca&' (Expected 0, got 0)
:: [ 15:31:07 ] :: [ PASS ] :: Command 'sleep 5' (Expected 0, got 0)
:: [ 15:31:12 ] :: [ PASS ] :: Command 'sleep 5' (Expected 0, got 0)
:: [ 15:31:12 ] :: [ PASS ] :: Command 'DISPLAY=:99 brltty -b xw -x a2 -A auth=none' (Expected 0, got 0)
:: [ 15:31:17 ] :: [ PASS ] :: Command 'sleep 5' (Expected 0, got 0)
:: [ 15:31:17 ] :: [ PASS ] :: Command 'BRPID=16354' (Expected 0, got 0)
:: [ 15:31:17 ] :: [ PASS ] :: Command 'cat /proc/16354/cmdline' (Expected 0, got 0)
:: [ 15:31:17 ] :: [ PASS ] :: Command 'DISPLAY=:99 import -window root example.png' (Expected 0, got 0)
:: [ 15:31:17 ] :: [ PASS ] :: Command 'DISPLAY=:99 xwininfo -tree -root' (Expected 0, got 0)
:: [ 15:31:17 ] :: [ PASS ] :: Command 'killall brltty' (Expected 0, got 0)
:: [ 15:31:22 ] :: [ PASS ] :: Command 'sleep 5' (Expected 0, got 0)
:: [ 15:31:22 ] :: [ PASS ] :: Command 'DISPLAY=:99 brltty -b vr -d server:127.0.0.1 -x a2 -A auth=none' (Expected 0, got 0)
:: [ 15:31:27 ] :: [ PASS ] :: Command 'sleep 5' (Expected 0, got 0)
:: [ 15:31:31 ] :: [ PASS ] :: Command 'echo cells 20 | ncat 127.0.0.1 35752 |grep 'Visual "BRLTTY'' (Expected 0, got 0)
:: [ 15:31:37 ] :: [ PASS ] :: Command 'echo cells 20 | ncat 127.0.0.1 35752 |grep '127.12357.1237.23457.23457.134567'' (Expected 0, got 0)
:: [ 15:31:37 ] :: [ PASS ] :: Command 'echo quit | ncat 127.0.0.1 35752' (Expected 0, got 0)
:: [ 15:31:39 ] :: [ PASS ] :: Command 'sleep 2' (Expected 0, got 0)
:: [ 15:31:39 ] :: [ PASS ] :: Command 'test -x /usr/bin/brltty-config' (Expected 0, got 0)
:: [ 15:31:39 ] :: [ PASS ] :: Command 'brltty-config' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Duration: 37s
:: Assertions: 19 good, 0 bad
:: RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 15:31:39 ] :: [ PASS ] :: Command 'killall brltty' (Expected 0, got 0)
:: [ 15:31:39 ] :: [ PASS ] :: Command 'killall Xvfb' (Expected 0, got 0)
:: [ 15:31:39 ] :: [ INFO ] :: Sending example.png as example.png
:: [ 15:31:39 ] :: [ LOG ] :: File '/tmp/tmp.9kmA54rEea/example.png' stored here: /var/tmp/BEAKERLIB_STORED_example.png
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Duration: 0s
:: Assertions: 2 good, 0 bad
:: RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: /CoreOS/brltty/Sanity/sanity-test
:: /CoreOS/brltty/Sanity/sanity-test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 15:31:39 ] :: [ LOG ] :: JOURNAL XML: /var/tmp/beakerlib-wAhddYI/journal.xml
:: [ 15:31:39 ] :: [ LOG ] :: JOURNAL XML: /var/tmp/beakerlib-wAhddYI/journal.xml
:: [ 15:31:39 ] :: [ LOG ] :: JOURNAL TXT: /var/tmp/beakerlib-wAhddYI/journal.txt
:: [ 15:31:39 ] :: [ LOG ] :: JOURNAL TXT: /var/tmp/beakerlib-wAhddYI/journal.txt
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Duration: 42s
:: Duration: 42s
:: Phases: 3 good, 0 bad
:: Phases: 3 good, 0 bad
:: OVERALL RESULT: PASS
:: OVERALL RESULT: PASS

Commit a4704d6 fixes this pull-request

Pull-Request has been merged by jskarvad

10 months ago

Pull-Request has been merged by jskarvad

10 months ago