fix(platina): resolve touchscreen, dual panel, charging reboot, battery guard, camera auth, and internal SIM cellular data
- Add patch 0040: cut panel VSP/VSN always-on rails, attach panel follower to Synaptics TCM touch, add Novatek NT36672A touch node, add BOE panel DTS, and extend DVFS up to 1.84/2.2 GHz. - Prevent Qualcomm ABL infinite reboot loop on poweroff while charger connected via standby detection in phone-poweroff.py. - Implement HTTP Basic Auth in camera web preview server with secure digest verification. - Add battery guard daemon and unit tests to maintain SoC between 50% and 65%. - Implement Option 2 for cellular data: disable ZRAM swap to prevent Hexagon DMA fragmentation crash, add modem modules to initfs, enable ModemManager/NetworkManager WWAN packages and services, and add phone-cellular-setup.py CLI utility with unit tests. - Update recipe checksums and verify 109 unit tests and public index boundaries.
This commit is contained in:
@@ -69,6 +69,33 @@ class ControlTests(unittest.TestCase):
|
||||
with self.assertRaises(HTTPError) as error:
|
||||
self.get(endpoint)
|
||||
self.assertEqual(error.exception.code, 503)
|
||||
|
||||
def test_authentication_enforced_when_configured(self):
|
||||
auth = {'username': 'testuser', 'password': 'secretpassword'}
|
||||
stop = threading.Event()
|
||||
server = ThreadingHTTPServer(('127.0.0.1', 0), serve.make_handler(self.camera, stop, self.audio, auth=auth))
|
||||
server.daemon_threads = True
|
||||
thread = threading.Thread(target=server.serve_forever, daemon=True)
|
||||
thread.start()
|
||||
base = 'http://127.0.0.1:' + str(server.server_port)
|
||||
try:
|
||||
with self.assertRaises(HTTPError) as err:
|
||||
urlopen(base + '/status', timeout=3)
|
||||
self.assertEqual(err.exception.code, 401)
|
||||
self.assertIn('Basic', err.exception.headers.get('WWW-Authenticate', ''))
|
||||
|
||||
import base64
|
||||
token = base64.b64encode(b'testuser:secretpassword').decode()
|
||||
req = Request(base + '/status', headers={'Authorization': 'Basic ' + token})
|
||||
with urlopen(req, timeout=3) as resp:
|
||||
self.assertEqual(resp.status, 200)
|
||||
data = json.load(resp)
|
||||
self.assertEqual(data['state'], 'off')
|
||||
finally:
|
||||
stop.set()
|
||||
server.shutdown()
|
||||
server.server_close()
|
||||
thread.join()
|
||||
self.assertIsNone(self.camera.capture)
|
||||
|
||||
def test_settings_off_persist_but_capture_does_not(self):
|
||||
|
||||
Reference in New Issue
Block a user