ble-reticulum/tests
torlando-tech 00bad9c706 refactor: make install.sh fully self-contained
Major architectural improvement: install.sh now handles all prerequisites,
eliminating duplicate logic and making CI test exactly what users run.

## Changes to install.sh:

**1. Added pip_install() helper function (lines 37-49)**
- Detects pip version capabilities
- Uses --break-system-packages flag on pip 23.0+ (Debian 12+, Ubuntu 24.04+)
- Falls back to no flag on pip 22.x (Ubuntu 22.04)
- Single source of truth for all pip operations
- Fixes compatibility across all OS versions

**2. Added basic system package installation (lines 91-128)**
- Checks and installs: python3, python3-pip, git, sudo
- Supports both Debian/Ubuntu (apt-get) and Arch (pacman)
- Only installs missing packages (idempotent)

**3. Changed Reticulum check to auto-install (lines 171-190)**
- Previously: exited with error if Reticulum not found
- Now: automatically installs Reticulum using pip_install()
- Verifies installation succeeded
- Falls back to manual instructions if auto-install fails

**4. Updated all pip install commands to use helper (lines 242, 251)**
- Consistent --break-system-packages handling
- Works on Ubuntu 22.04, Debian 12, Trixie, Ubuntu 24.04

**5. Updated header comment**
- Reflects that script is now self-contained
- Documents all responsibilities

## Changes to tests/test_installer.sh:

**Simplified from 127 lines to 126 lines, but more importantly:**

**Removed (no longer needed):**
- Manual apt-get install of base packages
- Manual pip install of Reticulum
- Duplicate pip compatibility logic

**Kept:**
- Non-interactive environment setup
- Verification tests
- BLE interface import test

**Added:**
- Reticulum verification check
- Updated summary to reflect self-contained nature

## Benefits:

1.  **Single source of truth** - No duplicate pip logic
2.  **CI tests real workflow** - Exactly what users run
3.  **Better user experience** - One command does everything
4.  **Cross-version compatibility** - Works on all OS/pip versions
5.  **Easier maintenance** - Changes in one place
6.  **Self-contained** - install.sh has zero external dependencies

## Testing:

Works across all CI matrix OS versions:
- Ubuntu 22.04 (pip 22.0.2 - no --break-system-packages)
- Debian 12 (pip 23.0+ - requires --break-system-packages)
- Debian Trixie (pip 23.0+ - requires --break-system-packages)
- Ubuntu 24.04 (pip 24.0+ - supports --break-system-packages)

Fixes #4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 20:27:34 -04:00
..
conftest.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_ble_peer_interface.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_bleak_threading_hang.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_bleak_with_exec_loading.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_config_directory.py fix: support custom config directories via RNS.Reticulum.configdir 2025-10-28 19:09:48 -04:00
test_error_recovery.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_fragmentation.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_gatt_server.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_installer.sh refactor: make install.sh fully self-contained 2025-10-28 20:27:34 -04:00
test_integration.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_multi_device_simulation.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00
test_prioritization.py Initial commit: BLE Reticulum interface 2025-10-26 19:14:14 -04:00