From patchwork Wed Mar 6 10:11:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1052231 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="W5UdT02I"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44DqLb4qcMz9s70 for ; Wed, 6 Mar 2019 21:12:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5299B84E1C; Wed, 6 Mar 2019 10:12:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id In7v40d24Pv6; Wed, 6 Mar 2019 10:12:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5FED68499E; Wed, 6 Mar 2019 10:12:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 030601BF2CD for ; Wed, 6 Mar 2019 10:11:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EFF51226CF for ; Wed, 6 Mar 2019 10:11:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LTr+723XlnQt for ; Wed, 6 Mar 2019 10:11:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by silver.osuosl.org (Postfix) with ESMTPS id F170B22718 for ; Wed, 6 Mar 2019 10:11:55 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id g20so5236604wmh.5 for ; Wed, 06 Mar 2019 02:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Q4EBY4j4pCx8t1ii5rcNzjo67dV+o28TT3fmisabSiM=; b=W5UdT02ITCzBLgs6zZyOhMqAd5upEc15G5KNWSAvTMZzMR9qvIuH+kKWmHab5rYLtX fCW8dhKoGojjCtfSj1uxTDKoStyzBmMsiCMXt2HNZEbfcd8CTyxmUxh3NOF/Ylm2wOe6 gA3Rw1MpnUClN9QXAJpj7TDG4ykbuMQHtvEJQJeyRxFzj+JiBp63ru+Mx6F7wIf22sKw Hr0YSXstr9qjBgyENVAksVnZwetIvuK7GE3Tp8mpG+hNiUxdzn4Sbq6AYCvPEr0lfcvH OGH/BEslogxDjd9Ani2Waq7yYhokhpgfaTO8axKCF3AaDQw2JKGIfYCb+fnszSb2LNVB s7hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Q4EBY4j4pCx8t1ii5rcNzjo67dV+o28TT3fmisabSiM=; b=ZT7+7UfQF28+inhXshwv9mDYYMnoFKi7n/40x/+BYwdHt6w8Y7naS8ajrNALbxajZt P2SKfQCfx+a4ZDJg1KQrKoNerqXErHI157Rvrp9Nef1+b8k8ZIRFgu6MgSyBPwTtb49g glWjhzWbUPKDNlKels4QkHURKEtJaoKBh+Mt+Up6+40lARxosbc3WgooKBMnw0Wmusxu BMy0Nq/zzokhsNxQ4jniaewvNzhiJsDqRXo3ClsrtQP31pn7wTpGyzSeTBRn7rH15Unc YrzilMzpCYWSi1VTA+6Pgp6M1zh20NUlvAfFFJq6gSyeezjLUO7yiTiQOCzbKrgmC60j 977A== X-Gm-Message-State: APjAAAVrxdoJ+04t5egx2z+Xvua+lcmUzRo3kidKiBQH3QjKPXcJmmH0 OWZN5y8QP1Ygku8SF95VP3b3Etw+vmIK+A== X-Google-Smtp-Source: APXvYqz1G6rB5nK8pk19bvqDj1lJF90LyXFbNmyHwAaEFnOVUqenkAELBFnqvVMub3Mp6sB6H6//MQ== X-Received: by 2002:a7b:c413:: with SMTP id k19mr1902429wmi.75.1551867114261; Wed, 06 Mar 2019 02:11:54 -0800 (PST) Received: from lmenx29q.lme.st.com. (koe67-h04-176-179-143-225.dsl.sta.abo.bbox.fr. [176.179.143.225]) by smtp.gmail.com with ESMTPSA id f4sm1648464wrx.68.2019.03.06.02.11.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Mar 2019 02:11:53 -0800 (PST) From: Etienne Carriere To: buildroot@buildroot.org Date: Wed, 6 Mar 2019 11:11:40 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: <7f15bfd5388e2171b13b44722b84149d9f361551.1551866509.git.etienne.carriere@linaro.org> References: <7f15bfd5388e2171b13b44722b84149d9f361551.1551866509.git.etienne.carriere@linaro.org> In-Reply-To: <7f15bfd5388e2171b13b44722b84149d9f361551.1551866509.git.etienne.carriere@linaro.org> References: <7f15bfd5388e2171b13b44722b84149d9f361551.1551866509.git.etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH 6/6] support/testing: test_optee.py: test optee boot and testsuite X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: etienne.carriere@linaro.org, Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Run a Qemu emulation over qemu_armv7a_tz_virt_defconfig and run the embedded OP-TEE regression test suite (xtest). Tool xtest dumps traces that contain '# ' (hash + space) which corrupts infra/emulator.py sequence which use such traces to find shell prompt when command is completed. To overcome the issue the xtest traces are shown only if the test failed. Signed-off-by: Etienne Carriere --- support/testing/tests/package/test_optee.py | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 support/testing/tests/package/test_optee.py diff --git a/support/testing/tests/package/test_optee.py b/support/testing/tests/package/test_optee.py new file mode 100644 index 0000000..b633cb5 --- /dev/null +++ b/support/testing/tests/package/test_optee.py @@ -0,0 +1,40 @@ +import os + +import infra.basetest + + +class TestOptee(infra.basetest.BRTest): + + with open(os.path.join(os.getcwd(), 'configs/qemu_armv7a_tz_virt_defconfig'), 'r') as config_file: + config = "".join(line for line in config_file if line[:1]!='#') + \ + """ + BR2_TOOLCHAIN_EXTERNAL=y + """ + + def test_run(self): + qemu_options = ['-machine', 'virt,secure=on'] + qemu_options.extend(['-cpu', 'cortex-a15']) + qemu_options.extend(['-m', '1024']) + qemu_options.extend(['-semihosting-config', 'enable,target=native']) + qemu_options.extend(['-bios', 'bl1.bin']) + + # Prepare env for Qemu/armv7a to find the boot images + os.chdir(os.path.join(self.builddir, 'images')) + if not os.path.exists('bl33.bin'): + os.symlink('u-boot.bin', 'bl33.bin') + if not os.path.exists('bl32.bin'): + os.symlink('tee-header_v2.bin', 'bl32.bin') + if not os.path.exists('bl32_extra1.bin'): + os.symlink('tee-pager_v2.bin', 'bl32_extra1.bin') + if not os.path.exists('bl32_extra2.bin'): + os.symlink('tee-pageable_v2.bin', 'bl32_extra2.bin') + + self.emulator.boot(arch='armv7', options=qemu_options) + self.emulator.login() + + # Trick test trace since it prints "# " and corrupts emulator run method + # Print test trace only if test fails. + cmd = 'echo "Silent test while a while, be patient..."; ' + \ + 'xtest -t regression > /tmp/xtest.log || (cat /tmp/xtest.log && false)' + output, exit_code = self.emulator.run(cmd, timeout=240) + self.assertEqual(exit_code, 0)