summaryrefslogtreecommitdiffstats
path: root/support/testing
diff options
context:
space:
mode:
authorRicardo Martincoski <ricardo.martincoski@gmail.com>2018-11-16 01:57:30 -0200
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>2018-11-23 22:05:46 +0100
commit7e69ddc9e7182bdd11135612267604a2264a7229 (patch)
tree03e50d2d6f00ee685129e658c1d69467815ac4b2 /support/testing
parentcdad4bf6aa58b50182e3ae3e61e1550dd7769090 (diff)
downloadbuildroot-7e69ddc9e7182bdd11135612267604a2264a7229.tar.gz
buildroot-7e69ddc9e7182bdd11135612267604a2264a7229.zip
support/testing: add python-pynacl tests
Add a simple test case that minimally uses the module. Add haveged to the target to generate enough entropy so pynacl -> libsodium don't hang waiting for /dev/random. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'support/testing')
-rw-r--r--support/testing/tests/package/sample_python_pynacl.py3
-rw-r--r--support/testing/tests/package/test_python_pynacl.py27
2 files changed, 30 insertions, 0 deletions
diff --git a/support/testing/tests/package/sample_python_pynacl.py b/support/testing/tests/package/sample_python_pynacl.py
new file mode 100644
index 0000000000..d17c50ebe5
--- /dev/null
+++ b/support/testing/tests/package/sample_python_pynacl.py
@@ -0,0 +1,3 @@
+import nacl.utils
+
+nonce = nacl.utils.random(16)
diff --git a/support/testing/tests/package/test_python_pynacl.py b/support/testing/tests/package/test_python_pynacl.py
new file mode 100644
index 0000000000..729a887552
--- /dev/null
+++ b/support/testing/tests/package/test_python_pynacl.py
@@ -0,0 +1,27 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy2Pynacl(TestPythonPackageBase):
+ __test__ = True
+ # use haveged to generate enough entropy so pynacl -> libsodium don't hang waiting for /dev/random
+ config = TestPythonPackageBase.config + \
+ """
+ BR2_PACKAGE_PYTHON=y
+ BR2_PACKAGE_PYTHON_PYNACL=y
+ BR2_PACKAGE_HAVEGED=y
+ """
+ sample_scripts = ["tests/package/sample_python_pynacl.py"]
+ timeout = 10
+
+
+class TestPythonPy3Pynacl(TestPythonPackageBase):
+ __test__ = True
+ # use haveged to generate enough entropy so pynacl -> libsodium don't hang waiting for /dev/random
+ config = TestPythonPackageBase.config + \
+ """
+ BR2_PACKAGE_PYTHON3=y
+ BR2_PACKAGE_PYTHON_PYNACL=y
+ BR2_PACKAGE_HAVEGED=y
+ """
+ sample_scripts = ["tests/package/sample_python_pynacl.py"]
+ timeout = 10
OpenPOWER on IntegriCloud