From bc50a843b2305e99dc38a58dd14d68d85f0ca326 Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Wed, 2 Oct 2024 20:27:25 +0000 Subject: [PATCH] needs-restarting tests: Can't discriminate block devices any more We can no longer detect that block devices like /dev/dri/card0 are not "regular files", since they have device IDs matching 00:xx, just like other legitimate files on some systems. This should be fine since no package should provide a file like /dev/dri/card0. Instead, we add a test that smap entries like ``` 556d60d52000-556d60e1c000 rw-p 00000000 00:00 0 [heap] ``` are not treated as regular files (since the file path doesn't contain a /). --- tests/test_needs_restarting.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_needs_restarting.py b/tests/test_needs_restarting.py index d7dd6d5a..16a7d17f 100644 --- a/tests/test_needs_restarting.py +++ b/tests/test_needs_restarting.py @@ -28,15 +28,14 @@ DEL_FILE = '3dcf000000-3dcf032000 r-xp 00000000 08:02 140759 ' \ ' /usr/lib64/libXfont.so.1.4.1;5408628d (deleted)' -MM_FILE = '7fc4e1168000-7fc4e1169000 rw-s 1096dd000 00:05 7749' \ - ' /dev/dri/card0' +HEAP_FILE = '556d60d52000-556d60e1c000 rw-p 00000000 00:00 0 [heap]' SO_FILE = '30efe06000-30efe07000 r--p 00006000 08:02 139936' \ ' /usr/lib64/libSM.so.6.0.1' class NeedsRestartingTest(tests.support.TestCase): def test_smap2opened_file(self): func = needs_restarting.smap2opened_file self.assertIsNone(func(1, 'Shared_Dirty: 0 kB')) - self.assertIsNone(func(1, MM_FILE)) + self.assertIsNone(func(1, HEAP_FILE)) ofile = func(5, SO_FILE) self.assertFalse(ofile.deleted)