1. 13 Dec, 2019 14 commits
  2. 10 Dec, 2019 3 commits
  3. 28 Nov, 2019 1 commit
  4. 22 Nov, 2019 2 commits
  5. 11 Nov, 2019 1 commit
  6. 07 Nov, 2019 3 commits
  7. 13 Oct, 2019 2 commits
  8. 12 Oct, 2019 2 commits
    • Thomas Haller's avatar
      clients/tests: fix handling timeout for asynchronous jobs · b6725a59
      Thomas Haller authored
      Fixes: bb4b7495 ('clients/tests: don't wait for first job before scheduling parallel jobs')
      b6725a59
    • Thomas Haller's avatar
      clients/tests: don't wait for first job before scheduling parallel jobs · bb4b7495
      Thomas Haller authored
      Previously, the test would kick off 15 processes in parallel, but
      the first job in the queue would block more processes from being
      started.
      
      That is, async_start() would only start 15 processes, but since none of
      them were reaped before async_wait() was called, no more than 15 jobs
      were running during the start phase. That is not a real issue, because
      the start phase is non-blocking and queues all the jobs quickly. It's
      not really expected that during that time many processes already completed.
      Anyway, this was a bit ugly.
      
      The bigger problem is that async_wait() would always block for the
      first job to complete, before starting more processes. That means,
      if the first job in the queue takes unusually long, then this blocks
      other processes from getting reaped and new processes from being
      started.
      
      Instead, don't block only one one jobs, but poll them in turn for a
      short amount of time. Whichever process exits first will be completed
      and more jobs will be started.
      
      In fact, in the current setup it's hard to notice any difference,
      because all nmcli invocations take about the same time and are
      relatively fast. That this approach parallelizes better can be seen
      when the runtime of jobs varies stronger (and some invocations take
      a notably longer time). As we later want to run nmcli under valgrind,
      this probably will make a difference.
      
      An alternative would be not to poll()/wait() for child processes,
      but somehow get notified. For example, we could use a GMainContext
      and watch child processes. But that's probably more complicated
      to do, so let's keep the naive approach with polling.
      bb4b7495
  9. 02 Oct, 2019 1 commit
  10. 27 Sep, 2019 1 commit
  11. 26 Sep, 2019 2 commits
    • Thomas Haller's avatar
      clients/tests: don't include the source line number with client tests output · ad3ef326
      Thomas Haller authored
      The client tests compare the test output with a .expected file that is
      commit to git and that contains the expected output.
      
      The expected output contains data like
      
          size: 395
          location: clients/tests/test-client.py:842:test_001()/1
          cmd: $NMCLI
          lang: C
          returncode: 0
          stdout: 277 bytes
          >>>
          ...
      
      Note that there is the line number (clients/tests/test-client.py:842) of
      the source code where nmcli is called. This is to help correlate the output
      with the test code.
      
      However, Python 3.8 changes behavior and for function calls that span multiple
      lines, frame.f_lineno will give now the starting line (previously, it gave the last
      line) (see [1]).
      
      No longer include the line number, as it is not stable accross Python versions.
      
      If you really care, you can set NM_TEST_WITH_LINENO to get the line numbers back.
      Of course, then the expected output won't match anymore, and you'd have to regenerate
      it first. This is only useful if you debug tests, and want to have it easier to
      correlate output with the tests while developing them.
      
      [1] https://bugs.python.org/issue38283
      
      NetworkManager/NetworkManager!292
      ad3ef326
    • Thomas Haller's avatar
      clients/tests: skip client tests with python 3.8-beta · d7b99066
      Thomas Haller authored
      It's unclear how to workaround this issue, so that the tests
      work with older python versions and 3.8-beta.
      
      Let's wait whether this will really be released as 3.8 and
      for now just skip the test.
      d7b99066
  12. 25 Sep, 2019 2 commits
    • Thomas Haller's avatar
      tests: fix "clients/tests/test-client.py" concatenating binary for Python 3 · 97646d81
      Thomas Haller authored
      Python 3 doesn't like this:
      
          ======================================================================
          ERROR: test_001 (__main__.TestNmcli)
          ----------------------------------------------------------------------
          Traceback (most recent call last):
            File "./clients/tests/test-client.py", line 785, in f
              self._nm_test_post()
            File "./clients/tests/test-client.py", line 767, in _nm_test_post
              content_new = ''.join([r['content'] for r in results])
          TypeError: sequence item 0: expected str instance, bytes found
      97646d81
    • Thomas Haller's avatar
      tests: don't compare string literal with "is" in "clients/tests/test-client.py" · 989b26a8
      Thomas Haller authored
      Recent Python versions warn about this:
      
        ./clients/tests/test-client.py:569: SyntaxWarning: "is" with a literal. Did you mean "=="?
          elif lang is de:
        ./clients/tests/test-client.py:572: SyntaxWarning: "is" with a literal. Did you mean "=="?
          elif lang is pl:
      
      And rightly so: https://bugs.python.org/issue34850
      989b26a8
  13. 11 Sep, 2019 1 commit
    • Lubomir Rintel's avatar
      setting-gsm: add auto-config property · 0eb4a5df
      Lubomir Rintel authored
      This will make NetworkManager look up APN, username, and password in the
      Mobile Broadband Provider database.
      
      It is mutually exclusive with the apn, username and password properties.
      If that is the case, the connection will be normalized to
      auto-config=false. This makes it convenient for the user to turn off the
      automatism by just setting the apn.
      0eb4a5df
  14. 26 Aug, 2019 1 commit
  15. 22 Aug, 2019 1 commit
  16. 30 Jul, 2019 1 commit
    • Lubomir Rintel's avatar
      cli: abort on extra arguments · 577769b9
      Lubomir Rintel authored
      Instead of straight-out rejecting extra parameters for various nmcli
      sub-commands (such as "nmcli dev status", "nmcli dev wifi rescan" or
      "nmcli dev wifi connect", etc.), we just print a warning and go ahead.
      
      This is unhelpful. In case the user makes a typo, we'll do the wrong
      thing and possibly even drown the warning in the output.
      
      While at that, let's make the error message consistent. One less string
      to translate.
      
      !217
      577769b9
  17. 29 Jul, 2019 1 commit
  18. 10 Jul, 2019 1 commit
    • Thomas Haller's avatar
      libnm,cli,ifcfg-rh: add connection:wait-device-timeout property · b1297b8b
      Thomas Haller authored
      Initscripts already honor the DEVTIMEOUT variable (rh #1171917).
      
      Don't make this a property only supported by initscripts. Every
      useful property should also be supported by keyfile and it should
      be accessible via D-Bus.
      
      Also, I will soon drop NMSIfcfgConnection, so handling this would
      require extra code. It's easier when DEVTIMEOUT is a regular property of
      the connection profile.
      
      The property is not yet implemented. ifcfg-rh still uses the old
      implementation, and keyfile is not yet adjusted. Since both keyfile
      and ifcfg-rh will both be rewritten soon, this property will be
      implemented then.
      b1297b8b