blob: cdbef595008cbb79f35c199af258968272ce2bd7 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Brad Bishopc342db32019-05-15 21:57:59 -04004# SPDX-License-Identifier: MIT
5#
6
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007from oeqa.runtime.case import OERuntimeTestCase
8from oeqa.core.decorator.depends import OETestDepends
Brad Bishop977dc1a2019-02-06 16:01:43 -05009from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010
11class SSHTest(OERuntimeTestCase):
12
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013 @OETestDepends(['ping.PingTest.test_ping'])
Brad Bishop977dc1a2019-02-06 16:01:43 -050014 @OEHasPackage(['dropbear', 'openssh-sshd'])
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015 def test_ssh(self):
Patrick Williamsac13d5f2023-11-24 18:59:46 -060016 (status, output) = self.target.run('sleep 20', timeout=2)
17 msg='run() timed out but return code was zero.'
18 self.assertNotEqual(status, 0, msg=msg)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 (status, output) = self.target.run('uname -a')
20 self.assertEqual(status, 0, msg='SSH Test failed: %s' % output)
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000021 (status, output) = self.target.run('cat /etc/controllerimage')
22 msg = "This isn't the right image - /etc/controllerimage " \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023 "shouldn't be here %s" % output
24 self.assertEqual(status, 1, msg=msg)