fix: health monitor disables SSID pool immediately on PING failure

Ring-buffer SIGSEGV counts were unreliable for growth detection; the pool
broadcast is the only known crash cause, so disable it on first failure.
This commit is contained in:
2026-08-18 19:32:49 -05:00
parent 2ff0c4d320
commit a4285496fb
2 changed files with 20 additions and 11 deletions
+10 -3
View File
@@ -49,15 +49,22 @@ class HealthCheckTest(unittest.TestCase):
def test_down_with_growing_sigsegv_disables_pool(self):
self.ping_ok = False
self.sigsegs = 5
server._health['sigsegv_last'] = 3
result = server.health_check()
self.assertIn('pool-disabled', result['last_action'])
self.assertIn('pool broadcast disabled', result['last_action'])
self.assertEqual(self.uci_state['pineapd.@ssidpool[0].disable'], '1')
self.assertIn(['/etc/init.d/pineapd', 'restart'], [r[0] for r in self.runs])
self.assertEqual(result['fixes'], 1)
def test_down_with_pool_already_disabled_restarts_pineapd(self):
self.ping_ok = False
self.uci_state['pineapd.@ssidpool[0].disable'] = '1'
result = server.health_check()
self.assertEqual(result['last_action'], 'pineapd restart')
self.assertIn(['/etc/init.d/pineapd', 'restart'], [r[0] for r in self.runs])
def test_down_without_crash_brings_monitor_up(self):
self.ping_ok = False
self.uci_state['pineapd.@ssidpool[0].disable'] = '1'
self.iw_out = 'wlan0mon\n'
result = server.health_check()
self.assertEqual(result['last_action'], 'wlan1mon brought up')
@@ -67,7 +74,7 @@ class HealthCheckTest(unittest.TestCase):
self.ping_ok = False
server._health['sigsegv_last'] = 4
result = server.health_check()
self.assertEqual(result['last_action'], 'pineapd restart')
self.assertIn('pineapd restart', result['last_action'])
self.assertIn(['/etc/init.d/pineapd', 'restart'], [r[0] for r in self.runs])
def test_fix_cooldown_prevents_thrash(self):