fix: recon env-check verifies runtime wlan0mon hopping (2.4GHz starvation)

The band UCI config looked correct but pineapd was not hopping wlan0mon at
runtime, so 2.4GHz recon results were entirely absent. env_check now parses
_pineap INTERFACE LIST and warns when wlan0mon hop is off; /api/recon/status
exposes wlan0_hopping and the recon scan bar surfaces it.
This commit is contained in:
2026-08-19 10:29:50 -05:00
parent 904843307e
commit 5eb81b90f1
3 changed files with 75 additions and 2 deletions
+26
View File
@@ -30,6 +30,10 @@ class EnvCheckTest(unittest.TestCase):
self.daemon_ok = True
self.iface_up = {'wlan0mon': True, 'wlan1mon': True}
self.uci_state = {}
self.interface_list = (
'Interface #ch Bands Type Hop Chan Pkts \n'
'wlan1mon 25 5 max fast hop 21567\n'
'wlan0mon 11 2 max fast hop 452\n')
server.ENV_CHECK_STATE.update({'report': None, 'overall': None, 'updated': 0,
'pool_runtime': None})
self.old_iface_up = server._iface_up
@@ -77,6 +81,8 @@ class EnvCheckTest(unittest.TestCase):
return (0, ''.join("%s=%s\n" % (k, v) for k, v in self.uci_state.items()
if k.startswith(sec + '.')), '')
if a[0] == '_pineap':
if len(a) > 1 and a[1] == 'INTERFACE':
return (0, self.interface_list, '')
return (0, '', '')
if a[0] in ('ip', '/etc/init.d/pineapd'):
return (0, '', '')
@@ -191,6 +197,26 @@ class EnvCheckTest(unittest.TestCase):
report = server.env_check()
self.assertEqual(self.steps(report, 'no radio0 AP pins wlan0mon')[0]['ok'], 'pass')
def test_wlan0_starved_warns(self):
self.safe_set()
self.interface_list = (
'Interface #ch Bands Type Hop Chan Pkts \n'
'wlan1mon 25 5 max fast hop 21567\n'
'wlan0mon 11 2 max 0 hop 452\n')
report = server.env_check()
self.assertEqual(self.steps(report, 'wlan0mon hopping is off')[0]['ok'], 'warn')
def test_wlan0_hopping_unknown_warns(self):
self.safe_set()
self.interface_list = ''
report = server.env_check()
self.assertEqual(self.steps(report, 'could not read pineapd interface state')[0]['ok'], 'warn')
def test_wlan0_hopping_pass(self):
self.safe_set()
report = server.env_check()
self.assertEqual(self.steps(report, 'wlan0mon hopping on')[0]['ok'], 'pass')
def test_cli_exits_zero_on_pass(self):
self.safe_set()
buf = io.StringIO()