File: test_kthread.py

package info (click to toggle)
drgn 0.0.31-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,956 kB
  • sloc: ansic: 49,446; python: 45,054; awk: 423; makefile: 339; sh: 114
file content (17 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Copyright (c) Meta Platforms, Inc. and affiliates.
# SPDX-License-Identifier: LGPL-2.1-or-later

from drgn import Object
from drgn.helpers.linux.kthread import kthread_data
from tests.linux_kernel import LinuxKernelTestCase, skip_unless_have_test_kmod


@skip_unless_have_test_kmod
class TestKthread(LinuxKernelTestCase):
    # There's no good way to test to_kthread() directly, but it gets tested
    # indirectly through kthread_data().
    def test_kthread_data(self):
        self.assertIdentical(
            kthread_data(self.prog["drgn_test_kthread"]),
            Object(self.prog, "void *", 0xB0BA000),
        )