From 8622491c29f30862a1a1d7ad2cba023981acc8ce Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 6 Nov 2017 17:39:00 -0500 Subject: tests: integration test cleanup and full pass of nocloud-kvm. Integration test harness changes: * Enable collection of console log in nocloud-kvm and lxd. * Collect the console log to results for all test runs. * change 'tmpfile' to pick name locally instead of using 'mktemp'. * drop the 'instance' attribute from nocloud-kvm Image and demote LXDImage.instance to a private attribute. This is because Images do not actually have instances. (LXDImage internally uses a booted system to modify the image). * Add 'TargetBase' as a superclass of Image and Instance providing implementations of execute, read_data, write_data, pull_file, and push_file. These all depend on an implementation of _execute. * Improve '_execute' implementations to support accepting stdin. * execute supports 'rcs=False' meaning 'do not raise exception'. * Drop support for pylxd < 2.2. older versions cannot determine exit code of 'execute', which makes them unusable. * make NoCloudKVMInstance._execute run as root via sudo. This required some changes so that 'hostname' could be reverse-looked up in order to avoid sudo taking a long time (~20 seconds). * re-use existing ssh connection in nocloud-kvm. Test changes here: * do not use /tmp, but rather /var/tmp (LP: #1707222) * make keys_to_console assertions more strict. * change user test cases to always add default (ubuntu) user so that nocloud-kvm's execute which operates over ssh can work. --- tests/cloud_tests/testcases/modules/ssh_keys_provided.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'tests/cloud_tests/testcases/modules/ssh_keys_provided.py') diff --git a/tests/cloud_tests/testcases/modules/ssh_keys_provided.py b/tests/cloud_tests/testcases/modules/ssh_keys_provided.py index 544649da..add3f469 100644 --- a/tests/cloud_tests/testcases/modules/ssh_keys_provided.py +++ b/tests/cloud_tests/testcases/modules/ssh_keys_provided.py @@ -7,17 +7,6 @@ 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') -- cgit v1.2.3