[KERNEL][TEST] Initialize tup if it is not.

git-svn-id: svn://kolibrios.org@9922 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Magomed Kostoev (mkostoevr) 2023-06-18 15:07:58 +00:00
parent 21392e4c9b
commit add3113b8b

View File

@ -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]