adding new test

This commit is contained in:
Ondrej Mejzlik 2023-05-09 10:20:35 +02:00
commit df09d35e00
4 changed files with 43366 additions and 0 deletions

View file

@ -0,0 +1,28 @@
summary: Test for BZ#914688 (RRDTool graph shows inconsistent results using)
description: |
Bug summary: RRDTool graph shows inconsistent results using --start and --end vs. start= and end=
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=914688
component:
- rrdtool
test: ./runtest.sh
framework: beakerlib
recommend:
- rrdtool
duration: 1h
enabled: true
tag:
- TIPfail_infra
- TIPpass
- TIPpass_FIPS
- Tier1
tier: '1'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=914688
adjust:
- enabled: false
when: distro < rhel-6
continue: false
extra-nitrate: TC#0355192
extra-summary: /CoreOS/rrdtool/Regression/bz914688-RRDTool-graph-shows-inconsistent-results-using
extra-task: /CoreOS/rrdtool/Regression/bz914688-RRDTool-graph-shows-inconsistent-results-using
id: d5fb5103-df91-4224-a2b4-26fab77599a0

View file

@ -0,0 +1,76 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/rrdtool/Regression/bz914688-RRDTool-graph-shows-inconsistent-results-using
# Description: Test for BZ#914688 (RRDTool graph shows inconsistent results using)
# Author: Alois Mahdal <amahdal@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 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/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="rrdtool"
SCRIPT="test.sh"
TESTFILE_SRC="test.xml"
TESTFILE="test.rrd"
pids_of() {
# print PIDs of a user
ps --no-headers -U "$1" | sed 's/^ *//' | cut -d' ' -f 1
}
banish() {
# remove PIDs by a user
pids_of "$1" | while read pid; do kill $pid; done
sleep 3
pids_of "$1" | while read pid; do kill -9 $pid; done
}
build_test_rrd() {
# RRD files are arch-specific but can be dumped to XML
# and restored on target arch
rrdtool restore $TESTFILE_SRC $1/$TESTFILE
}
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "adduser tester" 0 "Add test user"
rlRun "build_test_rrd /home/tester" 0 "building test.rrd"
rlRun "cp $SCRIPT /home/tester"
rlRun "pushd /home/tester"
rlRun "chmod +x $SCRIPT"
rlRun "chown tester:tester $SCRIPT $TESTFILE"
rlRun "popd"
rlPhaseEnd
rlPhaseStartTest
rlRun "su tester -l -c './$SCRIPT'" 0 "comparing outputs"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "banish tester" 0 "Removing test user's processes"
rlRun "userdel -r tester" 0 "Deleting test user"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,24 @@
#!/bin/sh
set +e
## collect outputs
#
rrdtool graph smallRRD.PNG \
--start 1360310846 \
--end 1360335622 \
--step 1 \
DEF:ds1=test.rrd:MSG-T-FIXC:AVERAGE \
VDEF:tmp=ds1,TOTAL \
PRINT:tmp:"%6.9lf %S is the Total" \
> using_par.out
rrdtool graph smallRRD.PNG \
DEF:ds1=test.rrd:MSG-T-FIXC:AVERAGE:step=1:start=1360310846:end=1360335622 \
VDEF:tmp=ds1,TOTAL \
PRINT:tmp:"%6.9lf %S is the Total" \
> using_def.out
## compare
#
diff -u using_par.out using_def.out

File diff suppressed because it is too large Load diff