re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-06-29 17:56:17 +02:00
parent f5f4063ab2
commit 11c3d83e9e
5 changed files with 133 additions and 0 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
time-1.7.tar.gz
/time-1.8.tar.gz
/time-1.9.tar.gz

View File

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

View File

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

47
tests/maximum_RSS/runtest.sh Executable file
View File

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

16
tests/tests.yml Normal file
View File

@ -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