xref: /OK3568_Linux_fs/yocto/poky/meta/lib/oeqa/runtime/cases/rust.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#
2# SPDX-License-Identifier: MIT
3#
4
5from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
7from oeqa.runtime.decorator.package import OEHasPackage
8
9class RustHelloworldTest(OERuntimeTestCase):
10    @OETestDepends(['ssh.SSHTest.test_ssh'])
11    @OEHasPackage(['rust-hello-world'])
12    def test_rusthelloworld(self):
13        cmd = "rust-hello-world"
14        status, output = self.target.run(cmd)
15        msg = 'Exit status was not 0. Output: %s' % output
16        self.assertEqual(status, 0, msg=msg)
17
18        msg = 'Incorrect output: %s' % output
19        self.assertEqual(output, "Hello, world!", msg=msg)
20