1. 06 Jun, 2018 2 commits
  2. 05 Jun, 2018 4 commits
  3. 01 Jun, 2018 8 commits
    • Beniamino Galvani's avatar
      cli: fix active connections color · 0aa2d252
      Beniamino Galvani authored
      Fixes: a1b25a47
    • Thomas Haller's avatar
      cli/trivial: move code · 5d716def
      Thomas Haller authored
    • Thomas Haller's avatar
      cli: rework printing of general active-connection properties · 68fa68b3
      Thomas Haller authored
      use nmc_print() for the job.
      Also, localize non-terse output.
      Also, fix bug with
        $ nmcli c s /org/freedesktop/NetworkManager/ActiveConnection/1
      if active connection #1 is invisible to the user.
      Also, previously, fill_output_active_connection() wrongly tries to
      write to a field that doesn't exist:
        set_val_strc (arr, 13-idx_start, s_con ? nm_setting_connection_get_slave_type (s_con) : NULL);
    • Thomas Haller's avatar
      cli: sort active-connection for `nmcli connection show $PROFILE` output · b990cee0
      Thomas Haller authored
      There might be multiple active connections. Output them in a defined order.
    • Thomas Haller's avatar
      cli: rework printing of `nmcli connection` for multiple active connections · a1b25a47
      Thomas Haller authored
      The output of `nmcli connection show` contains also information about
      whether the profile is currently active, for example the device and
      the current (activation) state.
      Even when a profile can be activated only once (without supporting
      mutiple activations at the same time), there are moments when a
      connection is activating and still deactivating on another device.
      NetworkManager ensures in the case with single activations that
      a profile cannot be in state "activated" multiple times. But that
      doesn't mean, that one profile cannot have multiple active connection
      which reference it. That was already handled wrongly before, because
      `nmcli connection show` would only search the first matching
      active-connection. That is, it would arbitrarily pick an active
      connection in case there were multiple and only show activation
      state about one.
      Furthermore, we will soon also add the possibility, that a profile can be
      active multiple times (at the same time). Especially then, we need to
      extend the output format to show all the devices on which the profile is
      currently active.
      Rework printing the connection list to use nmc_print(), and fix various
      - as discussed, a profile may have multiple active connections at each time.
        There are only two possibilities: if a profile is active multiple
        times, show a line for each activation, or otherwise, show the
        information about multiple activations combined in one line, e.g. by
        printing "DEVICE eth0,eth1". This patch, does the former.
        We will now print a line for each active connection, to show
        all the devices and activation states in multiple lines.
        Yes, this may result in the same profile being printed multiple times.
        That is a change in behavior, and inconvenient if you do something
           for UUID in $(nmcli connection show | awk '{print$2}'); do ...
        However, above is anyway wrong because it assumes that there are no
        spaces in the connection name. The proper way to do this is like
           for UUID in $(nmcli -g UUID connection show); do ...
        In the latter case, whenever a user selects a subset of fields
        (--fields, --get) which don't print information about active connections,
        these multiple lines are combined. So, above still works as expected,
        never returning duplicate UUIDs.
      - if a user has no permissions to see a connection, we previously
        would print "<invisible> $NAME". No longer do this but just print
        the ID was it is reported by the active-connection. If the goal
        of this was to prevent users from accidentally access the non-existing
        connection by $NAME, then this was a bad solution, because a script
        would instead try to access "<invisible> $NAME". This is now solved
        better by hiding the active connection if the user selects "-g NAME".
      - the --order option now sorts according to how the fields are shown.
        For example, with --terse mode, it will evaluate type "802-11-wireless"
        but with pretty mode it will consider "wifi". This may change the
        ordering in which connections are shown. Also, for sorting the name,
        we use g_utf8_collate() because it's unicode.
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      clients/tests: add test for showing invisible connection in nmcli · 3645be64
      Thomas Haller authored
      It also shows how we handle invisible connections wrongly, when we have
      multiple active-connections that reference them.
    • Thomas Haller's avatar
  4. 31 May, 2018 2 commits
    • Thomas Haller's avatar
      build/meson: fix meson build for shared files · f445128a
      Thomas Haller authored
      The files in shared/nm-utils are not compiled as one static library,
      instead each subproject that needs (parts of) them, re-compiles the
      files individually.
      The major reason for that is, because we might have different compile
      flags, depending on whether we build libnm-core or
      libnm-util/libnm-glib. Actually, I think that is not really the case,
      and maybe this should be refactored, to indeed build them all as a
      static library first.
      Anyway, libnm-util, libnm-glib, clients' common lib, they all need a
      different set of shared files that they should compile. Refactor
      "shared/meson.build" to account for that and handle it like autotools
      Another change is, that "shared_c_siphash_dep" no longer advertises
      "include_directories: include_directories('c-siphash/src')". We don't
      put c-siphash.h into the include search path. Users who need it, should
      include it via "#include <c-siphash/src/c-siphash.h>". The only exception
      is when building shared_n_acd library, which is not under our control.
    • Thomas Haller's avatar
  5. 28 May, 2018 5 commits
    • Thomas Haller's avatar
      clients/tests: run nmcli commands in parallel · baaab522
      Thomas Haller authored
      Most nmcli calls from clients/tests don't change the server's state.
      Hence, they can easily run in parallel.
      Run tests in parallel. No longer handle one nmcli invocation after the other.
      Instead, spawn groups of processes in parallel, and track the pending jobs.
      Only at certain synchronization points we call self.async_wait() to
      wait for all previous jobs to complete.
      This reduces the test time on my machine from 7 to 3 seconds. Arguably,
      that matters less during a full `make check -j 8`, because the entire
      set of tests anyway takes longer than 7 seconds. So when running the
      entire test suite, the machine is kept busy anyway. It matters however
      for manual invocations.
    • Thomas Haller's avatar
      all: add stable-id specifier "${DEVICE}" · eb821ead
      Thomas Haller authored
      Add new stable-id specifier "${DEVICE}" to explicitly declare that the
      connection's identity differs per-device.
      Note that for settings like "ipv6.addr-gen-mode=stable" we already hash
      the interface's name. So, in combination with addr-gen-mode, using this
      specifier has no real use. But for example, we don't do that for
      Point being, in various context we possibly already include a per-device
      token into the generation algorithm. But that is not the case for all
      contexts and uses.
      Especially the DHCPv4 client identifier is supposed to differ between interfaces
      (according to RFC). We don't do that by default with "ipv4.dhcp-client-id=stable",
      but with "${DEVICE}" can can now be configured by the user.
      Note that the fact that the client-id is the same accross interfaces, is not a
      common problem, because profiles are usually restricted to one device via
    • Thomas Haller's avatar
      device: hash a per-host key for ipv4.dhcp-client-id=stable · d1a94a85
      Thomas Haller authored
      Otherwise, the generated client-id depends purely on the profile's
      stable-id. It means, the same profile (that is, either the same UUID
      or same stable-id) on different hosts will result in identical client-ids.
      That is clearly not desired. Hash a per-host secret-key as well.
      Note, that we don't hash the interface name. So, activating the
      profile on different interfaces, will still yield the same client-id.
      But also note, that commonly a profile is restricted to one device,
      via "connection.interface-name".
      Note that this is a change in behavior. However, "ipv4.dhcp-client-id=stable"
      was only added recently and not yet released.
      Fixes: 62a78639
    • Beniamino Galvani's avatar
      cli: fix property matching · 1f7780cb
      Beniamino Galvani authored
      @ret was not initialized when there was only one partial match.
      Also, refactor the code to return all matching values.
      Fixes: 3fd9bf9d
    • Thomas Haller's avatar
      clients/tests: refactor by moving replace-text helper function · 78e877ee
      Thomas Haller authored
      Have less logic in TestNmcli.
  6. 27 May, 2018 1 commit
    • Thomas Haller's avatar
      clients/tests: generate Makefile.am for expected files · ee85151a
      Thomas Haller authored
      The developer can re-generate .expected files with
       $ NM_TEST_REGENERATE=1 ./clients/tests/test-client.py
      Note that these files are also dist-ed, so that the tests also work
      from a source-tarball. For that, we need to add them to EXTRA_DIST.
      Previously, this was done manually in the base Makefile.am file. This
      was cumbersome, because when adding a new test, the developer would need
      to manually add the files.
      Now, let the test (with NM_TEST_REGENERATE=1) also generate a makefile
  7. 25 May, 2018 2 commits
  8. 24 May, 2018 8 commits
  9. 14 May, 2018 8 commits