From patchwork Fri Nov 2 04:12:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 992184 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.136; helo=silver.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.b="JGnOoiC+"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42mTGr2gZyzB4R1 for ; Fri, 2 Nov 2018 15:14:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1F8E525C0B; Fri, 2 Nov 2018 04:14:09 +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 8RMt3u7Qi6L3; Fri, 2 Nov 2018 04:14:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 085DB25489; Fri, 2 Nov 2018 04:14:07 +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 224981BF4DA for ; Fri, 2 Nov 2018 04:14:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1F9E387CB2 for ; Fri, 2 Nov 2018 04:14:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JHrzj8889Uxm for ; Fri, 2 Nov 2018 04:14:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id 79480841D7 for ; Fri, 2 Nov 2018 04:14:04 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id f18-v6so1129306qkm.7 for ; Thu, 01 Nov 2018 21:14:04 -0700 (PDT) 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 :in-reply-to:references; bh=9ZlFHlgb75qD1k0az40JaucAxezo/SaiWdHcqVQA04M=; b=JGnOoiC+O0hMm413F3kka3AbtsKgDWm+zpdP3PCk7zbyORb0uTTmJrgoSwEwwkCNEo dPrxeR85lTLWtjtDhXvO5jxUQD9gbji6HajoQ5wYy9jqUFKFPN63cPf+h+OXD3jjH1Ar ReyOASMJPD0tnOuWoHJr9z8nTxQ8NxzX2YiRS6dT/JibGxvBwFKQGCnmkmHmTB+5Nm1h DLckefhRP0T7hV4hSdKWR/WozsWm8k7l3OkN65yID9llBeHvuPPngo5ZFJCDnCQQ1WBL F86F6mQiZdlobViqMZxg+Uv34xUr+X5UWonSXaRMbMXyuZvLaQ8KFP7RQKSC5tOchULz uWxQ== 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=9ZlFHlgb75qD1k0az40JaucAxezo/SaiWdHcqVQA04M=; b=j89TBNpYs80ZhWJba1w8DRKY5ueBFpHV88sMTi7wQW6I5devUmy0b5a1QKfHTeQR1t Dwx0jCRhuMoq6HE8Q/UNWuHC1fWj+98FlFJ5YR9hERMkUD5bjcfrkK15KW21rGlqKkbE joFUea+yv5sTANt6ktpr5Yr3XfJ98g+Zs/4e4DTwkcRhXHmt2eoOHm1+Vtizworl0btM IAtQCsbljrxIja507Qp1dPMR75tUam65++m/g8QeFEODSTpzUel3QkzcyztZpXhI1O45 J+peMJsEaVVLBkUC8fvA/YZecIVbKsWWAtprfCvUiQHKY+jCFxt4V7zgV66NxnuzFuyz DYqg== X-Gm-Message-State: AGRZ1gIkcF7lI55QnmMZ3BMetIJPcaEW19R0chR0TGuGHQcR1jlkt3z5 tIiZimJVP6xHxmDNb3f6sZwz9rPq X-Google-Smtp-Source: AJdET5e8G5fCd/5Fwe1NWDOozJtJKyBNFzQkeqTNngnz+H+RHrbupmVAjvb+1VtrLW5fhI9jfhsarg== X-Received: by 2002:a37:34f:: with SMTP id 76mr9105250qkd.347.1541132043330; Thu, 01 Nov 2018 21:14:03 -0700 (PDT) Received: from ultri5.home ([179.181.159.8]) by smtp.gmail.com with ESMTPSA id 83sm32849688qkz.73.2018.11.01.21.14.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 21:14:02 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 2 Nov 2018 01:12:41 -0300 Message-Id: <20181102041241.28910-13-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181102041241.28910-1-ricardo.martincoski@gmail.com> References: <20181102041241.28910-1-ricardo.martincoski@gmail.com> In-Reply-To: <20181016004230.10393-1-ricardo.martincoski@gmail.com> References: <20181016004230.10393-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v2 12/12] testing: add python-crossbar tests 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 MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Yegor Yefremov This test invokes "crossbar version" command, that checks all dependencies found in setup.py files and prints some system related information. Add haveged to the target to generate enough entropy so crossbar -> pynacl -> libsodium don't hang waiting for /dev/random. Signed-off-by: Yegor Yefremov [Ricardo: update code-style and .gitlab-ci.yml, call the command without 'python -m' as it is not supported anymore, remove Python 2 variant, add haveged to target to add entropy and avoid hanging] Signed-off-by: Ricardo Martincoski --- Changes v1 -> v2: - new patch to the series, resending a patch from Yegor; - call 'crossbar version' instead of 'python -m "crossbar version"' because it is not supported anymore, giving this message: /usr/bin/python3: No module named crossbar.__main__; 'crossbar' is a package and cannot be directly executed - add haveged to the target to provide enough entropy, avoiding hanging forever (on our current kernel 3.11.0 default image) or for a long time (when the default kernel image is upgraded to a newer kernel); - remove test for python 2 because upstream dropped support; - do not pass timeout parameter since version_test is now called once; - use new naming convention and classes for tests of python packages; - rewrap commit message to 72; - update code-style (we adopted flake8 after v1 submission); - update .gitlab-ci.yml; NOTE: please mark below patch as Superseeded. v1: http://patchwork.ozlabs.org/patch/873813/ --- .gitlab-ci.yml | 1 + .../tests/package/test_python_crossbar.py | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 support/testing/tests/package/test_python_crossbar.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7addd64df8..6a30c9603d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -315,6 +315,7 @@ tests.package.test_python.TestPythonInterpreter2: *runtime_test tests.package.test_python.TestPythonInterpreter3: *runtime_test tests.package.test_python_autobahn.TestPython2Autobahn: *runtime_test tests.package.test_python_autobahn.TestPython3Autobahn: *runtime_test +tests.package.test_python_crossbar.TestPython3Crossbar: *runtime_test tests.package.test_python_cryptography.TestPython2Cryptography: *runtime_test tests.package.test_python_cryptography.TestPython3Cryptography: *runtime_test tests.package.test_python_incremental.TestPython2Incremental: *runtime_test diff --git a/support/testing/tests/package/test_python_crossbar.py b/support/testing/tests/package/test_python_crossbar.py new file mode 100644 index 0000000000..2ead24cd16 --- /dev/null +++ b/support/testing/tests/package/test_python_crossbar.py @@ -0,0 +1,20 @@ +from tests.package.test_python import TestPythonPackageBase, TestPythonBase3 + + +class TestPython3Crossbar(TestPythonPackageBase, TestPythonBase3): + # use haveged to generate enough entropy so crossbar -> pynacl -> libsodium don't hang waiting for /dev/random + config_package = \ + """ + BR2_PACKAGE_PYTHON_CROSSBAR=y + BR2_PACKAGE_HAVEGED=y + """ + + def version_test(self): + # "python -m crossbar version" can't be used + cmd = "crossbar version" + _, exit_code = self.emulator.run(cmd, 60) + self.assertEqual(exit_code, 0) + + def test_run(self): + self.login() + self.version_test()