From patchwork Thu Nov 29 17:39:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 152424 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2664760ljp; Thu, 29 Nov 2018 09:39:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/VFWNZgkFkS5P3aYpA58v9GsJGNYM4rodUkHIbl3aYr91t+qiv/u2F5Cydzphd0jimmpGwC X-Received: by 2002:a62:178f:: with SMTP id 137mr2270060pfx.226.1543513182457; Thu, 29 Nov 2018 09:39:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543513182; cv=none; d=google.com; s=arc-20160816; b=F5btgO8e3GIJ8Vjj/WfHWTt6C6byAH0dnqAKUjup0cmqoeXTt53DBvSa1Z1Mft3Nbc LTZDZOmOzUYDNrhhSB5XDOFlwnZ2rJxP6SiWrbQNd3J6ziQjusjSuWfREIkTTHRnXsJS m0locVs0nExl8n/D6nMSWiP/g9jypw3pRVF2oTW/jJh0RO2e5CDHrtEb3XRnnJgsy0i3 aBI+oH/z8ykTnqVIgrK0OeAEwGmwn8NO4SqY9zofdHGoxwC5nP5o94lt7vL3K3ssjiMA ji6JUpoFvMoFYB5gx9USFxk0GvRYMWNaMmuox/cf10lcTL2XkoF1kAEWK3Q9webLkwOT WtTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=gxlbI2QejLyE2upgclAwtAzcl5R5tSHXd41cuhzTDYk=; b=m/OQgOxUs+lrcXkjpmydJsduVx2B/BjA7oCi3Q0rjl1E4vZVXYVEoa+Uqm46/uqoWC eZH6kc0cZP3D22BBulJQYY2d5IZRPn+Hn+Ar5TZv9X/eMVc4lOy/vNwA6/S2KvTEBxcq Ydbo3PhRovFnvMn9p5aGb0X9H7gcmGUATlAIaWTF0XjEoXJCFSjlvkr/w/t8BDT92m4G pUhZBoAMPU+jMvG5KQeI9RGHvB5x0hYOQLpu/4UabTckHEf9jZRPb53B1zG21KNBUxni 18yo7FGScKQS8f23D8nPwVhimFn9SN7qwB02dAg6fZYCf0+j+2X3mG/cwW9YSmaxcIi6 UgHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=LriW9lTw; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id z15si2555479pgi.304.2018.11.29.09.39.41; Thu, 29 Nov 2018 09:39:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=LriW9lTw; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 5A7AA6D6F5; Thu, 29 Nov 2018 17:39:37 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mail.openembedded.org (Postfix) with ESMTP id C7B776D5B1 for ; Thu, 29 Nov 2018 17:39:35 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id 125so3176520wmh.0 for ; Thu, 29 Nov 2018 09:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=NIuzUnnj65EikZHVtTfL47AxRDFgErGLZssgkpgQ2GY=; b=LriW9lTwFM4JoUAl47N3P7BC38hWkoZj8dsQYoLefUg60rJp50QPo9fe95pv3yrMxe MA7pHGmBq0FTPiRvAbR+zV1HlSpdDCL9+FmsWDrP6SUskKsbN2gHg15+iBg4DlDP67cl Fk+1FbLfj3q3iooaqCk3fqeqZoaj9VtjrL2TEtukhfAmqkR1q00+mZiS3ocxaaes1Wfz i20Bt20Kmddlvk2QxYAUojTpqaqxFnJSCpHYwZEbM2GYd2tbwTzVc/4ZM37tm/lA/5ou qQMSR2y3mFFPh5G/OQkdPdsi++Rom4TkWkckV1TGSEmpoDRMvl0s5hqi02CYuMRTHV9t 3YuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=NIuzUnnj65EikZHVtTfL47AxRDFgErGLZssgkpgQ2GY=; b=cSj2VOC90lu6nbh7wNpsFxPXYfVs5VGxyIUJm0XU6L9Lh1hryyXoZRQ+aaZizJ6B2r AFC7+GmyLOLliPTyotK60wuTbHnJbJDQo9f8xwxqjjIigwgsjE5qK2tyyLGycQQd6HSm P3dM5DjtZ3pq2Ak+SeCGYoFMx1yHNDcqR+htduVxYThY5msy8+p2998jVh5YxA7n7pmD GRMTSJUtjGs5Ngtr4JSlfnNPl9rkIxE1YxZZ6s3Kl1V8lBMpiafd1ff/gkiSyIb59A6K xNq0OsaAwADItDOOWpa+Hc6zupgaYhl0Y51N25OlNZ/P+xx0J/mRBdckDABVWseGHasO GiVw== X-Gm-Message-State: AA+aEWbM9MVwnxREWpmyTzmpUU0lKa2y3i59XpsPTkgEQRvh3GiJSUyc rERVfUbjO/tAcG45684jTdRNr3GQhwo= X-Received: by 2002:a1c:d912:: with SMTP id q18mr2577992wmg.122.1543513176172; Thu, 29 Nov 2018 09:39:36 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id b16sm2451941wrm.41.2018.11.29.09.39.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 09:39:35 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 29 Nov 2018 17:39:33 +0000 Message-Id: <20181129173933.2936-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH] oeqa/sdk/python: add Python 2 and fix detection X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Add a Python 2 form to exercise that if present, and fix the setUp() so it actually looks for a package that exists (nativesdk-python3 is a virtual package, the interpretter is in nativesdk-python3-core). Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/python.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oeqa/sdk/cases/python.py b/meta/lib/oeqa/sdk/cases/python.py index 7c1d183e529..8b871414033 100644 --- a/meta/lib/oeqa/sdk/cases/python.py +++ b/meta/lib/oeqa/sdk/cases/python.py @@ -1,14 +1,28 @@ import subprocess, unittest from oeqa.sdk.case import OESDKTestCase -class PythonTest(OESDKTestCase): +class Python2Test(OESDKTestCase): def setUp(self): - if not (self.tc.hasHostPackage("nativesdk-python3") or - self.tc.hasHostPackage("python3-native")): + if not (self.tc.hasHostPackage("nativesdk-python-core") or + self.tc.hasHostPackage("python-core-native")): raise unittest.SkipTest("No python package in the SDK") def test_python3(self): try: + cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" + output = self._run(cmd) + self.assertEqual(output, "Hello, world\n") + except subprocess.CalledProcessError as e: + self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output)) + +class Python3Test(OESDKTestCase): + def setUp(self): + if not (self.tc.hasHostPackage("nativesdk-python3-core") or + self.tc.hasHostPackage("python3-core-native")): + raise unittest.SkipTest("No python3 package in the SDK") + + def test_python3(self): + try: cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" output = self._run(cmd) self.assertEqual(output, "Hello, world\n")