diff options
author | Wesley Wiedenmeier <wesley.wiedenmeier@gmail.com> | 2016-12-22 17:27:37 -0500 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2016-12-22 17:41:39 -0500 |
commit | f53fc46aa732e3b29991b3e5e39da31a722945ee (patch) | |
tree | a301733aa9991b58b218f61b187240d275e44968 /tests/cloud_tests/testcases/modules/ssh_keys_provided.py | |
parent | b2a9f33616c806ae6e052520a8589113308f567c (diff) | |
download | vyos-cloud-init-f53fc46aa732e3b29991b3e5e39da31a722945ee.tar.gz vyos-cloud-init-f53fc46aa732e3b29991b3e5e39da31a722945ee.zip |
integration test: initial commit of integration test framework
The adds in end-to-end testing of cloud-init. The framework utilizes
LXD and cloud images as a backend to test user-data passed in.
Arbitrary data is then captured from predefined commands specified
by the user. After collection, data verification is completed by
running a series of Python unit tests against the collected data.
Currently only the Ubuntu Trusty, Xenial, Yakkety, and Zesty
releases are supported. Test cases for 50% of the modules is
complete and available.
Additionally a Read the Docs file was created to guide test
writing and execution.
Diffstat (limited to 'tests/cloud_tests/testcases/modules/ssh_keys_provided.py')
-rw-r--r-- | tests/cloud_tests/testcases/modules/ssh_keys_provided.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/cloud_tests/testcases/modules/ssh_keys_provided.py b/tests/cloud_tests/testcases/modules/ssh_keys_provided.py new file mode 100644 index 00000000..8f18cb94 --- /dev/null +++ b/tests/cloud_tests/testcases/modules/ssh_keys_provided.py @@ -0,0 +1,69 @@ +# This file is part of cloud-init. See LICENSE file for license information. + +"""cloud-init Integration Test Verify Script""" +from tests.cloud_tests.testcases import base + + +class TestSshKeysProvided(base.CloudTestCase): + """Test ssh keys module""" + + def test_ubuntu_authorized_keys(self): + """Test passed in key is not in list for ubuntu""" + out = self.get_data_file('auth_keys_ubuntu') + self.assertEqual('', out) + + def test_root_authorized_keys(self): + """Test passed in key is in authorized list for root""" + out = self.get_data_file('auth_keys_root') + self.assertIn('lzrkPqONphoZx0LDV86w7RUz1ksDzAdcm0tvmNRFMN1a0frDs50' + '6oA3aWK0oDk4Nmvk8sXGTYYw3iQSkOvDUUlIsqdaO+w==', out) + + def test_dsa_public(self): + """Test dsa public key passed in""" + out = self.get_data_file('dsa_public') + self.assertIn('AAAAB3NzaC1kc3MAAACBAPkWy1zbchVIN7qTgM0/yyY8q4RZS8c' + 'NM4ZpeuE5UB/Nnr6OSU/nmbO8LuM', out) + + def test_dsa_private(self): + """Test dsa private key passed in""" + out = self.get_data_file('dsa_private') + self.assertIn('MIIBuwIBAAKBgQD5Fstc23IVSDe6k4DNP8smPKuEWUvHDTOGaXr' + 'hOVAfzZ6+jklP', out) + + def test_rsa_public(self): + """Test rsa public key passed in""" + out = self.get_data_file('rsa_public') + self.assertIn('AAAAB3NzaC1yc2EAAAADAQABAAABAQC0/Ho+o3eJISydO2JvIgT' + 'LnZOtrxPl+fSvJfKDjoOLY0HB2eOjy2s2/2N6d9X9SGZ4', out) + + def test_rsa_private(self): + """Test rsa public key passed in""" + out = self.get_data_file('rsa_private') + self.assertIn('4DOkqNiUGl80Zp1RgZNohHUXlJMtAbrIlAVEk+mTmg7vjfyp2un' + 'RQvLZpMRdywBm', out) + + def test_ecdsa_public(self): + """Test ecdsa public key passed in""" + out = self.get_data_file('ecdsa_public') + self.assertIn('AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAAB' + 'BBFsS5Tvky/IC/dXhE/afxxU', out) + + def test_ecdsa_private(self): + """Test ecdsa public key passed in""" + out = self.get_data_file('ecdsa_private') + self.assertIn('AwEHoUQDQgAEWxLlO+TL8gL91eET9p/HFQbqR1A691AkJgZk3jY' + '5mpZqxgX4vcgb', out) + + def test_ed25519_public(self): + """Test ed25519 public key passed in""" + out = self.get_data_file('ed25519_public') + self.assertIn('AAAAC3NzaC1lZDI1NTE5AAAAINudAZSu4vjZpVWzId5pXmZg1M6' + 'G15dqjQ2XkNVOEnb5', out) + + def test_ed25519_private(self): + """Test ed25519 public key passed in""" + out = self.get_data_file('ed25519_private') + self.assertIn('XAAAAAtzc2gtZWQyNTUxOQAAACDbnQGUruL42aVVsyHeaV5mYNT' + 'OhteXao0Nl5DVThJ2+Q', out) + +# vi: ts=4 expandtab |