From add3113b8b01b2e7c45a978b0679f06a154de5de Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Sun, 18 Jun 2023 15:07:58 +0000 Subject: [PATCH] [KERNEL][TEST] Initialize tup if it is not. git-svn-id: svn://kolibrios.org@9922 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/runtests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/trunk/runtests.py b/kernel/trunk/runtests.py index c1adac54db..58bee49fae 100755 --- a/kernel/trunk/runtests.py +++ b/kernel/trunk/runtests.py @@ -13,6 +13,7 @@ import subprocess from threading import Thread import filecmp import traceback +import shlex sys.path.append('test') import common @@ -24,6 +25,11 @@ def log(s, end="\n"): print(s, end=end, flush=True) +def check_retcode(command): + popen = subprocess.Popen(shlex.split(command)) + return popen.wait() + + def execute(s, mute=False): mute = ">/dev/null" if mute else "" code = os.system(f"{s}{mute}") @@ -115,6 +121,8 @@ def prepare_test_img(): # Get test kernel if not os.path.exists("kernel.mnt.pretest"): if len(sys.argv) == 1: + if check_retcode("tup dbconfig") != 0: + execute("tup init") execute("tup kernel.mnt.pretest") else: builds_eng = sys.argv[1]