Files
gpu-rent/tests/test_bootstrap.py
T
Leonid Pershin dd0ffbf69b Refactor bootstrap script for SwarmUI management and enhance error handling
- Introduced functions `swarm_git_ok`, `clone_swarmui`, and `update_swarmui` to streamline the cloning and updating process of SwarmUI.
- Improved error handling during the update process, ensuring a fallback to cloning if the update fails.
- Enhanced logging messages for better visibility during cloning and updating operations.
- Updated tests to verify the presence of new functions and logging messages in the bootstrap script.
2026-08-21 10:27:25 +03:00

28 lines
1.2 KiB
Python

from gpu_rent.bootstrap import bootstrap_script
def test_bootstrap_script_is_native_swarmui():
script = bootstrap_script()
assert "docker.io" not in script
assert "docker run" not in script
assert "nvidia-container" not in script
assert "/opt/swarmui" in script
assert "/mnt/swarm_data" in script
assert "launch-linux.sh --launch_mode none --host 127.0.0.1 --port 7801" in script
assert "systemctl enable swarmui" in script
assert "systemctl restart swarmui" not in script
assert "Data/Autocompletions" in script
assert "mkfs.ext4" in script
assert "apt-get upgrade" not in script
assert "GPU_RENT_BOOTSTRAP_LIGHT" in script
assert "GPU_RENT_SKIP_SWARMUI" in script
assert "light bootstrap — пропускаем apt-get" in script
# llm-only re-up can skip apt when data marker exists (not only Swarm boot marker)
assert 'MARKER_DATA' in script or ".gpu-rent-ready" in script
# .NET: chown before Swarm install script; curl fallback if wget/perms fail
assert "install_dotnet_via_curl" in script
assert "chown -R" in script
assert "wget" in script
assert "swarm_git_ok" in script
assert "переклонирую" in script or "перед clone" in script