Skip to content

Commit

Permalink
tests: Update machines_install script with new repo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
KKoukiou committed Nov 1, 2023
1 parent 44b128b commit e0ef5e4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/machine_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
import time
import tempfile

ANACONDA_ROOT_DIR = os.path.normpath(os.path.dirname(__file__)+'/../../..')
WEBUI_DIR = f'{ANACONDA_ROOT_DIR}/ui/webui'
WEBUI_TEST_DIR = f'{WEBUI_DIR}/test'
BOTS_DIR = f'{WEBUI_DIR}/bots'
WEBUI_TEST_DIR = os.path.dirname(__file__)
ROOT_DIR = os.path.dirname(WEBUI_TEST_DIR)
BOTS_DIR = f'{ROOT_DIR}/bots'

# pylint: disable=environment-modify
sys.path.append(BOTS_DIR)
Expand Down Expand Up @@ -74,7 +73,7 @@ def _wait_http_server_running(self, port):

def _serve_updates_img(self):
http_updates_img_port = self._get_free_port()
self.http_updates_img_server = subprocess.Popen(["python3", "-m", "http.server", "-d", ANACONDA_ROOT_DIR, str(http_updates_img_port)])
self.http_updates_img_server = subprocess.Popen(["python3", "-m", "http.server", "-d", ROOT_DIR, str(http_updates_img_port)])
self._wait_http_server_running(http_updates_img_port)

return http_updates_img_port
Expand All @@ -94,15 +93,15 @@ def _get_payload_ks_path(self, payload_cached_name, http_payload_port):
payload_ks_fd, payload_ks_path = tempfile.mkstemp(
suffix='.cfg',
prefix=f"ks-{self.label}",
dir=os.path.join(ANACONDA_ROOT_DIR, "./ui/webui/test")
dir=WEBUI_TEST_DIR
)
with os.fdopen(payload_ks_fd, 'w') as f:
f.write(f'liveimg --url="http://10.0.2.2:{http_payload_port}/{payload_cached_name}"')

return payload_ks_path

def start(self):
update_img_file = os.path.join(ANACONDA_ROOT_DIR, "updates.img")
update_img_file = os.path.join(ROOT_DIR, "updates.img")
if not os.path.exists(update_img_file):
raise FileNotFoundError("Missing updates.img file")

Expand Down

0 comments on commit e0ef5e4

Please sign in to comment.