1# 2# Copyright OpenEmbedded Contributors 3# 4# SPDX-License-Identifier: MIT 5# 6 7from oeqa.runtime.case import OERuntimeTestCase 8from oeqa.core.decorator.depends import OETestDepends 9from oeqa.runtime.decorator.package import OEHasPackage 10 11class SSHTest(OERuntimeTestCase): 12 13 @OETestDepends(['ping.PingTest.test_ping']) 14 @OEHasPackage(['dropbear', 'openssh-sshd']) 15 def test_ssh(self): 16 (status, output) = self.target.run('uname -a') 17 self.assertEqual(status, 0, msg='SSH Test failed: %s' % output) 18 (status, output) = self.target.run('cat /etc/controllerimage') 19 msg = "This isn't the right image - /etc/controllerimage " \ 20 "shouldn't be here %s" % output 21 self.assertEqual(status, 1, msg=msg) 22