Commit graph

10 commits

Author SHA1 Message Date
Jun Aruga
6c902aedee systemtap-static-probes-in-ruby: Add assertion to check stap command.
The assertion is to detect a stap command error not depending on Ruby, and also
to make us report an error to the rpms/systemtap easier.

You can see the upstream systemtap routine builds when an error happens on
Fedora rawhide. There may be the same error on the latest build.
https://builder.sourceware.org/buildbot/#/builders/systemtap-fedrawhide-x86_64

For example, the assertion can catch the following stap command error.

```
$ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide tests -n '^/systemtap-static-probes-in-ruby$'
/var/tmp/tmt/run-014
...
total: 1 warn

$ echo $?
1

$ tmt run --id run-014 report -vvv
...
                    :: [ 23:29:01 ] :: [  BEGIN   ] :: Checking stap to detect an error not depending on Ruby :: actually running 'stap -v -e 'probe begin { exit() }''
                    Pass 1: parsed user script and 586 library scripts using 314412virt/282316res/16080shr/267544data kb, in 470usr/90sys/698real ms.
                    Pass 2: analyzed script: 1 probe, 1 function, 0 embeds, 0 globals using 324576virt/293092res/16744shr/277708data kb, in 30usr/10sys/37real ms.
                    Pass 3: translated to C into "/tmp/stapVBIxqm/stap_17cbdff69dacffb521a9178adb053400_1161_src.c" using 324576virt/293408res/17060shr/277708data kb, in 0usr/0sys/0real ms.
                    <command-line>: fatal error: /tmp/stapVBIxqm/stapconf_7fa4e6888ba17abb7b5cc888ef91222c_947.h: No such file or directory
                    compilation terminated.
                    <command-line>: fatal error: /tmp/stapVBIxqm/stapconf_7fa4e6888ba17abb7b5cc888ef91222c_947.h: No such file or directory
                    compilation terminated.
                    <command-line>: fatal error: /tmp/stapVBIxqm/stapconf_7fa4e6888ba17abb7b5cc888ef91222c_947.h: No such file or directory
                    make[2]: *** [/usr/src/kernels/6.13.0-0.rc3.20241220git8faabc041a00.33.fc42.x86_64/scripts/Makefile.build:194: stap_17cbdff69dacffb521a9178adb053400_1161_src.o] Error 1
                    make[2]: *** Waiting for unfinished jobs....
                    compilation terminated.
                    make[2]: *** [/usr/src/kernels/6.13.0-0.rc3.20241220git8faabc041a00.33.fc42.x86_64/scripts/Makefile.build:194: stap_17cbdff69dacffb521a9178adb053400_1161_aux_0.o] Error 1
                    make[2]: *** [/usr/src/kernels/6.13.0-0.rc3.20241220git8faabc041a00.33.fc42.x86_64/scripts/Makefile.build:194: stap_symbols.o] Error 1
                    make[1]: *** [/usr/src/kernels/6.13.0-0.rc3.20241220git8faabc041a00.33.fc42.x86_64/Makefile:2035: .] Error 2
                    make: *** [Makefile:263: __sub-make] Error 2
                    WARNING: kbuild exited with status: 2
                    Pass 4: compiled C into "stap_17cbdff69dacffb521a9178adb053400_1161.ko" in 260usr/140sys/397real ms.
                    Pass 4: compilation failed.  [man error::pass4]
                    Kernel version 6.13.0 is outside tested range 3.10 ... 6.12-rc
                    :: [ 23:29:02 ] :: [   FAIL   ] :: Checking stap to detect an error not depending on Ruby (Expected 0, got 1)
                    :: [ 23:29:02 ] :: [  FATAL   ] ::
                    :: [ 23:29:02 ] :: [   FAIL   ] ::  (Assert: expected 0, got 1)
                    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                    ::   Duration: 125s
                    ::   Assertions: 7 good, 2 bad
                    ::   RESULT: WARN (Setup)
...
total: 1 warn

$ echo $?
1
```
2024-12-24 10:53:10 +01:00
Lukáš Zachar
bbbeff3374 Improve checking for systemtap files
Log whether _STAP_FILE (the systemtap example) is used from any rpm.
Make sure the tapset (probes files) is used from PACKAGES
2024-08-05 11:50:47 +02:00
Lukáš Zachar
96ff9a3911 Set environment variables properly on non-fedora
Remove unused COLLECTION handling (collections are past end-of-life)
Remove PRINT variable
2024-08-05 11:50:01 +02:00
Lukáš Zachar
d640ff95a5 Use _STAP_FILE value directly
Hardoced to the path in ruby-doc but can be changed from envar
2024-07-18 13:46:08 +02:00
Vít Ondruch
b658b742c0 Require rubypick only on Fedora
There is no rubypick in rhel/centos but is in Fedora:

7724c2d703/f/ruby.spec (_146-148)

This is the same fix as:

https://src.fedoraproject.org/fork/lzachar/tests/ruby/c/98bf2ce800d42d3b17df5af62b782c43d39f21f3
2024-07-18 09:54:17 +02:00
Lukáš Zachar
3dee01db19 squash: Use TracePoint
Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2252100
and https://bugs.ruby-lang.org/issues/14582
2024-07-16 18:38:51 +02:00
Lukas Zachar
b35f6f20d7 systemtap-probe: sync downstream changes, fix require
While require on file in rpm works now, with dnf-5 it might not work out
of the box. Let's keep adding package which contains this file in the
require/recommend instead

Extend stap buffer size and limit "noise" produced by ruby interpreter
so stap output is more usable.
2024-07-16 18:38:51 +02:00
Lukas Zachar
082d2ec5c5 Remove Makefile/PURPOSE file, add summary/description 2024-07-16 18:38:49 +02:00
Miroslav Vadkerti
2e9ba6a554 Add fixes for Fedora, improve waiting for stap
This patch fixes the execution of the test for Fedora. It also
includes improved waiting for stap, which uses now active waiting
instead of static sleep.

Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
2018-02-19 14:11:33 +01:00
Miroslav Vadkerti
a4cdc02f01 Import 3 integration tests
systemtap-static-probes-in-ruby: for testing ruby's systemtap api
bundler-unit-tests: to run bundler's unit tests
run-basic-rails-application: a simple rails application test

Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
2018-02-15 13:42:17 +01:00