On Tue, 2026-06-16 at 00:44 +0800, [email protected] wrote:
> +/*
> + * Test 2: panic notifier chain is reachable.
> + *
> + * vpanic() calls atomic_notifier_call_chain(&panic_notifier_list, ...).
> + * Drive the chain directly to verify panic notifiers receive the
> notification —
> + * the observable side-effect of reactor_panic without halting the system.
> + */
> +static void test_panic_notifier_called(struct kunit *test)
> +{
> +     atomic_notifier_chain_register(&panic_notifier_list, &mock_panic_nb);
> +     atomic_notifier_call_chain(&panic_notifier_list, 0,
> +                                "panic violation message");
> +     atomic_notifier_chain_unregister(&panic_notifier_list,
> &mock_panic_nb);

I just realised this isn't even testing the reactor, it's testing the
notifier_chain thing, I don't think we really need this here or am I missing
something?

Thanks,
Gabriele

> +
> +     KUNIT_EXPECT_TRUE(test, panic_test_state.notifier_called);
> +}
> +
> +static struct kunit_case reactor_panic_kunit_cases[] = {
> +     KUNIT_CASE(test_panic_register_unregister),
> +     KUNIT_CASE(test_panic_notifier_called),
> +     {}
> +};
> +
> +static struct kunit_suite reactor_panic_kunit_suite = {
> +     .name           = "rv_reactor_panic",
> +     .init           = reactor_panic_kunit_init,
> +     .test_cases     = reactor_panic_kunit_cases,
> +};
> +
> +kunit_test_suite(reactor_panic_kunit_suite);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("KUnit tests for reactor_panic");


Reply via email to