- Shell 94.2%
- Ruby 5.8%
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 ``` |
||
|---|---|---|
| .fmf | ||
| run-basic-rails-application | ||
| Sanity/native-extension-gem-is-installed-without-error | ||
| systemtap-static-probes-in-ruby | ||
| tls-minimal-version | ||
| .gitignore | ||
| main.fmf | ||
| plans.fmf | ||
| README.md | ||
Shared ruby tests
This repository contains shared ruby tests.
Contributing
Testing
You can run the tests in your local environment.
Install tmt.
$ sudo dnf install tmt+all
Run the following command to run the tests for Fedora rawhide:
$ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide
/var/tmp/tmt/run-NNN
...
The tmt's provisioning method virtual (tmt run provision -h virtual) must be used, otherwise the tests fail due to known issues with container provisioning method (tmt run provision -h container). Also note the run-NNN printed on the output of the command. This represents the run ID used with tmt run --id option in later steps.
Run the following command to see the report, setting the value of the above run ID to the --id option. As this repository doesn't have tmt's plans to run the tests, we need to set the plans --default to use the default plans. See this tmt's document about the tmt run report options.
$ tmt run --id run-NNN report -vvv
Running a specific test
You can run a specific test.
List available tests.
$ tmt tests ls
/Sanity/native-extension-gem-is-installed-without-error/ruby25
/Sanity/native-extension-gem-is-installed-without-error/ruby26
/Sanity/native-extension-gem-is-installed-without-error/ruby27
/Sanity/native-extension-gem-is-installed-without-error/ruby30
/Sanity/native-extension-gem-is-installed-without-error/ruby31
/Sanity/native-extension-gem-is-installed-without-error/system
/run-basic-rails-application
/systemtap-static-probes-in-ruby
Run the following command to run a specific test with -n option to specify a regular expression to match the test name for Fedora rawhide:
$ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide tests -n '^/systemtap-static-probes-in-ruby$'