From 96ff9a3911de2dc45572217acdb6389ccfdcc4bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zachar?= Date: Mon, 5 Aug 2024 11:50:01 +0200 Subject: [PATCH] Set environment variables properly on non-fedora Remove unused COLLECTION handling (collections are past end-of-life) Remove PRINT variable --- systemtap-static-probes-in-ruby/main.fmf | 2 +- systemtap-static-probes-in-ruby/runtest.sh | 20 +++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/systemtap-static-probes-in-ruby/main.fmf b/systemtap-static-probes-in-ruby/main.fmf index 310c441..fc9308b 100644 --- a/systemtap-static-probes-in-ruby/main.fmf +++ b/systemtap-static-probes-in-ruby/main.fmf @@ -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: | diff --git a/systemtap-static-probes-in-ruby/runtest.sh b/systemtap-static-probes-in-ruby/runtest.sh index 87f0bae..312e713 100755 --- a/systemtap-static-probes-in-ruby/runtest.sh +++ b/systemtap-static-probes-in-ruby/runtest.sh @@ -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