* [meta-python2][zeus][PATCH 1/2] lib/oeqa/runtime/cases: add python2.py
@ 2020-01-30 6:05 Tim Orling
2020-01-30 6:05 ` [meta-python2][zeus][PATCH 2/2] kas-meta-python2-ptest-image: add python2 test Tim Orling
0 siblings, 1 reply; 2+ messages in thread
From: Tim Orling @ 2020-01-30 6:05 UTC (permalink / raw)
To: openembedded-devel
Refactor the python3 test from oe-core to do very
basic acceptance test of python2.
Signed-off-by: Tim Orling <ticotimo@gmail.com>
---
lib/oeqa/runtime/cases/python2.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 lib/oeqa/runtime/cases/python2.py
diff --git a/lib/oeqa/runtime/cases/python2.py b/lib/oeqa/runtime/cases/python2.py
new file mode 100644
index 00000000..8afa2ac9
--- /dev/null
+++ b/lib/oeqa/runtime/cases/python2.py
@@ -0,0 +1,20 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.decorator.package import OEHasPackage
+
+
+class PythonTest(OERuntimeTestCase):
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['python-core'])
+ def test_python(self):
+ cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
+ status, output = self.target.run(cmd)
+ msg = 'Exit status was not 0. Output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ msg = 'Incorrect output: %s' % output
+ self.assertEqual(output, "Hello, world", msg=msg)
--
2.25.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [meta-python2][zeus][PATCH 2/2] kas-meta-python2-ptest-image: add python2 test
2020-01-30 6:05 [meta-python2][zeus][PATCH 1/2] lib/oeqa/runtime/cases: add python2.py Tim Orling
@ 2020-01-30 6:05 ` Tim Orling
0 siblings, 0 replies; 2+ messages in thread
From: Tim Orling @ 2020-01-30 6:05 UTC (permalink / raw)
To: openembedded-devel
In addition to ping, ssh and ptest, run python2 test(s).
Run python2 before ptest (fail early).
Signed-off-by: Tim Orling <ticotimo@gmail.com>
---
kas-meta-python2-ptest-image.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kas-meta-python2-ptest-image.yml b/kas-meta-python2-ptest-image.yml
index 3a15add5..1dc0f4b8 100644
--- a/kas-meta-python2-ptest-image.yml
+++ b/kas-meta-python2-ptest-image.yml
@@ -14,7 +14,7 @@ local_conf_header:
DISTRO_FEAURES_append = " ptest"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
TESTIMAGE_AUTO = "1"
- TEST_SUITES = " ping ssh ptest"
+ TEST_SUITES = " ping ssh python2 ptest"
TEST_QEMUPARAMS += "-smp 4 -m 8192"
TEST_RUNQEMUPARAMS += "kvm gl"
IMAGE_ROOTFS_SIZE ?= "8192"
--
2.25.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-30 13:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-30 6:05 [meta-python2][zeus][PATCH 1/2] lib/oeqa/runtime/cases: add python2.py Tim Orling
2020-01-30 6:05 ` [meta-python2][zeus][PATCH 2/2] kas-meta-python2-ptest-image: add python2 test Tim Orling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox