diff --git a/Sanity/oscap-builds-ssg/Makefile b/Sanity/oscap-builds-ssg/Makefile new file mode 100644 index 0000000..367ac0e --- /dev/null +++ b/Sanity/oscap-builds-ssg/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/openscap/Sanity/oscap-builds-ssg +# Description: Checks that scap-security-guide can be built by the tested oscap. +# Author: Matej Tyc +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/openscap/Sanity/oscap-builds-ssg +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: Matej Tyc " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Checks that scap-security-guide can be built by the tested oscap." >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 40m" >> $(METADATA) + @echo "RunFor: openscap" >> $(METADATA) + @echo "Requires: openscap" >> $(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/Sanity/oscap-builds-ssg/PURPOSE b/Sanity/oscap-builds-ssg/PURPOSE new file mode 100644 index 0000000..d40cc82 --- /dev/null +++ b/Sanity/oscap-builds-ssg/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/openscap/Sanity/oscap-builds-ssg +Description: Checks that scap-security-guide can be built by the tested oscap. +Author: Matej Tyc diff --git a/Sanity/oscap-builds-ssg/runtest.sh b/Sanity/oscap-builds-ssg/runtest.sh new file mode 100755 index 0000000..e0a521d --- /dev/null +++ b/Sanity/oscap-builds-ssg/runtest.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/openscap/Sanity/oscap-builds-ssg +# Description: Checks that scap-security-guide can be built by the tested oscap. +# Author: Matej Tyc +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openscap-utils" + +ssgname="scap-security-guide" +ssgtag="v0.1.38" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "git clone https://github.com/OpenSCAP/$ssgname.git" 0 "Cloning SSG source" + rlRun "pushd $ssgname" 0 + rlRun "git checkout $ssgtag" 0 "Check out to the latest released version." + rlRun "mkdir -p build" 0 "Ensuring that build dir exists" + rlRun "pushd build" + rlRun "rm -rf * && cmake .. && make" 0 "Get rid of everything and build ssg from scratch." + rlPhaseEnd + + rlPhaseStartTest + rlRun "make test" 0 "Creating the foo test file" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "popd" + rlRun "rm -rf $ssgname" 0 "Removing the whole SSG tree." + rlPhaseEnd +rlJournalPrintText +rlJournalEnd