diff --git a/.gitignore b/.gitignore index f72220d..7b5af79 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ +time-1.7.tar.gz +/time-1.8.tar.gz /time-1.9.tar.gz diff --git a/tests/maximum_RSS/Makefile b/tests/maximum_RSS/Makefile new file mode 100644 index 0000000..3974ff1 --- /dev/null +++ b/tests/maximum_RSS/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/time/Sanity/maximum_RSS +# Description: check if RSS usage is measured reasonable (in bug, reported value vas 4-times bigger) +# Author: Ondrej Ptak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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/time/Sanity/maximum_RSS +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: Ondrej Ptak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: check if RSS usage is measured reasonable (in bug, reported value vas 4-times bigger)" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: time" >> $(METADATA) + @echo "Requires: time perl bc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 703865" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/maximum_RSS/PURPOSE b/tests/maximum_RSS/PURPOSE new file mode 100644 index 0000000..151149b --- /dev/null +++ b/tests/maximum_RSS/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/time/Sanity/maximum_RSS +Description: check if RSS usage is measured reasonable (in bug, reported value vas 4-times bigger) +Author: Ondrej Ptak diff --git a/tests/maximum_RSS/runtest.sh b/tests/maximum_RSS/runtest.sh new file mode 100755 index 0000000..e68f7ba --- /dev/null +++ b/tests/maximum_RSS/runtest.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/time/Sanity/maximum_RSS +# Description: check if RSS usage is measured reasonable (in bug, reported value vas 4-times bigger) +# Author: Ondrej Ptak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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 + +PACKAGES=${PACKAGES:-"time"} + +rlJournalStart + rlPhaseStartTest + supposed_RSS=412024 + rlLogInfo "RSS usage of given script is suppose to be about $supposed_RSS kB" + rlRun "maxRSS=$(/usr/bin/time -f %M perl -e '"x" x 400 x 1024 x 1024' 2>&1)" 0 "Measuring RSS usage" + rlAssertGreater "RSS max usage should be < 450000" 450000 $maxRSS + rlAssertGreater "RSS max usage should be > 400000" $maxRSS 400000 + echo "$maxRSS/$supposed_RSS*100" + coef=`echo "$maxRSS*100/$supposed_RSS" | bc` + rlLogInfo "RSS value is $coef % of expected value" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..043bc2c --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,16 @@ +--- +# Tests for classic and container +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + - container + - atomic + tests: + - maximum_RSS + required_packages: + - bash + - bc + - perl-interpreter + - time