1. 27 Nov, 2018 5 commits
    • Christian Kellner's avatar
      test: integration: adjustment of default policy · 7f97a666
      Christian Kellner authored
      When enrolling an already authorized device with the 'default'
      policy, make sure we end up with the specific default of the daemon.
      7f97a666
    • Christian Kellner's avatar
      test: integration: whitespace fixes · 67a3419a
      Christian Kellner authored
      PEP-8 please, kthxbye.
      67a3419a
    • Christian Kellner's avatar
      test: integration: properly initialize local var · 86495439
      Christian Kellner authored
      Typo in the variable and a dynamic language. That is what I get for
      not fixing the python language server before making changes to the
      python code.
      86495439
    • Christian Kellner's avatar
      test: journal: don't 'exit' but return from fork · b49a45ec
      Christian Kellner authored
      In the /journal/object test, a subprocess is created and at the
      end of the child process' code an exit call was made to end it.
      For some reason (not sure why) that would generate a leak warning
      for the child (generating a negative exit code), making the main
      test fail at "g_test_trap_assert_passed". Now instead we simply
      return in the child.
      
      Child leak warning when using 'exit()':
      
      ==18507==ERROR: LeakSanitizer: detected memory leaks
      
      Direct leak of 32 byte(s) in 1 object(s) allocated from:
          #0 0x7f9b8cccbc88 in realloc (/lib64/libasan.so.5+0xefc88)
          #1 0x7f9b8cb1105d in g_realloc (/lib64/libglib-2.0.so.0+0x5405d)
      b49a45ec
    • Christian Kellner's avatar
      test: exported: free the CallCtx struct · d0626820
      Christian Kellner authored
      In call_ctx_free, all the resources associated with the CallCtx
      were freed, but not the struct itself, which also was dynamically
      allocated.
      
      Direct leak of 24 byte(s) in 1 object(s) allocated from:
          #0 0x7f3b56061a50 in __interceptor_calloc (/lib64/libasan.so.5+0xefa50)
          #1 0x7f3b55ea6ffd in g_malloc0 (/lib64/libglib-2.0.so.0+0x53ffd)
          #2 0x409a95 in test_exported_props ../tests/test-exported.c:806
          #3 0x7f3b55ec91a9  (/lib64/libglib-2.0.so.0+0x761a9)
      d0626820
  2. 26 Nov, 2018 6 commits
  3. 23 Nov, 2018 10 commits
    • Christian Kellner's avatar
      test: new basic device unit test · aa272a05
      Christian Kellner authored
      Currently just checks some properties that were not previously
      checked (according to coverage), one error condition of the
      bolt_device_key_from_sysfs function.
      aa272a05
    • Christian Kellner's avatar
      test: store: loading empty keys gives ERROR_NOKEY · 4259e00e
      Christian Kellner authored
      Check that loading empty key (zero content or one whitespace) files
      via bolt_key_load_file does result in BOLT_ERROR_NOKEY.
      4259e00e
    • Christian Kellner's avatar
      test: integration: de-dup auto import test code · 81f01639
      Christian Kellner authored
      De-duplicate the common code shared by both auto import tests.
      81f01639
    • Christian Kellner's avatar
      test: integration: auto import in secure mode · 45599070
      Christian Kellner authored
      Tests the auto-import code paths but for secure mode. For now,
      importing devices in secure mode should not happen because auto
      import only happens in secure when the device has a valid key
      is authorized and the boot attribute is set. Currently this
      should never be true at the same time.
      45599070
    • Christian Kellner's avatar
      test: integration: trailing '\n' for sysfs 'key' · a70b0ac5
      Christian Kellner authored
      The kernel ends the contents of 'key' with '\n', for non-zero but
      also empty key-files. Our code should thus too.
      a70b0ac5
    • Christian Kellner's avatar
      meson, test: nice naming for integration tests · faf7522a
      Christian Kellner authored
      The test-integration list-test will now output a pair of test id
      and human readable name like:
      
          Bolt.test_example_integration_test human_readable_name
      
      Adopt meson to use the first as the argument to test-integration
      and the second one for name to show to the user.
      faf7522a
    • Christian Kellner's avatar
      common: helper to create on GError for errno · 82be389f
      Christian Kellner authored
      Like g_set_error but will create a G_IO_ERROR with the error code
      derived via g_io_error_from_errno. Returns TRUE if errno is 0 and
      will not do anything if error is NULL.
      NB: will not create a error message from the errno, but the '%m'
      extension should work (and is tested for).
      82be389f
    • Christian Kellner's avatar
      test: bootacl: check handling of an empty boot_acl · 244dc4d1
      Christian Kellner authored
      Although that should never actually happen, make sure we correctly
      handle empty boot_acl files, i.e. the boot_acl files exists, but
      does not have any slots.
      244dc4d1
    • Christian Kellner's avatar
      test: fix broken "bootacl unsupported" store test · 6ae24428
      Christian Kellner authored
      When checking that a NULL bootacl will stay that way if the domain
      is stored and get back, the wrong object was checked, resulting
      in the test returing OK, when the code was actually broken.
      Check the loaded object, not the one that was stored.
      6ae24428
    • Christian Kellner's avatar
      store: return NULL for empty bootacl entries · ef6a1447
      Christian Kellner authored
      When the domain is stored and the bootacl is NULL, it will result
      in "bootacl=" in the key file. When this later read back, it will
      result in a non-zero, but empty (i.e. 0 elements) bootacl property.
      As a result the BoltDomain will report that bootacl support is
      present, but many of the internal functions will fail, if bootacl
      has no usable slots. Therefore when the bootacl is read back and
      is empty, we set it to NULL.
      ef6a1447
  4. 20 Nov, 2018 1 commit
    • Christian Kellner's avatar
      common: bolt_strv_isempty helper added · 7eaa5416
      Christian Kellner authored
      Check if the supplied string vector is NULL or contains zero
      elements. Currently implemented as macro, not inline function,
      due to const correctness and nested pointer types.
      7eaa5416
  5. 19 Nov, 2018 3 commits
    • Christian Kellner's avatar
      test: more robust permutation test · 324adfe8
      Christian Kellner authored
      The identity permutation is also a valid random permutation, so
      instead of doing the permutation only once and then checking if
      an permutation actually happened do it in a loop and check that
      the identity permutation only occurred up to a threshold.
      Currently the repetition is rather low but to account for that
      the threshold is quite high.
      324adfe8
    • Christian Kellner's avatar
      common: enums: stronger precondition for enums · ce6e68ac
      Christian Kellner authored
      Passing an invalid type (or NULL) to the bolt_enum_xxx functions
      is a programming error and such be treated as such. Therefore
      the error checks are turned into pre-condition checks.
      ce6e68ac
    • Christian Kellner's avatar
      common: flags: stronger pre-condition checking · 6585e550
      Christian Kellner authored
      Make having a valid flags class and type a precondition instead
      of doing standard error checking on the parameters. Passing an
      invalid type/class is a programming error, treat is as such.
      6585e550
  6. 16 Nov, 2018 1 commit
  7. 15 Nov, 2018 1 commit
  8. 14 Nov, 2018 2 commits
  9. 13 Nov, 2018 8 commits
  10. 12 Nov, 2018 3 commits