poky/meta/lib/oeqa/sdk/cases/python.py
Francisco Pedraza 05697aa941 oeqa/sdk/cases: Added validation for SDK compatibility tests with eSDK
The manifests for eSDK are generated using shared states so there is a
need to validate to different "packages names" into the test cases.

For example for perl:

SDK provides nativesdk-perl
eSDK provides perl-native

[YOCTO #9090]

(From OE-Core rev: 8db06dd1290dd53d626050879c9c306f95d76ac2)

Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-12 23:01:23 +01:00

33 lines
1.0 KiB
Python

import os
import shutil
import unittest
from oeqa.core.utils.path import remove_safe
from oeqa.sdk.case import OESDKTestCase
class PythonTest(OESDKTestCase):
@classmethod
def setUpClass(self):
if not (self.tc.hasHostPackage("nativesdk-python") or
self.tc.hasHostPackage("python-native")):
raise unittest.SkipTest("No python package in the SDK")
for f in ['test.py']:
shutil.copyfile(os.path.join(self.tc.files_dir, f),
os.path.join(self.tc.sdk_dir, f))
def test_python_exists(self):
self._run('which python')
def test_python_stdout(self):
output = self._run('python %s/test.py' % self.tc.sdk_dir)
self.assertEqual(output.strip(), "the value of a is 0.01", msg="Incorrect output: %s" % output)
def test_python_testfile(self):
self._run('ls /tmp/testfile.python')
@classmethod
def tearDownClass(self):
remove_safe("%s/test.py" % self.tc.sdk_dir)
remove_safe("/tmp/testfile.python")