poky/meta/lib/oeqa/sdk/cases/perl.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

29 lines
821 B
Python

import os
import shutil
import unittest
from oeqa.core.utils.path import remove_safe
from oeqa.sdk.case import OESDKTestCase
class PerlTest(OESDKTestCase):
@classmethod
def setUpClass(self):
if not (self.tc.hasHostPackage("nativesdk-perl") or
self.tc.hasHostPackage("perl-native")):
raise unittest.SkipTest("No perl package in the SDK")
for f in ['test.pl']:
shutil.copyfile(os.path.join(self.tc.files_dir, f),
os.path.join(self.tc.sdk_dir, f))
self.testfile = os.path.join(self.tc.sdk_dir, "test.pl")
def test_perl_exists(self):
self._run('which perl')
def test_perl_works(self):
self._run('perl %s' % self.testfile)
@classmethod
def tearDownClass(self):
remove_safe(self.testfile)