After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699774 - testing: convert NetworkManager's main function to a configurable application object
testing: convert NetworkManager's main function to a configurable application...
Status: RESOLVED OBSOLETE
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-05-06 18:39 UTC by Pavel Simerda
Modified: 2020-11-12 14:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pavel Simerda 2013-05-06 18:39:51 UTC
NetworkManager's main function cannot be used by testing binaries. The actual main function should be as simple as possible:

1) Create an application object
2) Configure the application object (possibly passing argv to its method)
3) Initialize the application object
4) Run the application object

That way you can create another binary as part of a testsuite that would replace (or amend) #2 with specific configuration. Also, between #3 and #4, you could access the object members to get to other NetworkManager components and install your own hooks (signal handlers) to check whether everything works as expected by the testsuite.
Comment 1 Dan Winship 2013-05-07 13:10:30 UTC
danw/norecurse (work-in-progress, part of bug 699504) builds everything except main.c as libNetworkManager.la, which the tests then link against. That's probably a good base for this.
Comment 2 Thomas Haller 2015-05-14 11:52:27 UTC
I don't think we need this anymore.

NM consists or a large number of singleton instances (NMPlatform, NMManager, NMPolicy, etc.)

Some of these are actually tested in unit-tests (NMPlatform, NMConfig, NMRouteManager). Many are not.

Sure, we should try to improve our unit tests. But IMO we don't need a more hook-able main() function.


Vote for closing this one.
Comment 3 André Klapper 2020-11-12 14:29:05 UTC
bugzilla.gnome.org is being shut down in favor of a GitLab instance. 
We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time.

If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/

Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).