From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7008446828784910336 X-Received: by 2002:a17:906:27cf:: with SMTP id k15mr13959154ejc.123.1631898087465; Fri, 17 Sep 2021 10:01:27 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:254d:: with SMTP id l13ls2062643edb.3.gmail; Fri, 17 Sep 2021 10:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXLnsqTrOPS1WkySfNZt4gj0I4xlLhFCEJ89njpc7v3d2klgpxI3m2OdHvCGyOAiTHsZJs X-Received: by 2002:a05:6402:694:: with SMTP id f20mr13583256edy.100.1631898086627; Fri, 17 Sep 2021 10:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631898086; cv=none; d=google.com; s=arc-20160816; b=tLu55A5QdN5lsXLbrKh4Ke2xN7768FiTo0jRPzRE+rzHV5TDe33yRNy3pOZNucc/pg HQah5cSVsqQLCHsULpYNf+acVa6GyV8QDY+5PGZaob2JwEhtK78kLolB74yv8xz5oQ6J 7v/YBgAPNQkNUi8ZnyjmBcCLAaS6M0iR5HjjZ0hl0K0V1eqQY/I7w0TIcqB63acrw8oP RTQ2Z2yTgPGBJfiWr3ZqdVgtk5RbfIvqOXY0mO8fDS0U11CjeOwRix52NPn3vtNnDiAH cvJhWoUT7DJMSjcnfpW0r/EbRMhTiwj6PQt3XVx0a7mCWsKrCZLONgCIihfb4X34XJE7 0hxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=hkupKdrmtQ9IWeVgZXe6dqG1TTNAk849zcrBjqEKw8M=; b=G9pyVGJe5RSkAcgRkHrFJyOUZHG4m6od+RR8VaXevio3yX9XXqDur7ibB+QqX7ovga x9zKby9djmfJke4bmll5/0Klem4aay1ipvhTR/UdtoxZQQgOa6KFsf5982yufRdx0HMH rKQUAKu0RXVSpCVGe1P45yHl95o2N0JWDj8KF8zxTC2AXPtR96jaU9SyDe3w2cBpTbfA JqYF9m13ZOhg3z0YgPqBLhcPtHqjiCMrjGV1vZLe3Mz46xHMsq+e9pOjEXHC8wGeIw/c pKF0nZsL9n5YRPC0ibu84UncE8alhriDb0OvNS/pTQAcvSQMowZ4mrmHdlYEUGp+wAcw PXhw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id v9si645522edl.0.2021.09.17.10.01.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Sep 2021 10:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from localhost.localdomain (mm-240-58-214-37.mgts.dynamic.pppoe.byfly.by [37.214.58.240] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 18HH0iNB028039 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Sep 2021 19:01:24 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v12 13/16] vm_boot_test: Add automatic bitbake init Date: Fri, 17 Sep 2021 20:00:30 +0300 Message-Id: <20210917170033.74797-14-amikan@ilbers.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210917170033.74797-1-amikan@ilbers.de> References: <20210917170033.74797-1-amikan@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: 2os5pPIOb9gq Implement source of isar-init-build-env in case there is no bitbake command found. Signed-off-by: Anton Mikanovich --- testsuite/vm_boot_test/vm_boot_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/testsuite/vm_boot_test/vm_boot_test.py b/testsuite/vm_boot_test/vm_boot_test.py index 6e580d0..01623c5 100644 --- a/testsuite/vm_boot_test/vm_boot_test.py +++ b/testsuite/vm_boot_test/vm_boot_test.py @@ -13,12 +13,25 @@ sys.path.append(dirname(__file__) + '/..') import start_vm from avocado import Test +from avocado.utils import process +from avocado.utils import path class CanBeFinished(Exception): pass class VmBase(Test): + def check_bitbake(self, build_dir): + try: + path.find_command('bitbake') + except path.CmdNotFoundError: + out = process.getoutput('/bin/bash -c "cd ../.. && \ + source isar-init-build-env \ + %s 2>&1 >/dev/null; env"' % build_dir) + env = dict(((x.split('=', 1) + [''])[:2] \ + for x in output.splitlines() if x != '')) + os.environ.update(env) + def vm_start(self, arch='amd64', distro='buster'): build_dir = self.params.get('build_dir', default='.') time_to_wait = self.params.get('time_to_wait', default=60) @@ -28,6 +41,8 @@ class VmBase(Test): self.log.info('Isar build folder is: ' + build_dir) self.log.info('===================================================') + self.check_bitbake(build_dir) + fd, output_file = tempfile.mkstemp(suffix='_log.txt', prefix='vm_start_' + distro + '_' + arch + '_', dir=build_dir, text=True) -- 2.25.1