blob: ff50b468006ef1acf085a7e58e05f893b9ed02fd [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001import unittest
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002from oeqa.sdk.case import OESDKTestCase
3
4class PerlTest(OESDKTestCase):
5 @classmethod
6 def setUpClass(self):
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007 if not (self.tc.hasHostPackage("nativesdk-perl") or
8 self.tc.hasHostPackage("perl-native")):
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009 raise unittest.SkipTest("No perl package in the SDK")
10
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011 def test_perl(self):
12 try:
13 cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'"
14 output = self._run(cmd)
15 self.assertEqual(output, "Hello, world")
16 except subprocess.CalledProcessError as e:
17 self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output))