From 23199f5526db9be1d43a900dc8b8674a7babb966 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 5 Dec 2026 22:09:29 +0100 Subject: WIP Somewhat blocked by https://bugzilla.redhat.com/show_bug.cgi?id=2521543 --- workstation/test.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 workstation/test.py (limited to 'workstation/test.py') diff --git a/workstation/test.py b/workstation/test.py new file mode 100755 index 00000000..92aeb0c7 --- /dev/null +++ b/workstation/test.py @@ -0,0 +1,41 @@ +#!/usr/bin/python3 +import os +import pathlib +import subprocess + + +INSTANCE_NAME="workstation-test" +USER="alex" + +THIS_REPO = pathlib.Path(__file__).parent.parent +THIS_UID = os.getuid() + + +def _(*args, check=True, input=None): + return subprocess.run(args, check=check, input=input, text=True) + + +# _("incus", "launch", +# "images:debian/13", +# INSTANCE_NAME, +# "--ephemeral", +# "--vm", +# "-c", "limits.cpu=4", +# "-c", "limits.memory=6GiB", +# "-d", "root,size=50GiB") + +# while _("incus", "exec", INSTANCE_NAME, "uptime", check=False).returncode != 0: +# print("waiting...") +# time.sleep(1) + +# _("incus", "config", "device", "add", INSTANCE_NAME, "here", "disk", f"source={THIS_REPO}", "path=/here") +# _("incus", "exec", INSTANCE_NAME, "--", "apt", "full-upgrade", "-U") +# _("incus", "exec", INSTANCE_NAME, "--", "apt", "install", "-y", "python3") +# _("incus", "exec", INSTANCE_NAME, "--", "/here/workstation/root-setup.py") +# _("incus", "exec", INSTANCE_NAME, "--", "adduser", USER, "--disabled-password", "--comment", "") +# _("incus", "exec", INSTANCE_NAME, "--", "passwd", USER, "--stdin", input=USER) + +# Comment out to test with real repo +_("incus", "exec", INSTANCE_NAME, "--", "mount", "/here/", f"/home/{USER}/git/alexpdp7/", "-o", f"bind,X-mount.idmap={THIS_UID}:1000:1") + +_("incus", "exec", INSTANCE_NAME, "--", "sudo", "-u", USER, "/here/workstation/user-setup.py") -- cgit v1.2.3