Bug 506217

Summary: plasma-nm: MobileProvidersTest fails with latest upstream mobile-broadband-provider-info 20250613
Product: [Plasma] plasmashell Reporter: Rik Mills <rikmills>
Component: Networking in generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: nate, nicolas.fella
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: 1.0   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Rik Mills 2025-06-26 14:01:22 UTC
In a test build of plasma-nm against the latest upstream mobile-broadband-provider-info 20250613, plasma-nm FTBFS due to a failing MobileProvidersTest

https://invent.kde.org/plasma/plasma-nm/-/blob/master/tests/mobileproviderstest.cpp?ref_type=heads#L42

Might be related to https://gitlab.gnome.org/GNOME/mobile-broadband-provider-info/-/merge_requests/127 

5/5 Test #5: mobileproviderstest ..............***Failed    0.20 sec
********* Start testing of MobileProvidersTest *********
Config: Using QtTest library 6.8.3, Qt 6.8.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.0), ubuntu 25.10
PASS   : MobileProvidersTest::initTestCase()
PASS   : MobileProvidersTest::testProviders()
PASS   : MobileProvidersTest::testProviderFromMccMnc(Aldi 1)
FAIL!  : MobileProvidersTest::testProviderFromMccMnc(Aldi 2) Compared lists have different sizes.
   Actual   (providers.getProvidersFromMCCMNC(mccmnc)) size: 5
   Expected (providerNames) size: 4
   Loc: [./tests/mobileproviderstest.cpp(42)]
PASS   : MobileProvidersTest::testProviderFromMccMnc(Vodafone CZ)
PASS   : MobileProvidersTest::testProviderFromMccMnc(1&1)
PASS   : MobileProvidersTest::cleanupTestCase()
Totals: 6 passed, 1 failed, 0 skipped, 0 blacklisted, 155ms
Comment 1 Rik Mills 2025-06-26 14:24:24 UTC
Or more likely a result of: https://gitlab.gnome.org/GNOME/mobile-broadband-provider-info/-/commit/a298b8266b52fe9f4322b1751d7dfc51a282b892

which adds another provider with mcc mnc 0f 262 03
Comment 2 Nate Graham 2025-06-26 17:13:00 UTC
I imagine we don't just need to change the test; probably some code or providers file needs adjusting as well?

Feels very weird that this test depends on the content of a file under someone else's control TBH.
Comment 3 Rik Mills 2025-06-27 06:09:03 UTC
(In reply to Nate Graham from comment #2)
> I imagine we don't just need to change the test; probably some code or
> providers file needs adjusting as well?
> 
> Feels very weird that this test depends on the content of a file under
> someone else's control TBH.

Assuming the test is parsing the first matching code in the uptream providers data file (which would now not match what the test expects), then yes the code AND the test would presumably need to be adjusted to take account of cases where that might happen. That is assuming that duplicate Mcc/Mnc codes are legitimate in the data due to MVNO (https://en.wikipedia.org/wiki/Mobile_virtual_network_operator), which is beyond my knowledge.

I don't think it is really odd that the test depends on the external data, as the whole point is to see whether KDE's approach to using that data is working ok or not. If that data changes content or formatting our code may no longer be adequate to parse/use it. Which is why a test  is useful.