Skip to content
  • Thomas Haller's avatar
    tests: use libnm via pygobject in tools/test-networkmanager-service.py · 9628aabc
    Thomas Haller authored
    tools/test-networkmanager-service.py is our NetworkManager stub server.
    
    NetworkManager uses libnm(-core) heavily, for example to decide whether
    a connection verifies (nm_connection_verify()) and for normalizing
    connections (nm_connection_normalize()).
    
    If the stub server wants to mimic NetworkManager, it also must use these
    function. Luckily, we already can do so, by loading libnm using python
    GObject introspection.
    
    We already correctly set GI_TYPELIB_PATH search path, so that the
    correct libnm is loaded -- provided that we build with introspection
    enabled.
    
    We still need to gracefully fail, if starting the stub server fails.
    That requries some extra effort. If the stub server notices that
    something is missing, it shall exit with status 77. That will cause
    the tests to g_test_skip().
    9628aabc