Set environment variables properly on non-fedora

Remove unused COLLECTION handling (collections are past end-of-life)
Remove PRINT variable
This commit is contained in:
Lukáš Zachar 2024-08-05 11:50:01 +02:00
commit 96ff9a3911
2 changed files with 4 additions and 18 deletions

View file

@ -3,7 +3,7 @@ adjust:
require-:
- rubypick
environment:
PACKAGES: "ruby rubygems"
PACKAGES: "ruby ruby-doc ruby-libs"
summary: It tests there are static probes in ruby package.
description: |

View file

@ -29,22 +29,13 @@
# Include rhts environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGES=${PACKAGES:-ruby ruby-libs rubypick}
# in RHEL7 and later the stap file is in ruby-doc package
if [ -z "$COLLECTIONS" ]; then
if rlIsRHEL '>=7' || rlIsFedora; then
PACKAGES=$PACKAGES" ruby-doc"
fi
fi
PACKAGES=${PACKAGES:-ruby ruby-libs rubypick ruby-doc}
REQUIRES=${REQUIRES:-}
RUBY=${RUBY:-ruby}
_STAP_FILE="${_STAP_FILE:-/usr/share/doc/ruby-doc/ruby-exercise.stp}"
_LOG_FILE="ruby.log"
_STAP_OUT="stap-out.log"
# for ruby on RHEL7 and in collections
PRINT="Kernel::printf"
RUBY_OPTS="--disable-gems"
STAP_OPTS="--suppress-handler-errors"
@ -101,18 +92,13 @@ rlJournalStart
echo -e "---ps-out--" && ps -e | grep stap # info
echo -e "---${_LOG_FILE}--" && cat ${_LOG_FILE} # info
if rlIsRHEL '<7' && [ -z "$COLLECTIONS" ]
then
rlRun "grep -q 'Float::+' ${_LOG_FILE}" 0 "Checking systemtap log: Float test"
# for ruby on RHEL6
PRINT="Object::printf"
fi
rlRun "grep -q 'Array::push' ${_LOG_FILE}" 0 "Checking systemtap log: Array test"
rlRun "grep -q 'Range::step' ${_LOG_FILE}" 0 "Checking systemtap log: Range test"
rlRun "grep -q 'Hash::initialize' ${_LOG_FILE}" 0 "Checking systemtap log: Hash test"
rlRun "grep -q 'String::slice!' ${_LOG_FILE}" 0 "Checking systemtap log: String test"
rlRun "grep -q 'Integer::times' ${_LOG_FILE}" 0 "Checking systemtap log: Cycle and print test - iteration number"
rlRun "grep -q '$PRINT' ${_LOG_FILE}" 0 "Checking systemtap log: Cycle and print test - printf function"
rlRun "grep -q 'Kernel::printf' ${_LOG_FILE}" 0 "Checking systemtap log: Cycle and print test - printf function"
rlRun "grep -q 'IO::write' ${_LOG_FILE}" 0 "Checking systemtap log: Cycle and print test - IO write"
rlPhaseEnd