feat(hub): add three image acquisition sources (official repo, custom repo, manual provided)
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m54s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m54s
This commit is contained in:
+19
-7
@@ -227,14 +227,25 @@ class TestUpdateSystem(unittest.TestCase):
|
||||
self.assertFalse(chk2["update_available"])
|
||||
self.assertIn("disabled", chk2.get("reason", ""))
|
||||
|
||||
# 3. Toggle back ON with 'auto' mode
|
||||
cfg_req2 = ServerUpdateConfigRequest(auto_update_enabled=True, update_mode="auto")
|
||||
# 3. Toggle back ON with 'official' mode
|
||||
cfg_req2 = ServerUpdateConfigRequest(auto_update_enabled=True, update_mode="official")
|
||||
res2 = Server.update_server_update_config(req=cfg_req2, auth_user="admin")
|
||||
self.assertEqual(res2["status"], "success")
|
||||
self.assertTrue(self.update_mgr.auto_update_enabled)
|
||||
self.assertEqual(self.update_mgr.update_mode, "auto")
|
||||
self.assertEqual(self.update_mgr.update_mode, "official")
|
||||
|
||||
# 4. Verify WebUI renders without download buttons in packages table
|
||||
# 4. Configure 'custom' mode with custom upstream URL
|
||||
cfg_req3 = ServerUpdateConfigRequest(
|
||||
auto_update_enabled=True,
|
||||
update_mode="custom",
|
||||
upstream_url="https://git.corp.local/api/v1/releases/latest"
|
||||
)
|
||||
res3 = Server.update_server_update_config(req=cfg_req3, auth_user="admin")
|
||||
self.assertEqual(res3["status"], "success")
|
||||
self.assertEqual(self.update_mgr.update_mode, "custom")
|
||||
self.assertEqual(self.update_mgr.upstream_url, "https://git.corp.local/api/v1/releases/latest")
|
||||
|
||||
# 5. Verify WebUI renders official, custom, manual mode switches and no download buttons
|
||||
html = Server.WebUIRenderer.render_dashboard_html(
|
||||
server_state=Server.SERVER_STATE,
|
||||
ingest_queue=Server.INGEST_QUEUE
|
||||
@@ -242,9 +253,10 @@ class TestUpdateSystem(unittest.TestCase):
|
||||
self.assertNotIn("/api/client/update/download?os=windows", html)
|
||||
self.assertNotIn("/api/client/update/download?os=linux", html)
|
||||
self.assertIn("Fleet Auto-Update Service", html)
|
||||
self.assertIn("Image Acquisition & Hosting Mode", html)
|
||||
self.assertIn("autoUpdateEnabledRadio", html)
|
||||
self.assertIn("updateModeRadio", html)
|
||||
self.assertIn("Image Acquisition Source & Hosting Mode", html)
|
||||
self.assertIn("modeOfficial", html)
|
||||
self.assertIn("modeCustom", html)
|
||||
self.assertIn("modeManual", html)
|
||||
self.assertIn("Ready", html)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user