Preserve sysfs capability word boundaries in laptop doctor
This commit is contained in:
@@ -78,6 +78,16 @@ class DoctorTests(unittest.TestCase):
|
||||
for secret in ('PRIVATE_SERIAL', 'PRIVATE_USER', 'PRIVATE_SSID', 'aa:bb:cc:dd:ee:ff'):
|
||||
self.assertNotIn(secret, encoded)
|
||||
|
||||
def test_keyboard_detection_preserves_64_bit_capability_word_boundaries(self):
|
||||
capability = self.file('sys/class/input/event0/device/capabilities/key')
|
||||
for bitmap, expected in (('10004000000 0\n', 0),
|
||||
('1 100040000000\n', 1),
|
||||
('100040000000\n', 1),
|
||||
('10004000000 invalid\n', 0)):
|
||||
with self.subTest(bitmap=bitmap):
|
||||
capability.write_text(bitmap)
|
||||
self.assertEqual(self.report()['input']['keyboards'], expected)
|
||||
|
||||
def test_probes_timeout_independently_and_discard_untrusted_output(self):
|
||||
calls = []
|
||||
def run(command, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user