Files
gpu-rent/tests/test_user_data.py
T
Leonid Pershin 1f7237f7db Implement SSH user data handling and adjust volume size
- Added functions to generate SSH user data in cloud-config format and encode it in Base64 for server creation.
- Updated the `create_gpu_server` function to include public key handling for SSH access.
- Adjusted the default boot volume size from 40GB to 30GB in `os_client.py`.
- Enhanced the `cmd_up` function to manage SSH key injection and server state more effectively.
- Improved logging for SSH connection attempts and error handling in `wait_ssh` to provide clearer feedback on authentication issues.
2026-08-21 04:35:02 +03:00

13 lines
405 B
Python

import base64
from gpu_rent.cloud import _ssh_user_data, _user_data_b64
def test_user_data_b64_is_selectel_cloud_config():
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFakeKeyMaterialHere gpu-rent"
plain = _ssh_user_data(key)
assert plain.startswith("#cloud-config")
assert key in plain
raw = base64.b64decode(_user_data_b64(key))
assert raw.decode("utf-8") == plain