From 0fff1295763b338cbfb6a893c8935391f6a5b61d Mon Sep 17 00:00:00 2001 From: Omar Sandoval Date: Wed, 23 Oct 2024 15:39:07 -0700 Subject: [PATCH] tests: move jiffies object finder test case to test_special_objects.py It fits in with the other special objects there. Signed-off-by: Omar Sandoval --- tests/linux_kernel/test_debug_info.py | 14 +------------- tests/linux_kernel/test_special_objects.py | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/linux_kernel/test_debug_info.py b/tests/linux_kernel/test_debug_info.py index b7f803d06..75ccabf50 100644 --- a/tests/linux_kernel/test_debug_info.py +++ b/tests/linux_kernel/test_debug_info.py @@ -5,7 +5,7 @@ from pathlib import Path import unittest -from drgn import Object, Program +from drgn import Program from tests import modifyenv from tests.linux_kernel import LinuxKernelTestCase, skip_unless_have_test_kmod @@ -48,15 +48,3 @@ def test_module_debug_info_use_proc_and_sys(self): def test_module_debug_info_use_core_dump(self): self._test_module_debug_info(False) - - -class TestLinuxKernelObjectFinder(LinuxKernelTestCase): - def test_jiffies(self): - self.assertIdentical( - self.prog["jiffies"], - Object( - self.prog, - "volatile unsigned long", - address=self.prog.symbol("jiffies").address, - ), - ) diff --git a/tests/linux_kernel/test_special_objects.py b/tests/linux_kernel/test_special_objects.py index 4e282fd82..8d372ad80 100644 --- a/tests/linux_kernel/test_special_objects.py +++ b/tests/linux_kernel/test_special_objects.py @@ -3,10 +3,22 @@ import os -import drgn +from drgn import Object, Program from tests.linux_kernel import LinuxKernelTestCase +class TestJiffies(LinuxKernelTestCase): + def test_jiffies(self): + self.assertIdentical( + self.prog["jiffies"], + Object( + self.prog, + "volatile unsigned long", + address=self.prog.symbol("jiffies").address, + ), + ) + + class TestUts(LinuxKernelTestCase): def test_uts_release(self): self.assertEqual( @@ -14,7 +26,7 @@ def test_uts_release(self): ) def test_uts_release_no_debug_info(self): - prog = drgn.Program() + prog = Program() prog.set_kernel() self.assertEqual(prog["UTS_RELEASE"].string_().decode(), os.uname().release) @@ -31,7 +43,7 @@ def test_vmcoreinfo(self): ) def test_vmcoreinfo_no_debug_info(self): - prog = drgn.Program() + prog = Program() prog.set_kernel() vmcoreinfo_data = dict( line.split("=", 1)