From mboxrd@z Thu Jan 1 00:00:00 1970 From: Etienne Carriere Date: Tue, 19 Mar 2019 00:21:08 +0100 Subject: [Buildroot] [PATCH v2 7/8] testing: test can use the locally generated qemu host tool In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Message-ID: <1552951269-16967-7-git-send-email-etienne.carriere@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net This change adds argument local to emulator boot method. When local is True, emulator.py runs the qemu host tool locally generated by the test. Otherwise the test uses the qemu host as found from PATH. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - No commit not in v1 series. --- support/testing/infra/emulator.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py index 802e89d..5fbf213 100644 --- a/support/testing/infra/emulator.py +++ b/support/testing/infra/emulator.py @@ -1,5 +1,7 @@ import pexpect +import os + import infra @@ -8,6 +10,7 @@ class Emulator(object): def __init__(self, builddir, downloaddir, logtofile, timeout_multiplier): self.qemu = None self.downloaddir = downloaddir + self.builddir = builddir self.logfile = infra.open_log_file(builddir, "run", logtofile) # We use elastic runners on the cloud to runs our tests. Those runners # can take a long time to run the emulator. Use a timeout multiplier @@ -30,13 +33,22 @@ class Emulator(object): # # options: array of command line options to pass to Qemu # - def boot(self, arch, kernel=None, kernel_cmdline=None, options=None): + # local: if True, the locally built qemu host tool is used instead of a + # qemu host tool found from the PATH. + # + def boot(self, arch, kernel=None, kernel_cmdline=None, options=None, + local=None): if arch in ["armv7", "armv5"]: qemu_arch = "arm" else: qemu_arch = arch - qemu_cmd = ["qemu-system-{}".format(qemu_arch), + if local: + basedir = os.path.join(self.builddir, "host/bin/") + else: + basedir = "" + + qemu_cmd = [basedir + "qemu-system-{}".format(qemu_arch), "-serial", "stdio", "-display", "none"] -- 1.9.1