Fault injection support#66
Conversation
| "fail_io_timeout", | ||
| "fail_make_request", | ||
| "fial_page_alloc", | ||
| "failslab" |
There was a problem hiding this comment.
Do we need to add the below also ? (From https://www.kernel.org/doc/Documentation/fault-injection/fault-injection.txt)
fail_function
fail_futex
fail_make_request
fail_mmc_request
There was a problem hiding this comment.
Following the previous runltp implementation
https://github.com/linux-test-project/ltp/blob/91fa413eb521fde80d57c79bd3d2fb5cbe4ad3f4/tools/insert_kernel_faults.sh#L46
There was a problem hiding this comment.
Ack, if required we can extend it later. Thanks.
There was a problem hiding this comment.
Is the feature working for now?
There was a problem hiding this comment.
Yes with your updated typo fix. Please see the test results below,
vignesh@debian:/opt/kirk$ ./kirk --run-suite syscalls
Host information
Hostname: debian
Python: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0]
Directory: /tmp/kirk.vignesh/tmp9knknqnw
Connecting to SUT: host
Warning: Run as root to use kernel fault injection
Starting suite: syscalls
-------------------------
abort01: pass (0.011s)
accept01: pass (0.004s)
accept02: pass (0.006s)
accept03: broken (0.004s)
accept4_01: skip (0.006s)
access01: skip (0.005s)
access02: skip (0.003s)
access03: skip (0.003s)
access04: skip (0.002s)
acct01: broken (0.003s)
acct02: broken (0.003s)
add_key01: skip (0.003s)
add_key02: pass (0.003s)
add_key03: skip (0.004s)
add_key04: pass (0.004s)
add_key05: skip (0.003s)
adjtimex01: skip (0.002s)
adjtimex02: skip (0.002s)
adjtimex03: pass (0.004s)
alarm02: pass (0.004s)
alarm03: pass (0.004s)
vignesh@debian:/opt/kirk$ sudo ./kirk --run-suite syscalls
Host information
Hostname: debian
Python: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0]
Directory: /tmp/kirk.root/tmpko7pd7sg
Connecting to SUT: host
Error: Can't setup failure budget for /sys/kernel/debug/fail_io_timeout/probability
Disconnecting from SUT: host
Session stopped
vignesh@debian:/opt/kirk$ sudo ./kirk -F 100 --run-suite syscalls
[sudo] password for vignesh:
Host information
Hostname: debian
Python: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0]
Directory: /tmp/kirk.root/tmptmyhgqb8
Connecting to SUT: host
Starting suite: syscalls
-------------------------
abort01: pass (0.018s)
accept01: pass (0.002s)
accept02: pass (0.005s)
accept03: skip (0.007s)
accept4_01: skip (1.436s)
access01: pass (0.044s)
access02: pass (0.012s)
access03: pass (0.005s)
access04: pass (0.037s)
acct01: broken (0.002s)
acct02: broken (0.001s)
add_key01: skip (0.002s)
add_key02: pass (0.014s)
add_key03: pass (0.004s)
add_key04: pass (0.013s)
add_key05: pass (0.243s)
adjtimex01: pass (0.002s)
adjtimex02: skip (0.014s)
adjtimex03: pass (0.001s)
alarm02: pass (0.002s)
alarm03: pass (0.002s)
There was a problem hiding this comment.
Would you also add a new tag in kirk?
There was a problem hiding this comment.
Would you also add a new tag in kirk?
do you mean one more configuration? I'm actually following the runltp way, then we will eventually add more configurations if required
There was a problem hiding this comment.
Would you also add a new tag in kirk?
do you mean one more configuration? I'm actually following the runltp way, then we will eventually add more configurations if required
No, not the configuration. I meant the release tags https://github.com/linux-test-project/kirk/releases/tag/v2.1
There was a problem hiding this comment.
That will be done at the next release, yes
There was a problem hiding this comment.
For reference, failure triggered by kernel fault injection.
[ 3036.123772] EXT4-fs (loop0): unmounting filesystem 4cad1b4a-abdf-4fad-b65b-ad3b26a8a14e.
[ 3036.989842] FAULT_INJECTION: forcing a failure.
[ 3036.989842] name failslab, interval 100, probability 100, space 0, times -1
[ 3036.990912] CPU: 0 UID: 0 PID: 16779 Comm: kworker/u4:4 Not tainted 6.14.0-rc4-g8e449e155a5b #1
[ 3036.990914] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 3036.990915] Workqueue: loop0 loop_rootcg_workfn
[ 3036.990920] Call Trace:
[ 3036.990923] <TASK>
[ 3036.990925] dump_stack_lvl+0x83/0xc0
[ 3036.990929] should_fail_ex+0x3aa/0x3c0
[ 3036.990938] ? __es_insert_extent+0x253/0x620
[ 3036.990940] should_failslab+0x4f/0x60
[ 3036.990943] kmem_cache_alloc_noprof+0x51/0x280
[ 3036.990946] __es_insert_extent+0x253/0x620
[ 3036.990949] ext4_es_insert_delayed_extent+0x212/0x490
[ 3036.990954] ext4_da_get_block_prep+0x412/0x550
[ 3036.990956] ? lock_release+0xdb/0x270
[ 3036.990960] ext4_block_write_begin+0x176/0x4b0
[ 3036.990962] ? __folio_batch_add_and_move+0x1ed/0x2f0
[ 3036.990965] ? trace_ext4_da_release_space+0xa0/0xa0
[ 3036.990968] ? lock_acquire+0xb7/0x1a0
[ 3036.990970] ext4_da_write_begin+0x1b6/0x290
[ 3036.990974] generic_perform_write+0xe6/0x240
[ 3036.990978] ext4_buffered_write_iter+0xc6/0x160
[ 3036.990980] ext4_file_write_iter+0x64/0x7d0
[ 3036.990983] ? lock_acquire+0xb7/0x1a0
[ 3036.990984] ? vfs_iter_write+0xb1/0x1b0
[ 3036.990987] do_iter_readv_writev+0x18f/0x1d0
[ 3036.990991] vfs_iter_write+0xc7/0x1b0
[ 3036.990993] loop_process_work+0x676/0x930
[ 3036.991000] ? lock_acquire+0xb7/0x1a0
[ 3036.991001] ? process_scheduled_works+0x266/0x510
[ 3036.991005] ? process_scheduled_works+0x1ef/0x510
[ 3036.991007] ? process_scheduled_works+0x266/0x510
[ 3036.991009] process_scheduled_works+0x29c/0x510
[ 3036.991014] worker_thread+0x25e/0x330
[ 3036.991016] ? _raw_spin_unlock_irqrestore+0x31/0x50
[ 3036.991019] ? pr_cont_work+0x190/0x190
[ 3036.991021] kthread+0x207/0x220
[ 3036.991023] ? kthread_blkcg+0x30/0x30
[ 3036.991025] ret_from_fork+0x34/0x40
[ 3036.991027] ? kthread_blkcg+0x30/0x30
[ 3036.991029] ret_from_fork_asm+0x11/0x20
[ 3036.991033] </TASK>
443092d to
2112bae
Compare
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
Add --fault-injection|-F option and change the short version of the --force-parallel option to -W. In this way we keep runltp back compatibility. Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
Add a new
-F|--fault-injectionoption to implement runltp fault injection support.The previous
-Foption has been renamed-Wto maintain back compatibility with runltp.Closes: #64
Signed-off-by: Andrea Cervesato andrea.cervesato@suse.com