Rachel Sibley ed120b
# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material 
Rachel Sibley ed120b
# is made available to anyone wishing to use, modify, copy, or
Rachel Sibley ed120b
# redistribute it subject to the terms and conditions of the GNU General
Rachel Sibley ed120b
# Public License v.2.
Rachel Sibley ed120b
#
Rachel Sibley ed120b
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
Rachel Sibley ed120b
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
Rachel Sibley ed120b
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
Rachel Sibley ed120b
#
Rachel Sibley ed120b
# You should have received a copy of the GNU General Public License
Rachel Sibley ed120b
# along with this program; if not, write to the Free Software
Rachel Sibley ed120b
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Rachel Sibley ed120b
#
Rachel Sibley ed120b
# Author: Milos Malik <mmalik@redhat.com>
Rachel Sibley ed120b
Rachel Sibley ed120b
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
Rachel Sibley ed120b
# Example Makefile for RHTS                                          #
Rachel Sibley ed120b
# This example is geared towards a test for a specific package       #
Rachel Sibley ed120b
# It does most of the work for you, but may require further coding   #
Rachel Sibley ed120b
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
Rachel Sibley ed120b
Rachel Sibley ed120b
# The toplevel namespace within which the test lives.
Rachel Sibley ed120b
# FIXME: You will need to change this:
Rachel Sibley ed120b
TOPLEVEL_NAMESPACE=CoreOS
Rachel Sibley ed120b
Rachel Sibley ed120b
# The name of the package under test:
Rachel Sibley ed120b
# FIXME: you wil need to change this:
Rachel Sibley ed120b
PACKAGE_NAME=acl
Rachel Sibley ed120b
Rachel Sibley ed120b
# The path of the test below the package:
Rachel Sibley ed120b
# FIXME: you wil need to change this:
Rachel Sibley ed120b
RELATIVE_PATH=Sanity/cmd-line-options
Rachel Sibley ed120b
Rachel Sibley ed120b
# Version of the test. Used with make tag.
Rachel Sibley ed120b
export TESTVERSION=1.0
Rachel Sibley ed120b
Rachel Sibley ed120b
# The combined namespace of the test.
Rachel Sibley ed120b
export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
Rachel Sibley ed120b
Rachel Sibley ed120b
Rachel Sibley ed120b
# A phony target is one that is not really the name of a file.
Rachel Sibley ed120b
# It is just a name for some commands to be executed when you
Rachel Sibley ed120b
# make an explicit request. There are two reasons to use a
Rachel Sibley ed120b
# phony target: to avoid a conflict with a file of the same
Rachel Sibley ed120b
# name, and to improve performance.
Rachel Sibley ed120b
.PHONY: all install download clean
Rachel Sibley ed120b
Rachel Sibley ed120b
# executables to be built should be added here, they will be generated on the system under test.
Rachel Sibley ed120b
BUILT_FILES= 
Rachel Sibley ed120b
Rachel Sibley ed120b
# data files, .c files, scripts anything needed to either compile the test and/or run it.
Rachel Sibley ed120b
FILES=$(METADATA) runtest.sh Makefile PURPOSE test-core.sh
Rachel Sibley ed120b
Rachel Sibley ed120b
run: $(FILES) build
Rachel Sibley ed120b
	./runtest.sh
Rachel Sibley ed120b
Rachel Sibley ed120b
build: $(BUILT_FILES)
Rachel Sibley ed120b
	chmod a+x ./runtest.sh ./test-core.sh
Rachel Sibley ed120b
Rachel Sibley ed120b
clean:
Rachel Sibley ed120b
	rm -f *~ *.rpm $(BUILT_FILES)
Rachel Sibley ed120b
Rachel Sibley ed120b
# You may need to add other targets e.g. to build executables from source code
Rachel Sibley ed120b
# Add them here:
Rachel Sibley ed120b
Rachel Sibley ed120b
Rachel Sibley ed120b
# Include Common Makefile
Rachel Sibley ed120b
include /usr/share/rhts/lib/rhts-make.include
Rachel Sibley ed120b
Rachel Sibley ed120b
# Generate the testinfo.desc here:
Rachel Sibley ed120b
$(METADATA): Makefile
Rachel Sibley ed120b
	@touch $(METADATA)
Rachel Sibley ed120b
# Change to the test owner's name
Rachel Sibley ed120b
	@echo "Owner:        Milos Malik <mmalik@redhat.com>" > $(METADATA)
Rachel Sibley ed120b
	@echo "Name:         $(TEST)" >> $(METADATA)
Rachel Sibley ed120b
	@echo "Path:         $(TEST_DIR)" >> $(METADATA)
Rachel Sibley ed120b
	@echo "TestVersion:  $(TESTVERSION)" >> $(METADATA)
Rachel Sibley ed120b
	@echo "Type:         Sanity" >> $(METADATA)
Rachel Sibley ed120b
	@echo "Description:  utilities are tested if they support basic command line options" >> $(METADATA)
Rachel Sibley ed120b
	@echo "TestTime:     2m" >> $(METADATA)
Rachel Sibley ed120b
	@echo "RunFor:       $(PACKAGE_NAME)" >> $(METADATA)  
Rachel Sibley ed120b
# add any other packages for which your test ought to run here
Rachel Sibley ed120b
	@echo "Requires:     $(PACKAGE_NAME)" >> $(METADATA)  
Rachel Sibley ed120b
# add any other requirements for the script to run here
Rachel Sibley ed120b
	@echo "License:      GPLv2" >> $(METADATA)
Rachel Sibley ed120b
Rachel Sibley ed120b
# You may need other fields here; see the documentation
Rachel Sibley ed120b
	rhts-lint $(METADATA)