Skip to content

Commit eb3af9b

Browse files
committed
Skip sysctl probe test if no SysV services are found
If the list of services returned by `chkconfig --list` is empty, then the generated OVAL file would be invalid. Since there would not be anything to test in that situation, it would be better to skip the test instead. This situation can happen on modern Linux distributions that have only native systemd services.
1 parent b554b19 commit eb3af9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/probes/runlevel/test_probes_runlevel.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function test_probes_runlevel_A {
2525
require "egrep" || return 255
2626
require "awk" || return 255
2727

28+
local services_list=`get_services_list`
29+
[ -n "$services_list" ] || return 255
30+
2831
local ret_val=0;
2932
local DF="test_probes_runlevel_A.xml"
3033
local RF="results_A.xml"

0 commit comments

Comments
 (0)