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