Add example test for taskotron

This commit is contained in:
Stephen Gallagher 2017-04-03 09:53:23 -04:00
parent d09681020c
commit dd076fe280
No known key found for this signature in database
GPG Key ID: 7A25556236BAA3A3
4 changed files with 69 additions and 0 deletions

14
test/help-usage/Makefile Normal file
View File

@ -0,0 +1,14 @@
.PHONY: all install download clean
BUILT_FILES=
FILES=runtest.sh Makefile
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
chmod a+x ./runtest.sh
clean:
rm -f *~ $(BUILT_FILES)

View File

@ -0,0 +1,13 @@
help-usage
==========
This is an example task for `Taskotron <https://fedoraproject.org/wiki/Taskotron>`_
that tests the basic functionality of 'sscg --help' to confirm it generates a usage message.
Standalone you can run it like this::
$ make run
Through taskotron runner you can run it like this::
$ runtask -i sscg-2.0.4-1.fc27 -t koji_build -a x86_64 runtask.yml

View File

@ -0,0 +1,29 @@
---
name: help-usage
desc: "Tests the basic functionality of 'sscg --help' to confirm it generates a usage message."
maintainer: sgallagh
input:
args:
- koji_build
- arch
environment:
rpm:
- make
actions:
- name: download the build
koji:
action: download
koji_build: ${koji_build}
arch: $arch
target_dir: ${workdir}/rpms
- name: install the build
shell:
- dnf install -y ${workdir}/rpms/*.rpm
- name: run test
shell:
- make run

13
test/help-usage/runtest.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
PACKAGE=sscg
# Assume the test will pass.
result=PASS
sscg --help | grep -q -i '^usage:'
if [ $? -ne 0 ]; then
result=FAIL
fi
echo $result