mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
tests/fprintd: Ensure we can claim and release with only the verify permission
This commit is contained in:
committed by
Benjamin Berg
parent
a681996d1d
commit
0904c8a527
13
tests/fprintd.py
Executable file → Normal file
13
tests/fprintd.py
Executable file → Normal file
@ -472,12 +472,18 @@ class FPrintdManagerPreStartTests(FPrintdTest):
|
||||
|
||||
class FPrintdVirtualDeviceTest(FPrintdVirtualDeviceBaseTest):
|
||||
|
||||
def test_allowed_claim(self):
|
||||
def test_allowed_claim_release_enroll(self):
|
||||
self._polkitd_obj.SetAllowed(['net.reactivated.fprint.device.setusername',
|
||||
'net.reactivated.fprint.device.enroll'])
|
||||
self.device.Claim('(s)', 'testuser')
|
||||
self.device.Release()
|
||||
|
||||
def test_allowed_claim_release_verify(self):
|
||||
self._polkitd_obj.SetAllowed(['net.reactivated.fprint.device.setusername',
|
||||
'net.reactivated.fprint.device.verify'])
|
||||
self.device.Claim('(s)', 'testuser')
|
||||
self.device.Release()
|
||||
|
||||
def test_allowed_claim_current_user(self):
|
||||
self._polkitd_obj.SetAllowed(['net.reactivated.fprint.device.enroll'])
|
||||
self.device.Claim('(s)', '')
|
||||
@ -522,6 +528,11 @@ class FPrintdVirtualDeviceTest(FPrintdVirtualDeviceBaseTest):
|
||||
with self.assertFprintError('PermissionDenied'):
|
||||
self.device.Claim('(s)', 'testuser')
|
||||
|
||||
self._polkitd_obj.SetAllowed(['net.reactivated.fprint.device.verify'])
|
||||
|
||||
with self.assertFprintError('PermissionDenied'):
|
||||
self.device.Claim('(s)', 'testuser')
|
||||
|
||||
def test_unallowed_claim_current_user(self):
|
||||
self._polkitd_obj.SetAllowed([''])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user