mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
device: Fail with any non-zero return value on storage print_data_save()
When saving the prints we use g_file_set_contents under the hood and in case return its error code that is a positive value. So in such case we don't fail if we have a write failure at the end of the enrollment. While we could ensure in file storage to always return a negative value, it's always better to ensure that is has to be 0 when we didn't get an error. Add a test checking for this case.
This commit is contained in:
@ -1603,6 +1603,10 @@ class FPrintdVirtualDeviceClaimedTest(FPrintdVirtualDeviceBaseTest):
|
||||
|
||||
self.enroll_image('whorl', expected_result='enroll-failed')
|
||||
|
||||
def test_enroll_write_print_error(self):
|
||||
self.set_print_not_writable('testuser', FPrint.Finger.LEFT_THUMB)
|
||||
self.enroll_image('whorl', expected_result='enroll-failed', finger='left-thumb')
|
||||
|
||||
def test_verify_invalid_storage_dir(self):
|
||||
self.enroll_image('whorl')
|
||||
os.chmod(self.state_dir, mode=0o000)
|
||||
|
||||
Reference in New Issue
Block a user