All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Martincoski <ricardo.martincoski@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 12/12] testing: add python-crossbar tests
Date: Fri,  2 Nov 2018 01:12:41 -0300	[thread overview]
Message-ID: <20181102041241.28910-13-ricardo.martincoski@gmail.com> (raw)
In-Reply-To: <20181102041241.28910-1-ricardo.martincoski@gmail.com>

From: Yegor Yefremov <yegorslists@googlemail.com>

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 <yegorslists@googlemail.com>
[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 <ricardo.martincoski@gmail.com>
---
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()
-- 
2.17.1

  parent reply	other threads:[~2018-11-02  4:12 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16  0:42 [Buildroot] [PATCH 0/7] default runtime test case for python packages Ricardo Martincoski
2018-10-16  0:42 ` [Buildroot] [PATCH 1/7] support/testing: create default " Ricardo Martincoski
2018-10-22  7:55   ` Thomas Petazzoni
2018-10-23  3:15     ` Ricardo Martincoski
2018-10-16  0:42 ` [Buildroot] [PATCH 2/7] support/testing: use default test_run for python-autobahn Ricardo Martincoski
2018-10-16  0:42 ` [Buildroot] [PATCH 3/7] support/testing: use default test_run for python-cryptography Ricardo Martincoski
2018-10-16  0:42 ` [Buildroot] [PATCH 4/7] support/testing: use default test_run for python-incremental Ricardo Martincoski
2018-10-16  0:42 ` [Buildroot] [PATCH 5/7] support/testing: use default test_run for python-twisted Ricardo Martincoski
2018-10-16  0:42 ` [Buildroot] [PATCH 6/7] support/testing: use default test_run for python-txaio Ricardo Martincoski
2018-10-16  0:42 ` [Buildroot] [PATCH 7/7] support/testing: use default test_run for python-txtorcon Ricardo Martincoski
2018-11-02  4:12 ` [Buildroot] [PATCH v2 00/12] default runtime test case for python packages v2 Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 01/12] support/testing: use helper class in IPython test Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 02/12] support/testing: use helper class in Python test Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 03/12] support/testing: create intermediate class per Python version Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 04/12] support/testing: create default test case for python packages Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 05/12] support/testing: use TestPythonPackageBase for python-autobahn Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 06/12] support/testing: use TestPythonPackageBase for python-cryptography Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 07/12] support/testing: use TestPythonPackageBase for python-incremental Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 08/12] support/testing: use TestPythonPackageBase for python-twisted Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 09/12] support/testing: use TestPythonPackageBase for python-txaio Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 10/12] support/testing: use TestPythonPackageBase for python-txtorcon Ricardo Martincoski
2018-11-02  4:12   ` [Buildroot] [PATCH v2 11/12] support/testing: rename python* test cases Ricardo Martincoski
2018-11-02  4:12   ` Ricardo Martincoski [this message]
2018-11-04 10:40   ` [Buildroot] [PATCH v2 00/12] default runtime test case for python packages v2 Thomas Petazzoni
2018-11-04 22:42     ` Ricardo Martincoski
2018-11-05  8:15       ` Thomas Petazzoni
2018-11-06  1:57         ` Ricardo Martincoski
2018-11-06  7:56           ` Thomas Petazzoni
2018-11-10  2:15             ` Ricardo Martincoski
2018-11-10  2:16   ` [Buildroot] [PATCH v3 0/8] default runtime test case for python packages Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 1/8] support/testing: create default " Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 2/8] support/testing: use TestPythonPackageBase for python-autobahn Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 3/8] support/testing: use TestPythonPackageBase for python-cryptography Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 4/8] support/testing: use TestPythonPackageBase for python-incremental Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 5/8] support/testing: use TestPythonPackageBase for python-twisted Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 6/8] support/testing: use TestPythonPackageBase for python-txaio Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 7/8] support/testing: use TestPythonPackageBase for python-txtorcon Ricardo Martincoski
2018-11-10  2:16     ` [Buildroot] [PATCH v3 8/8] testing: add python-crossbar tests Ricardo Martincoski
2018-11-13 19:57     ` [Buildroot] [PATCH v3 0/8] default runtime test case for python packages Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181102041241.28910-13-ricardo.martincoski@gmail.com \
    --to=ricardo.martincoski@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.