diff --git a/systemtap-static-probes-in-ruby/main.fmf b/systemtap-static-probes-in-ruby/main.fmf index fc9308b..3613e65 100644 --- a/systemtap-static-probes-in-ruby/main.fmf +++ b/systemtap-static-probes-in-ruby/main.fmf @@ -8,6 +8,8 @@ adjust: summary: It tests there are static probes in ruby package. description: | Simple test to exercise ruby's systemtap API. + Test updates the system under test unless ``UPDATE_SUT`` + environment variable is set to any other value than ``1``. component: - systemtap - ruby @@ -15,4 +17,4 @@ require: - systemtap - ruby-doc - ruby -duration: 30m +duration: 50m diff --git a/systemtap-static-probes-in-ruby/runtest.sh b/systemtap-static-probes-in-ruby/runtest.sh index cfac459..7743895 100755 --- a/systemtap-static-probes-in-ruby/runtest.sh +++ b/systemtap-static-probes-in-ruby/runtest.sh @@ -39,12 +39,27 @@ _STAP_OUT="stap-out.log" RUBY_OPTS="--disable-gems" STAP_OPTS="--suppress-handler-errors" +# System Under Test +UPDATE_SUT="${UPDATE_SUT:-1}" + rlJournalStart rlPhaseStartSetup rlAssertRpm --all rlAssertBinaryOrigin $RUBY rlAssertExists "${_STAP_FILE}" || rlDie rlLog "Using STAP_FILE from $(rpm -qf ${_STAP_FILE})." + if [[ $UPDATE_SUT == "1" ]]; then + rlLog "Machine to be updated, disable by setting UPDATE_SUT to other value than 1" + if [[ $TMT_REBOOT_COUNT == "0" ]]; then + rlRun "dnf update --refresh -y" + rlLog "Now reboot the system" + tmt-reboot + else + rlLog "SUT updated and rebooted" + fi + else + rlLog "Machine not to be updated" + fi rlRun "stap-prep" 0 "Prepare system for systemtap use" rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" rlRun "pushd ${TmpDir}"