From patchwork Sun Feb 23 17:56:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1242706 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MfSCk2sK; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48QXvF6l1Rz9sP7 for ; Mon, 24 Feb 2020 04:56:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8488686BA1; Sun, 23 Feb 2020 17:56:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2XEXNnPzDgY0; Sun, 23 Feb 2020 17:56:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D726684F76; Sun, 23 Feb 2020 17:56:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 16A681BF47D for ; Sun, 23 Feb 2020 17:56:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 10A4A86DDB for ; Sun, 23 Feb 2020 17:56:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lop2Yn1hrjUp for ; Sun, 23 Feb 2020 17:56:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by hemlock.osuosl.org (Postfix) with ESMTPS id BBC2F84D42 for ; Sun, 23 Feb 2020 17:56:33 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id i6so4089501pfc.1 for ; Sun, 23 Feb 2020 09:56:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MxQS3P6RoKlcGrqRAs1enQGGb0IzL+rhPl0S55c0JjM=; b=MfSCk2sKDeOVVkJChCCE9cBHW1As+phh9JSECix+F47HPC9bvoZ5QeiX9o7kfi+6Lo RCYMUqP4AAyK+jjOFFp6mkt7TVbBvdtOEuHPy8k8s9pJJtQq9LEoMlYI07OKT0krIuGl YVrfSVTrGh6zbNjo3QnuRkt1n8nkAHICXOsCi44pStxj028AaxdxL9vsVFVZUIQXLC+o JJt6taG5BC3FfDDwlf9XeoSMI0w4zGjmPaKgdsNL2PU9qT03xLIjsYlsmxcVw1GcbLb7 /tdcdy8k0BQ/y1qYzFamk/4+WmqQMQJNaA5hlgVHW82io9tVLNuE8dN2IkFPrB34TWP3 M1+Q== 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:mime-version:content-transfer-encoding; bh=MxQS3P6RoKlcGrqRAs1enQGGb0IzL+rhPl0S55c0JjM=; b=Hqi6WIe4BotyMnjXm9RqtW9x3tM3Xm+OU2QXoAUd3rge3/ri/GUZISHbikVxdxiOqo ZWb0Dcfde96myg/p3LxbAU8hVuBXo8cUTxitgYItzwh2ynOQHrRdQxvmnZsNqv41P2/Y C7Yx/H/tt+WroNhgUNriN8nha9n7y2e3C09r7mIMKDOiHFu5Zsy2vw/QJI1Ye6fS+y3B PfM+ndg5IeV1fQVzPLDfix/VBtwculgum+q0VmH/EiqFqvTOm4bT5eKn+vVAi5YuLzYs SkBjlInCiCh2V99Ub6oS8zFsgz2ZRETiQZKJ9DuAZk2w51KfvawrzP9zvc5E6YlV2Gz5 NciQ== X-Gm-Message-State: APjAAAXUlJ/dYLBdk3e17YHdqPUHib88EgsNCAOqZTypgnOb3Df5azRV tnW9PtHOsGZ8wf+7MCbh3ag4z/hpXn4= X-Google-Smtp-Source: APXvYqwGT4lX6cqs2NhZlMRRhYz5mjjsnm1ameL8W5JnEwadI49cd5FtQNLKFokIOtFaWzAp5mWT1w== X-Received: by 2002:a62:6842:: with SMTP id d63mr48399878pfc.113.1582480592914; Sun, 23 Feb 2020 09:56:32 -0800 (PST) Received: from localhost.localdomain ([47.149.8.172]) by smtp.gmail.com with ESMTPSA id y6sm9388829pgc.10.2020.02.23.09.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 09:56:32 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Sun, 23 Feb 2020 09:56:26 -0800 Message-Id: <20200223175626.16900-2-aduskett@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200223175626.16900-1-aduskett@gmail.com> References: <20200223175626.16900-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH/next v2 2/2] support/testing: update python-gobject test 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: Ricardo Martincoski , Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett Because gobject-introspection is now a dependency of python-gobject, the test must be updated. - Change TestPythonPy2Gobject to TestPythonPy3Gobject as gobject-introspection requires python3. - Refactor test_python_gobject.py to no longer inherit the TestPythonPackageBase class, as this class uses a base config that does not support gobject-introspection. - Update sample_python_gobject to use Glib to find the path of sh. Signed-off-by: Adam Duskett --- .gitlab-ci.yml | 2 +- .../tests/package/sample_python_gobject.py | 13 +++++++- .../tests/package/test_python_gobject.py | 30 ++++++++++++++++--- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6436a8417..c18c6a5fa7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -458,7 +458,7 @@ tests.package.test_python_cryptography.TestPythonPy3Cryptography: { extends: .ru tests.package.test_python_django.TestPythonPy3Django: { extends: .runtime_test } tests.package.test_python_gitdb2.TestPythonPy2Gitdb2: { extends: .runtime_test } tests.package.test_python_gitdb2.TestPythonPy3Gitdb2: { extends: .runtime_test } -tests.package.test_python_gobject.TestPythonPy2Gobject: { extends: .runtime_test } +tests.package.test_python_gobject.TestPythonPy3Gobject: { extends: .runtime_test } tests.package.test_python_incremental.TestPythonPy2Incremental: { extends: .runtime_test } tests.package.test_python_incremental.TestPythonPy3Incremental: { extends: .runtime_test } tests.package.test_python_passlib.TestPythonPy2Passlib: { extends: .runtime_test } diff --git a/support/testing/tests/package/sample_python_gobject.py b/support/testing/tests/package/sample_python_gobject.py index 84ebee7362..ecce0b0575 100644 --- a/support/testing/tests/package/sample_python_gobject.py +++ b/support/testing/tests/package/sample_python_gobject.py @@ -1 +1,12 @@ -import gobject # noqa +#!/usr/bin/env python +"""A simple test that uses python-gobject to find the path of sh.""" +from gi.repository import GLib + +def main(): + sh_path = GLib.find_program_in_path('sh') + if sh_path == "/bin/sh": + return True + return False + +if __name__ == '__main__': + main() diff --git a/support/testing/tests/package/test_python_gobject.py b/support/testing/tests/package/test_python_gobject.py index 0a59447adb..a673d554a4 100644 --- a/support/testing/tests/package/test_python_gobject.py +++ b/support/testing/tests/package/test_python_gobject.py @@ -1,11 +1,33 @@ +import os from tests.package.test_python import TestPythonPackageBase - -class TestPythonPy2Gobject(TestPythonPackageBase): +class TestPythonPy3Gobject(TestPythonPackageBase): __test__ = True - config = TestPythonPackageBase.config + \ + config = \ """ - BR2_PACKAGE_PYTHON=y + BR2_aarch64=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7" + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config" + BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + BR2_TARGET_ROOTFS_CPIO=y + BR2_TARGET_ROOTFS_CPIO_GZIP=y + BR2_PACKAGE_GOBJECT_INTROSPECTION=y + BR2_PACKAGE_PYTHON3=y BR2_PACKAGE_PYTHON_GOBJECT=y """ + + def login(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio.gz") + kern = os.path.join(self.builddir, "images", "Image") + self.emulator.boot(arch="aarch64", + kernel=kern, + kernel_cmdline=["console=ttyAMA0"], + options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img]) + self.emulator.login() + sample_scripts = ["tests/package/sample_python_gobject.py"]