Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | import subprocess |
| 2 | import unittest |
| 3 | import sys |
| 4 | from oeqa.oetest import oeRuntimeTest, skipModule |
| 5 | from oeqa.utils.decorators import * |
| 6 | |
| 7 | def setUpModule(): |
| 8 | if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh")): |
| 9 | skipModule("No ssh package in image") |
| 10 | |
| 11 | class SshTest(oeRuntimeTest): |
| 12 | |
| 13 | @testcase(224) |
| 14 | @skipUnlessPassed('test_ping') |
| 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/masterimage') |
| 19 | self.assertEqual(status, 1, msg="This isn't the right image - /etc/masterimage shouldn't be here %s" % output) |