Files
ProxMenux/oci/tests/test_tor_install_summary.py
T
MacRimi fc41b04e87 Pre-release 1.2.7: OCI fixes, 12 new catalog applications and docs updates
Last changes before version 1.2.7.

OCI manager Apps
- Multi-container applications start while one of their containers is
  being backed up: the start hook waits until vzdump releases it and does
  not start it twice. The DHCP client of a dependency no longer keeps the
  lock of the hook, so later starts do not hang, and the watchdog waits
  while a dependency is locked. Installing or updating ProxMenux replaces
  the published copies of the hook already in place.
- Images built from scratch with a numeric user, such as ddns-updater,
  install: the container is created from a copy of the image that adds
  the /etc/passwd and /etc/group Proxmox VE needs, and the application
  runs with the user the image declares. The downloaded image stays
  unchanged. An image with a named user and no user database stops
  before anything is created, with a message that says why.

Catalog
- Twelve new applications: MDBListarr, CrossWatch, Free Games Claimer
  Remaster, Cloudreve, Poznote and AceStream HTTP Proxy, suggested in
  discussion #440, and the Dockur images of Chrony, Dnsmasq, Tor,
  Stunnel, strfry and Statping. The catalog lists 347 applications.
- Their prompts, labels and notes are translated into the seven
  languages of the menus.

Documentation
- OCI manager: architecture, lifecycle and stacks pages revised, with
  larger diagrams and new screenshots.
- Contributors: the page now thanks those developing, reviewing,
  translating and testing ProxMenux today and those who helped in its
  first steps, with new avatars.

Tests for the stack start hook, the watchdog, the user database check
of OCI images and the Tor installation summary.
2026-10-25 13:17:54 +01:00

40 lines
1.8 KiB
Python

"""Protocol-only services explain their addresses without inventing a web UI."""
import json
from pathlib import Path
import sys
import unittest
from unittest.mock import patch
ROOT=Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT/'src'))
from proxmenux_oci import i18n
from proxmenux_oci.cli import _print_installation_summary
class TorSummaryTests(unittest.TestCase):
def test_final_summary_explains_proxy_settings_in_spanish(self):
template=json.loads((ROOT/'catalog/curated/tor.json').read_text())
self.assertFalse(template['first_run']['endpoints'])
self.assertIsNone(template['catalog_ui']['launch']['port'])
notes=template['proxmox']['installer_profile']['completion_notes']
language_file=next(path for path in (ROOT.parent/'lang/es.json',ROOT.parent.parent/'lang/es.json')
if path.is_file())
translations=json.loads(language_file.read_text())
for note in notes:
self.assertIn(note,translations)
with patch.object(i18n,'language',return_value='es'), patch.object(i18n,'_cache',translations), \
patch('proxmenux_oci.cli.console') as console:
_print_installation_summary({
'vmid':129,'ip':'192.0.2.24','urls':[],
'service_addresses':['192.0.2.24:9050','192.0.2.24:8118'],
'completion_notes':notes})
shown=[call.args[0] for call in console.msg_note.call_args_list]
self.assertIn('Tor es un proxy, no una página web. No tiene interfaz web.',shown)
self.assertTrue(any('SOCKS5' in line and '9050' in line for line in shown))
self.assertTrue(any('HTTP CONNECT' in line and '8118' in line for line in shown))
self.assertTrue(any('Solo las aplicaciones configuradas' in line for line in shown))
if __name__=='__main__':
unittest.main()