1. 13 Oct, 2020 2 commits
  2. 02 Oct, 2020 1 commit
    • Benjamin Berg's avatar
      tests: Fix test not failing on error · 6dc699ae
      Benjamin Berg authored
      An assertion that is raised within a callback will not be swallowed by
      the C code that called the function. To ensure that errors will be
      noticable, pass the result back to the surrounding scope and check it
      there.
      6dc699ae
  3. 01 Oct, 2020 3 commits
    • Benjamin Berg's avatar
      tests: Check that a verify operation can be immediately restarted · e075d375
      Benjamin Berg authored
      This excercises the path where we early-report a result and the
      VerifyStop call must wait for the operation to complete intenernally.
      
      Note that this test cannot fail right now due to the FpImageDevice
      internal code still trying to hide the deactivation delay internally.
      
      See libfprint!174
      e075d375
    • Marco Trevisan's avatar
      device: Use early match for reporting verify status · 18d6a86e
      Marco Trevisan authored
      libfprint 1.90.1 supports early match result report which allows to inform
      the clients as soon as the driver detected a match/no-match without having
      to wait the whole device driver deactivation.
      
      Use this feature in fprintd, by emitting the "VerifyStatus" signal as soon
      as we've an usable result we can inform the client about.
      
      As per this, ignore any possible error we may get afterwards, due to device
      issues or late user cancellation, as the point of the verification action
      (i.e. getting a match/no-match) can be considered accomplished.
      
      Fixes #35
      18d6a86e
    • Benjamin Berg's avatar
      device: Fix race condition when clients vanish · 14051cac
      Benjamin Berg authored
      If a client vanishes while we are opening or closing then fprintd would
      uncoditionally try to close the device immediately. This should not be
      done, it instead needs to wait for the open/close to complete.
      
      Add open/close to the current action enum and keep track of the fact
      that they are ongoing. Also check, whether the device has been closed in
      the meantime (after the nested mainloop is done).
      
      Fixes: #65
      14051cac
  4. 18 Aug, 2020 1 commit
  5. 17 Aug, 2020 5 commits
  6. 27 May, 2020 2 commits
  7. 11 May, 2020 1 commit
    • Marco Trevisan's avatar
      device: Remove unused disconnected flag · ba60533f
      Marco Trevisan authored
      We were saving the state of a disconnected device because we used a
      workaround to figure it out, but now libfprint would provide us a proper
      GError in such case, and so we'd handle it without the need of saving the
      state, given it's never used anyways.
      ba60533f
  8. 07 Apr, 2020 1 commit
  9. 01 Apr, 2020 5 commits
  10. 31 Mar, 2020 1 commit
  11. 27 Mar, 2020 8 commits
    • Marco Trevisan's avatar
      tests/fprintd: Add checks for delete enrolled fingers permissions · 90298134
      Marco Trevisan authored
      The test doesn't need any assertion because we're calling DeleteEnrolledFingers
      and in case it fails a net.reactivated.Fprint.Error.PermissionDenied error
      would be thrown, and thus an exception would be raised at python level, making
      the test to fail.
      90298134
    • Bastien Nocera's avatar
    • Bastien Nocera's avatar
      file_storage: Handle STATE_DIRECTORY containing multiple paths · fd733e55
      Bastien Nocera authored
      As per systemd's documentation:
      If multiple directories are set, then in the environment variable the
      paths are concatenated with colon (":").
      
      Handle that case by splitting the paths if there's a ":" in the
      variable.
      
      Closes: #50
      fd733e55
    • Bastien Nocera's avatar
      tests/fprintd: Fix claim_from_other_client_is_released_when_vanished on CI · 6a1fffae
      Bastien Nocera authored
      test_claim_from_other_client_is_released_when_vanished would fail on
      the CI but work on a local system because we wouldn't want long enough
      for the "vanished" code path to be taken into account. Add a small
      timeout to make sure it works on the CI as well.
      6a1fffae
    • Bastien Nocera's avatar
      tests/fprintd: Fix test_enroll_invalid_storage_dir test · 47bd3f7f
      Bastien Nocera authored
      enroll_image() was always waiting for enroll-completed rather than for
      what the caller expected as the result.
      
      ======================================================================
      FAIL: test_enroll_invalid_storage_dir (__main__.FPrintdVirtualDeviceClaimedTest)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/hadess/Projects/jhbuild/fprintd/tests/fprintd.py", line 661, in test_enroll_invalid_storage_dir
          self.enroll_image('whorl', expected_result='enroll-failed')
        File "/home/hadess/Projects/jhbuild/fprintd/tests/fprintd.py", line 384, in enroll_image
          self.wait_for_result('enroll-completed')
        File "/home/hadess/Projects/jhbuild/fprintd/tests/fprintd.py", line 373, in wait_for_result
          self.assertEqual(self._last_result, expected)
      AssertionError: 'enroll-failed' != 'enroll-completed'
      - enroll-failed
      + enroll-completed
      47bd3f7f
    • Marco Trevisan's avatar
      build: List single unit python tests allowing to run them separately · 4f3589c0
      Marco Trevisan authored
      We run a certain number of tests right now, without being able to easily
      run them separated or to check which one failed.
      
      So add a script to inspect all the available unittests per each python
      script and use it to figure out the tests we can run in meson.
      
      As per this, define a global 'python_tests' variable in meson that allows
      to register new python tests easily without having to repeat the settings
      for all the tests.
      
      For each test we have, we check if we can fetch a list of unit tests, and
      if possible we create a meson test for each one.
      Otherwise we just fallback to normal behavior.
      
      This is something that can be hopefully implemented into upstream meson [1].
      
      [1] https://github.com/mesonbuild/meson/issues/6851
      4f3589c0
    • Marco Trevisan's avatar
      tests/fprintd: Add missing implementation of list_tests · eccd790d
      Marco Trevisan authored
      Use unittest_inspector that we provide for meson tests inspection as well
      eccd790d
    • Marco Trevisan's avatar
      tests: Add a tool to inspect the single python unit tests · bc29114a
      Marco Trevisan authored
      The unit tests files are provided as python files, adding a tool that
      allows to list them in order to be able to run them easily via
      
        python3 -m unittest module.Class.test_method
      bc29114a
  12. 24 Mar, 2020 3 commits
  13. 23 Mar, 2020 2 commits
    • Timothy Gu's avatar
      tests/fprintd: Increase allowed timeout · d7fec03f
      Timothy Gu authored
      On my laptop it takes 48 seconds to run.
      d7fec03f
    • Timothy Gu's avatar
      tests/fprintd: Allow tests to run even when virtual device is not available · 4a3ae5cc
      Timothy Gu authored
      The test file calls self.daemon_start() in order to start fprintd and
      locate the virtual image device that's needed for the test to run.
      However, since the virtual image driver is not available on all
      libfprint installations, the test should be skipped if the driver is not
      available.
      
      The skipping mechanism used to work, by checking if self.device is None.
      This is based on the assumption that self.device would be set to None in
      cases where the driver is not available. However, even in the past
      self.device is only set to None in the tearDown method and not in setUp,
      so presumably in edge cases it didn't entirely work.
      
      However, since 0fb4f3b0 which
      consistently removes the self.device attribute rather than setting it to
      None, the "self.device is None" check no longer works. In particular,
      the following error message is shown:
      
          test_manager_get_default_device (__main__.FPrintdManagerTests) ...
          Did not find virtual device! Probably libfprint was build without
          the corresponding driver!
          ERROR
      
      After this patch, the following is shown:
      
          test_manager_get_default_device (__main__.FPrintdManagerTests) ...
          Did not find virtual device! Probably libfprint was build without
          the corresponding driver!
          skipped 'Need virtual_image device to run the test'
      
      We fix this bug by consistently setting self.device to None, in both the
      setUp method before daemon_start gets called, and in tearDown. We also
      make the same change to self.manager for consistency.
      
      The issue was not caught on CI, as the CI configuration always installs
      a libfprint version that has the virtual_image device explicitly enabled
      in the preparation phase.
      4a3ae5cc
  14. 20 Mar, 2020 1 commit
  15. 17 Mar, 2020 4 commits