forked from KolibriOS/kolibrios
[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:
parent
21392e4c9b
commit
add3113b8b
@ -13,6 +13,7 @@ import subprocess
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
import filecmp
|
import filecmp
|
||||||
import traceback
|
import traceback
|
||||||
|
import shlex
|
||||||
|
|
||||||
sys.path.append('test')
|
sys.path.append('test')
|
||||||
import common
|
import common
|
||||||
@ -24,6 +25,11 @@ def log(s, end="\n"):
|
|||||||
print(s, end=end, flush=True)
|
print(s, end=end, flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def check_retcode(command):
|
||||||
|
popen = subprocess.Popen(shlex.split(command))
|
||||||
|
return popen.wait()
|
||||||
|
|
||||||
|
|
||||||
def execute(s, mute=False):
|
def execute(s, mute=False):
|
||||||
mute = ">/dev/null" if mute else ""
|
mute = ">/dev/null" if mute else ""
|
||||||
code = os.system(f"{s}{mute}")
|
code = os.system(f"{s}{mute}")
|
||||||
@ -115,6 +121,8 @@ def prepare_test_img():
|
|||||||
# Get test kernel
|
# Get test kernel
|
||||||
if not os.path.exists("kernel.mnt.pretest"):
|
if not os.path.exists("kernel.mnt.pretest"):
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
|
if check_retcode("tup dbconfig") != 0:
|
||||||
|
execute("tup init")
|
||||||
execute("tup kernel.mnt.pretest")
|
execute("tup kernel.mnt.pretest")
|
||||||
else:
|
else:
|
||||||
builds_eng = sys.argv[1]
|
builds_eng = sys.argv[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user