Initial commit.

This commit is contained in:
Matěj Týč 2018-04-05 11:33:25 +02:00
commit 445a9a41ae
3 changed files with 124 additions and 0 deletions

View file

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

View file

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

View file

@ -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 <matyc@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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