xref: /OK3568_Linux_fs/yocto/poky/meta/lib/oeqa/sdk/cases/perl.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#
2# SPDX-License-Identifier: MIT
3#
4
5import unittest
6from oeqa.sdk.case import OESDKTestCase
7
8from oeqa.utils.subprocesstweak import errors_have_output
9errors_have_output()
10
11class PerlTest(OESDKTestCase):
12    def setUp(self):
13        if not (self.tc.hasHostPackage("nativesdk-perl") or
14                self.tc.hasHostPackage("perl-native")):
15            raise unittest.SkipTest("No perl package in the SDK")
16
17    def test_perl(self):
18        cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'"
19        output = self._run(cmd)
20        self.assertEqual(output, "Hello, world")
21