diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-27 14:04:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-27 23:28:21 +0100 |
commit | f1e66398eaba495ea6d8d39e2b489e594ac88a0e (patch) | |
tree | ff139375802e6c48fb357d776046f5c0679b7a13 | |
parent | 7d18d1169204ee80f1c00b35998f10fffaefa107 (diff) | |
download | openembedded-core-f1e66398eaba495ea6d8d39e2b489e594ac88a0e.tar.gz openembedded-core-f1e66398eaba495ea6d8d39e2b489e594ac88a0e.tar.bz2 openembedded-core-f1e66398eaba495ea6d8d39e2b489e594ac88a0e.zip |
oeqa/selftest/imagefeatures: fix SSH without password tests
* We need to set EXTRA_IMAGE_FEATURES outright or existing values will
affect the test
* For test case 1107 we need "empty-root-password" to match the behaviour
described in the test case
* For test case 1115 we shouldn't be able to connect as root with the
features we are setting
Test cases 1107 and 1115 have been updated in Testopia to match.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/imagefeatures.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/imagefeatures.py b/meta/lib/oeqa/selftest/imagefeatures.py index d48435fedf..20cc58dc93 100644 --- a/meta/lib/oeqa/selftest/imagefeatures.py +++ b/meta/lib/oeqa/selftest/imagefeatures.py @@ -25,7 +25,7 @@ class ImageFeatures(oeSelfTest): AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> """ - features = 'EXTRA_IMAGE_FEATURES += "ssh-server-openssh empty-root-password"\n' + features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh empty-root-password allow-empty-password"\n' features += 'INHERIT += "extrausers"\n' features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user) @@ -46,12 +46,14 @@ class ImageFeatures(oeSelfTest): def test_all_users_can_connect_via_ssh_without_password(self): """ Summary: Check if all users can connect via ssh without password - Expected: 1. Connection to the image via ssh using root or tester user without providing a password should be allowed. + Expected: 1. Connection to the image via ssh using root user without providing a password should NOT be allowed. + 2. Connection to the image via ssh using tester user without providing a password should be allowed. Product: oe-core Author: Ionut Chisanovici <ionutx.chisanovici@intel.com> AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> """ - features = 'EXTRA_IMAGE_FEATURES += "ssh-server-openssh allow-empty-password"\n' + + features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh allow-empty-password"\n' features += 'INHERIT += "extrausers"\n' features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user) @@ -66,7 +68,10 @@ class ImageFeatures(oeSelfTest): for user in [self.root_user, self.test_user]: ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user=user) status, output = ssh.run("true") - self.assertEqual(status, 0, 'ssh to user tester failed with %s' % output) + if user == 'root': + self.assertNotEqual(status, 0, 'ssh to user root was allowed when it should not have been') + else: + self.assertEqual(status, 0, 'ssh to user tester failed with %s' % output) @testcase(1114) |