Merge ~powersj/cloud-init:fix_ssh_import_id into cloud-init:master

Proposed by Joshua Powers
Status: Merged
Approved by: Scott Moser
Approved revision: 53e63b4a17f60d7b8b9ef87be331fbe665788786
Merged at revision: 10e5195e4a4459d1893801aa9fb486dc2973415d
Proposed branch: ~powersj/cloud-init:fix_ssh_import_id
Merge into: cloud-init:master
Diff against target: 23 lines (+2/-11)
1 file modified
tests/cloud_tests/testcases/modules/ssh_import_id.py (+2/-11)
Reviewer Review Type Date Requested Status
Scott Moser Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+326323@code.launchpad.net

Commit message

Tests: Simplify the check on ssh-import-id

I want to be able to add additional SSH keys to my account, therefore I
should not be limiting these tests to look for one specific key. Instead
confirm that the comment in authorized_users has the specified users.

Description of the change

Test sucessfully with:

python3 -m tests.cloud_tests run --os-name xenial --preserve-data --data-dir results --verbose -t modules/ssh_import_id --deb cloud-init_0.7.9-194-gecb408af-1~bddeb_all.deb

python3 -m tests.cloud_tests run --os-name artful --preserve-data --data-dir results --verbose -t modules/ssh_import_id --deb cloud-init_0.7.9-194-gecb408af-1~bddeb_all.deb

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:53e63b4a17f60d7b8b9ef87be331fbe665788786
https://jenkins.ubuntu.com/server/job/cloud-init-ci/13/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: CentOS 6 & 7: Build & Test
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/13/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

This isn't great, and relies on specific output (in .ssh/authorized_keys) of ssh-import-id, but it is admittedly better than what we have.

better would be to have a specific user to import that we could control specifically for this purpose.

review: Approve

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/cloud_tests/testcases/modules/ssh_import_id.py b/tests/cloud_tests/testcases/modules/ssh_import_id.py
2index 055c6a2..ef156f4 100644
3--- a/tests/cloud_tests/testcases/modules/ssh_import_id.py
4+++ b/tests/cloud_tests/testcases/modules/ssh_import_id.py
5@@ -11,16 +11,7 @@ class TestSshImportId(base.CloudTestCase):
6 """Test that ssh keys were imported."""
7 out = self.get_data_file('auth_keys_ubuntu')
8
9- # Rather than checking the key fingerprints, you could just check
10- # the ending comment for where it got imported from in case these
11- # change in the future :\
12- self.assertIn('8sXGTYYw3iQSkOvDUUlIsqdaO+w== powersj@github/'
13- '18564351 # ssh-import-id gh:powersj', out)
14- self.assertIn('Hj29SCmXp5Kt5/82cD/VN3NtHw== smoser@brickies-'
15- 'canonical # ssh-import-id lp:smoser', out)
16- self.assertIn('7cUDQSXbabilgnzTjHo9mjd/kZ7cLOHP smoser@bart-'
17- 'canonical # ssh-import-id lp:smoser', out)
18- self.assertIn('aX0VHGXvHAQlPl4n7+FzAE1UmWFYEGrsSoNvLv3 smose'
19- 'r@kaypeah # ssh-import-id lp:smoser', out)
20+ self.assertIn('# ssh-import-id gh:powersj', out)
21+ self.assertIn('# ssh-import-id lp:smoser', out)
22
23 # vi: ts=4 expandtab

Subscribers

People subscribed via source and target branches