fix: the root CA is created by the server, an offline CA or a Simple CA service, chosen at setup; the shell can stay open in a tab of its own, the Docker page is offered only with Docker, and the test scripts are in bin/.
Release / release (push) Failing after 14m20s

This commit is contained in:
slawek committed 2026-11-23 06:45:23 +01:00
1 parent ff0c93ed73
commit a649331aa2
49 files changed
+1597 -637

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
"""What the lm-dev scripts share: the repository's paths, lxc exec in an instance, and the .env of the repository."""
import pathlib
import subprocess
ROOT = pathlib.Path(__file__).resolve().parent.parent
# The test data: scenarios, configurations, cloud-init files, the repository's script and the files copied in.
TESTS = ROOT / 'tests' / 'remote'
# The project of the manual tests, which lm-dev-lxd-project.py makes.
PROJECT = 'lm-dev'
def lxc_exec(remote, project, instance, *command, input=None):
"""Run the command in the instance as root with the input, and return its CompletedProcess."""
return subprocess.run(['lxc', 'exec', f'{remote}:{instance}', '--project', project, '-T', '--', *command],
input=input, capture_output=True, text=True)
def set_dotenv(values):
"""Set the variables in the repository's .env, readable by its owner only, keeping its other lines."""
dotenv = ROOT / '.env'
lines = dotenv.read_text(encoding='utf-8').splitlines() if dotenv.is_file() else []
kept = [line for line in lines if line.split('=', 1)[0] not in values]
dotenv.touch(mode=0o600)
dotenv.chmod(0o600)
dotenv.write_text(''.join(f'{line}\n' for line in kept + [f'{key}={value}' for key, value in values.items()]),
encoding='utf-8')