1. 11 Nov, 2019 5 commits
  2. 08 Nov, 2019 1 commit
  3. 07 Nov, 2019 24 commits
    • Thomas Haller's avatar
      b4e62ca7
    • Thomas Haller's avatar
      clients/tests: read stdout/stderr buffers during test-clients.py · e96bc190
      Thomas Haller authored
      We need to actually read the stdout/stderr of the nmcli programs.
      Otherwise, the pipe might fill uup and block to process (eventually
      leading to timeout).
      e96bc190
    • Thomas Haller's avatar
      clients/tests: set NM_TEST_CALLING_NUM environement variable for client tests · cdb95062
      Thomas Haller authored
      Debugging tests that are called by test-client.py is cumbersome.
      One way would be to set NM_TEST_CLIENT_NMCLI_PATH to a wrapper script.
      However, then we want to know from the wrapper script which test
      we are currently calling. Add that to the environment.
      cdb95062
    • Thomas Haller's avatar
      cli: unsubscribe permission signal from NMClient on exit · 6a9ed0ad
      Thomas Haller authored
      During the libnm rework, we might still emit permissions changed
      signal while destructing the instance. That triggers an assertion.
      
      Backtrace, with a different libnm:
      
        #0  _g_log_abort (breakpoint=1) at ../glib/gmessages.c:554
        #1  0x00007ffff77d09b6 in g_logv (log_domain=0x7ffff7f511cd "libnm", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcb80) at ../glib/gmessages.c:1373
        #2  0x00007ffff77d0b83 in g_log
            (log_domain=log_domain@entry=0x7ffff7f511cd "libnm", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff78215df "%s: assertion '%s' failed")
            at ../glib/gmessages.c:1415
        #3  0x00007ffff77d137d in g_return_if_fail_warning
            (log_domain=log_domain@entry=0x7ffff7f511cd "libnm", pretty_function=pretty_function@entry=0x7ffff7f58aa0 <__func__.40223> "nm_client_get_permission_result", expression=expression@entry=0x7ffff7f54830 "NM_IS_CLIENT (client)") at ../glib/gmessages.c:2771
        #4  0x00007ffff7e9de9a in nm_client_get_permission_result (client=0x0, permission=permission@entry=NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK) at libnm/nm-client.c:3816
        #5  0x0000555555593ba3 in got_permissions (nmc=nmc@entry=0x55555562ec20 <nm_cli>) at clients/cli/general.c:587
        #6  0x0000555555593bcb in permission_changed (client=<optimized out>, permission=<optimized out>, result=<optimized out>, nmc=0x55555562ec20 <nm_cli>) at clients/cli/general.c:600
        #7  0x00007ffff73b1aa8 in ffi_call_unix64 () at ../src/x86/unix64.S:76
        #8  0x00007ffff73b12a4 in ffi_call (cif=cif@entry=0x7fffffffced0, fn=fn@entry=0x555555593bbf <permission_changed>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffffffcde0)
            at ../src/x86/ffi64.c:525
        #9  0x00007ffff78b4746 in g_cclosure_marshal_generic_va
            (closure=<optimized out>, return_value=<optimized out>, instance=<optimized out>, args_list=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=<optimized out>) at ../gobject/gclosure.c:1614
        #10 0x00007ffff78b3996 in _g_closure_invoke_va (closure=0x5555556f4330, return_value=0x0, instance=0x55555565a020, args=0x7fffffffd180, n_params=2, param_types=0x555555656f00)
            at ../gobject/gclosure.c:873
        #11 0x00007ffff78d0228 in g_signal_emit_valist (instance=0x55555565a020, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd180) at ../gobject/gsignal.c:3306
        #12 0x00007ffff78d09d3 in g_signal_emit (instance=instance@entry=0x55555565a020, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3453
        #13 0x00007ffff7e8989a in _emit_permissions_changed (self=self@entry=0x55555565a020, permissions=permissions@entry=0x555555690e40 = {...}, force_unknown=force_unknown@entry=1)
            at libnm/nm-client.c:2874
        #14 0x00007ffff7e9a0c9 in _init_release_all (self=self@entry=0x55555565a020) at libnm/nm-client.c:6092
        #15 0x00007ffff7e9bcde in dispose (object=0x55555565a020 [NMClient]) at libnm/nm-client.c:6838
        #16 0x00007ffff78b8c28 in g_object_unref (_object=<optimized out>) at ../gobject/gobject.c:3344
        #17 g_object_unref (_object=0x55555565a020) at ../gobject/gobject.c:3274
        #18 0x00005555555badcf in nmc_cleanup (nmc=0x55555562ec20 <nm_cli>) at clients/cli/nmcli.c:924
        #19 0x00005555555bbea7 in main (argc=<optimized out>, argv=0x7fffffffd498) at clients/cli/nmcli.c:987
      6a9ed0ad
    • Thomas Haller's avatar
      libnm/tests: fix stub implementation for remote-next-connection · 44a56fca
      Thomas Haller authored
      We cannot first remove the connection (and emit property changed signals),
      before replying with the newly added path (that already no longer exists).
      Fix the stub implementation.
      44a56fca
    • Thomas Haller's avatar
      libnm/tests: drop test_activate_failed() test · 6bf206eb
      Thomas Haller authored
      With this test the stub service simulates a failure to add-and-activate
      the connection.
      
      However the implementation of the stub service was not simulating the
      real behavior of NetworkManager service. libnm will add the possibility
      to assert against invalid server behavior by setting LIBNM_CLIENT_DEBUG=error.
      With that change, libnm will complain that the stub service behaves
      invalid, and rightly so.
      
      Instead of fixing the test, just drop it.
      6bf206eb
    • Thomas Haller's avatar
      libnm/tests: unsubscribe signal handler during test_activate_virtual() · feea4222
      Thomas Haller authored
      libnm is gonna change, where it would still emit signals when the
      instance gets destructed. In particular, when the device gets removed
      from the NMClient cache, the references to other objects would be
      cleared (and consequently property changed signals emitted).
      
      This will cause a test failure, because the signal was not unsubscribed:
      
          test:ERROR:libnm/tests/test-nm-client.c:694:device_ac_changed_cb: assertion failed: (nm_device_get_active_connection (NM_DEVICE (device)) != NULL)
      feea4222
    • Thomas Haller's avatar
      tests: use nmtstc_client_new() to create NMClient instance and cleanup tests · f21b8781
      Thomas Haller authored
      The advantage of nmtstc_client_new() is that it randomly either uses the
      synchronous or asynchronous constructor. Of course, both should behave
      pretty much the same. Hence, this increases our test coverage.
      f21b8781
    • Thomas Haller's avatar
      tests: add nmtstc_client_new() helper · 8def37dd
      Thomas Haller authored
      8def37dd
    • Thomas Haller's avatar
      tests: support D-Bus property Device.StateReason in mock service · ec39498f
      Thomas Haller authored
      The device interface (org.freedesktop.NetworkManager.Device) has
      two properties: "State" and "StateReason". Both of them are supported by
      NetworkManager for a very long time.
      
      Note that "StateReason" is a tuple and also exposes the state along the
      reason.
      
      When reworking libnm, we will ignore the "State" property and only
      consider "StateReason". The advantage is less code and not using
      redundant state. This will also work well, because NetworkManager's
      D-Bus API supports this property for a very long time.
      
      However, that would then break the CI tests, because currently
      "tools/test-networkmanager-service.py" does not expose that property.
      
      Add it.
      ec39498f
    • Thomas Haller's avatar
      libnm: retire nm_client_wimax_*() functions · abb68d90
      Thomas Haller authored
      The server doesn's support WiMAX anymore. Hence there is no point in keeping
      this functionality. While we cannot drop the functions, let them not do anything.
      
      The code in NMManager is still there. But since we will soon drop
      NMManager entirely, it doesn't matter.
      abb68d90
    • Thomas Haller's avatar
      libnm: move nm_permission_to_client()/nm_permission_result_to_client() to nm-libnm-utils.c · 2e91add7
      Thomas Haller authored
      It's nicely trivial and independent. Move it to a separate place,
      to avoid cluttering the more complicated code and to make it testable.
      
      Also, use binary search to find the value by string.
      2e91add7
    • Thomas Haller's avatar
      libnm: deprecate nm_device_set_managed() and nm_device_set_autoconnect() API · 83d7599a
      Thomas Haller authored
      These setters not only invoke a synchronous D-Bus call (ignoring the
      return value). They also modify the content of the cache client-side,
      bypassing the information that we receive via notifications from the
      server.
      
      Also, they don't emit property changed signals, but in any case they
      are broken beyond repair.
      
      Fully mark them as deprecated. Note that they were already marked as
      _NM_DEPRECATED_SYNC_METHOD. However, that does not actually mark
      the API as deprecated, because fully deprecating all synchronous
      methods is premature at this point.
      83d7599a
    • Thomas Haller's avatar
      libnm: print timestamp in LIBNM_CLIENT_DEBUG debug logging · 9c01d6ca
      Thomas Haller authored
      It's useful, because it's easy to get overwhelemed by the logging output.
      The timestamp makes it easier to keep track. Also, it allows to see how long
      things take.
      9c01d6ca
    • Thomas Haller's avatar
      all: use nm_dbus_path_not_empty() · 14634503
      Thomas Haller authored
      14634503
    • Thomas Haller's avatar
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      3b95905a
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      15fe8ad8
    • Thomas Haller's avatar
      shared: add nm_g_set_error_take*() util · 9b2d5742
      Thomas Haller authored
      9b2d5742
    • Thomas Haller's avatar
      shared: add nm_ppdirect_hash()/nm_ppdirect_equal() helpers · d21439ea
      Thomas Haller authored
      Useful for hashing pointers to a pointer to a pointer, and
      compare the resulting pointer directly. This will be actually
      used.
      d21439ea
    • Thomas Haller's avatar
      86352cea
    • Thomas Haller's avatar
      nmcli/tests: fix broken test after "nmcli: show IP interface name when doing... · 4a870c57
      Thomas Haller authored
      nmcli/tests: fix broken test after "nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'"
      
      Fixes: 303fc174 ('nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'')
      4a870c57
  4. 06 Nov, 2019 5 commits
  5. 05 Nov, 2019 1 commit
  6. 04 Nov, 2019 4 commits