Skip to content

Commit

Permalink
Add: resource for kernel config file
Browse files Browse the repository at this point in the history
This file might be absent for different reasons:
  - disabled in kernel configuration
  - stored in a different location than the default one here (/boot/config-*)

Signed-off-by: Alexandre Esse <[email protected]>
  • Loading branch information
ahresse committed Oct 26, 2023
1 parent 69284be commit 0ef5bdc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions providers/base/units/tracers/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ _summary:
Tests ftrace kernel tracing infrastructure is enable
_description:
Check if kernel configuration item CONFIG_FTRACE bool is set to 'y'.
requires:
kernel_config_file.detected == 'true'

id: tracers/tracefs
plugin: shell
Expand Down
12 changes: 12 additions & 0 deletions providers/base/units/tracers/resource.pxu
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
id: kernel_config_file
plugin: resource
_summary:
Kernel config file resource
command:
if [[ -f "/boot/config-$(uname -r)" ]]
then
echo "detected: true"
else
echo "detected: false"
fi
_description: Check existence of kernel config file
2 changes: 2 additions & 0 deletions providers/base/units/tracers/test-plan.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ include:
tracers/ftrace
tracers/ptrace
tracers/tracefs
bootstrap_include:
kernel_config_file

0 comments on commit 0ef5bdc

Please sign in to comment.