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 SSHTest(OERuntimeTestCase): 10 11 @OETestDepends(['ping.PingTest.test_ping']) 12 @OEHasPackage(['dropbear', 'openssh-sshd']) 13 def test_ssh(self): 14 (status, output) = self.target.run('uname -a') 15 self.assertEqual(status, 0, msg='SSH Test failed: %s' % output) 16 (status, output) = self.target.run('cat /etc/masterimage') 17 msg = "This isn't the right image - /etc/masterimage " \ 18 "shouldn't be here %s" % output 19 self.assertEqual(status, 1, msg=msg) 20