Hello community, here is the log from the commit of package python3-img-proof for openSUSE:Factory checked in at 2020-06-16 13:45:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-img-proof (Old) and /work/SRC/openSUSE:Factory/.python3-img-proof.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-img-proof" Tue Jun 16 13:45:22 2020 rev:10 rq:814764 version:5.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python3-img-proof/python3-img-proof.changes 2020-05-23 17:28:44.615577151 +0200 +++ /work/SRC/openSUSE:Factory/.python3-img-proof.new.3606/python3-img-proof.changes 2020-06-16 13:45:49.677840496 +0200 @@ -1,0 +2,11 @@ +Mon Jun 1 21:06:30 UTC 2020 - Sean Marlow <sean.mar...@suse.com> + +- Update to v5.1.0 (2020-06-01) + + Ensure region hint is in cloudregister log. + + Enable guest attrs by default in GCE. + + Fix build requires in test clause in spec. + + Integrate OCI console history method. + + Pull disk source name not devicename. + + Pull public ssh key from file. + +------------------------------------------------------------------- Old: ---- img-proof-5.0.0.tar.gz New: ---- img-proof-5.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-img-proof.spec ++++++ --- /var/tmp/diff_new_pack.SgfZ8V/_old 2020-06-16 13:45:50.881850179 +0200 +++ /var/tmp/diff_new_pack.SgfZ8V/_new 2020-06-16 13:45:50.881850179 +0200 @@ -18,7 +18,7 @@ %bcond_without test Name: python3-img-proof -Version: 5.0.0 +Version: 5.1.0 Release: 0 Summary: Command line and API for testing custom images License: GPL-3.0-or-later @@ -31,16 +31,13 @@ BuildRequires: python3-azure-mgmt-network BuildRequires: python3-azure-mgmt-resource BuildRequires: python3-boto3 -BuildRequires: python3-certifi BuildRequires: python3-click BuildRequires: python3-click-man -BuildRequires: python3-cryptography BuildRequires: python3-devel BuildRequires: python3-google-api-python-client BuildRequires: python3-google-auth BuildRequires: python3-oci-sdk BuildRequires: python3-paramiko -BuildRequires: python3-pycryptodome BuildRequires: python3-pytest BuildRequires: python3-setuptools BuildRequires: python3-testinfra @@ -54,18 +51,15 @@ Requires: python3-azure-mgmt-network Requires: python3-azure-mgmt-resource Requires: python3-boto3 -Requires: python3-certifi Requires: python3-click -Requires: python3-cryptography Requires: python3-google-api-python-client Requires: python3-google-auth Requires: python3-oci-sdk Requires: python3-paramiko -Requires: python3-pycryptodome Requires: python3-pytest Requires: python3-testinfra BuildArch: noarch -Obsoletes: python3-ipa < 5.0.0 +Obsoletes: python3-ipa < 5.1.0 %description img-proof provides a command line utility to test images in @@ -76,7 +70,7 @@ Group: Development/Languages/Python Requires: python3-susepubliccloudinfo PreReq: python3-img-proof = %{version} -Obsoletes: python3-ipa-tests < 5.0.0 +Obsoletes: python3-ipa-tests < 5.1.0 %description tests Directory of infrastructure tests for testing images. ++++++ img-proof-5.0.0.tar.gz -> img-proof-5.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/CHANGES.md new/img-proof-5.1.0/CHANGES.md --- old/img-proof-5.0.0/CHANGES.md 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/CHANGES.md 2020-06-01 22:49:26.000000000 +0200 @@ -1,3 +1,19 @@ +v5.1.0 (2020-06-01) +=================== + +- Ensure region hint is in cloudregister log. + [\#244](https://github.com/SUSE-Enceladus/ipa/pull/244) +- Enable guest attrs by default in GCE. + [\#245](https://github.com/SUSE-Enceladus/ipa/pull/245) +- Fix build requires in test clause in spec. + [\#246](https://github.com/SUSE-Enceladus/ipa/pull/246) +- Integrate OCI console history method. + [\#247](https://github.com/SUSE-Enceladus/ipa/pull/247) +- Pull disk source name not devicename. + [\#248](https://github.com/SUSE-Enceladus/ipa/pull/248) +- Pull public ssh key from file. + [\#249](https://github.com/SUSE-Enceladus/ipa/pull/249) + v5.0.0 (2020-04-21) =================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/PKG-INFO new/img-proof-5.1.0/PKG-INFO --- old/img-proof-5.0.0/PKG-INFO 2020-04-21 23:51:07.000000000 +0200 +++ new/img-proof-5.1.0/PKG-INFO 2020-06-01 22:50:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: img-proof -Version: 5.0.0 +Version: 5.1.0 Summary: Package for automated testing of cloud images. Home-page: https://github.com/SUSE-Enceladus/img-proof Author: SUSE @@ -56,11 +56,8 @@ - azure-mgmt-compute - azure-mgmt-network - azure-mgmt-resource - - certifi - Click - - cryptography - paramiko - - pycryptodome - pytest - PyYaml - testinfra diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/README.md new/img-proof-5.1.0/README.md --- old/img-proof-5.0.0/README.md 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/README.md 2020-06-01 22:49:26.000000000 +0200 @@ -48,11 +48,8 @@ - azure-mgmt-compute - azure-mgmt-network - azure-mgmt-resource -- certifi - Click -- cryptography - paramiko -- pycryptodome - pytest - PyYaml - testinfra diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof/__init__.py new/img-proof-5.1.0/img_proof/__init__.py --- old/img-proof-5.0.0/img_proof/__init__.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/img_proof/__init__.py 2020-06-01 22:49:26.000000000 +0200 @@ -22,4 +22,4 @@ __author__ = """SUSE""" __email__ = 'public-cloud-...@susecloud.net' -__version__ = '5.0.0' +__version__ = '5.1.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof/ipa_azure.py new/img-proof-5.1.0/img_proof/ipa_azure.py --- old/img-proof-5.0.0/img_proof/ipa_azure.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/img_proof/ipa_azure.py 2020-06-01 22:49:26.000000000 +0200 @@ -409,7 +409,7 @@ """ Generate SSH public key from private key. """ - key = ipa_utils.generate_public_ssh_key(self.ssh_private_key_file) + key = ipa_utils.get_public_ssh_key(self.ssh_private_key_file) return key.decode() def _is_instance_running(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof/ipa_cloud.py new/img-proof-5.1.0/img_proof/ipa_cloud.py --- old/img-proof-5.0.0/img_proof/ipa_cloud.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/img_proof/ipa_cloud.py 2020-06-01 22:49:26.000000000 +0200 @@ -223,7 +223,7 @@ to the instance. The public key is generated from the private key file. """ - key = ipa_utils.generate_public_ssh_key( + key = ipa_utils.get_public_ssh_key( self.ssh_private_key_file ).decode() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof/ipa_gce.py new/img-proof-5.1.0/img_proof/ipa_gce.py --- old/img-proof-5.0.0/img_proof/ipa_gce.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/img_proof/ipa_gce.py 2020-06-01 22:49:26.000000000 +0200 @@ -213,7 +213,7 @@ def _get_ssh_public_key(self): """Generate SSH public key from private key.""" - key = ipa_utils.generate_public_ssh_key(self.ssh_private_key_file) + key = ipa_utils.get_public_ssh_key(self.ssh_private_key_file) return '{user}:{key} {user}'.format( user=self.ssh_user, key=key.decode() @@ -354,11 +354,16 @@ """Return an instance config for launching a new instance.""" config = { 'metadata': { - 'items': [{'key': 'ssh-keys', 'value': ssh_key}] + 'items': [ + {'key': 'ssh-keys', 'value': ssh_key}, + {'key': 'enable-guest-attributes', 'value': True} + ] }, - 'service_accounts': [{ + 'serviceAccounts': [{ 'email': service_account_email, - 'scopes': ['storage-ro'] + 'scopes': [ + 'https://www.googleapis.com/auth/devstorage.read_only' + ] }], 'machineType': machine_type, 'disks': [{ @@ -466,7 +471,13 @@ def _set_image_id(self): """Set the image_id instance variable based on boot disk.""" instance = self._get_instance() - disk = self._get_disk(instance['disks'][0]['deviceName']) + + for disk_info in instance['disks']: + if disk_info.get('boot'): + disk_name = disk_info['source'].rsplit('/', maxsplit=1)[-1] + break + + disk = self._get_disk(disk_name) # Example sourceImage format: # projects/debian-cloud/global/images/opensuse-leap-15.0-YYYYMMDD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof/ipa_oci.py new/img-proof-5.1.0/img_proof/ipa_oci.py --- old/img-proof-5.0.0/img_proof/ipa_oci.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/img_proof/ipa_oci.py 2020-06-01 22:49:26.000000000 +0200 @@ -407,17 +407,34 @@ def _get_ssh_public_key(self): """Generate SSH public key from private key.""" - key = ipa_utils.generate_public_ssh_key(self.ssh_private_key_file) + key = ipa_utils.get_public_ssh_key(self.ssh_private_key_file) return key.decode() def get_console_log(self): """ Return console log output if it is available. - - Todo: The get_console_history_content method does not appear to work - during initial implementation. Consider this in the future. """ - return '' + states = [ + oci.core.models.ConsoleHistory.LIFECYCLE_STATE_SUCCEEDED + ] + + try: + history_details = oci.core.models.CaptureConsoleHistoryDetails( + instance_id=self.running_instance_id + ) + result = self.compute_composite_client.\ + capture_console_history_and_wait_for_state( + history_details, + wait_for_states=states + ).data + output = self.compute_client.get_console_history_content( + result.id + ).data + history = output.decode() + except Exception: + history = '' + + return history def _launch_instance(self): """Launch an instance of the given image.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof/ipa_utils.py new/img-proof-5.1.0/img_proof/ipa_utils.py --- old/img-proof-5.0.0/img_proof/ipa_utils.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/img_proof/ipa_utils.py 2020-06-01 22:49:26.000000000 +0200 @@ -38,9 +38,6 @@ from img_proof.ipa_constants import SYNC_POINTS from img_proof.ipa_exceptions import IpaSSHException, IpaUtilsException -from cryptography.hazmat.backends import default_backend -from cryptography.hazmat.primitives import serialization - CLIENT_CACHE = {} @@ -193,32 +190,21 @@ return '%s-%s' % (name, get_random_string(length=5)) -def generate_public_ssh_key(ssh_private_key_file): - """Generate SSH public key from private key file.""" +def get_public_ssh_key(ssh_private_key_file): + """Get SSH public key from private key file.""" + pub_key = ssh_private_key_file + '.pub' + try: - with open(ssh_private_key_file, "rb") as key_file: + with open(pub_key, "rb") as key_file: key = key_file.read() except FileNotFoundError: raise IpaUtilsException( - 'SSH private key file: %s cannot be found.' % ssh_private_key_file - ) - - try: - private_key = serialization.load_pem_private_key( - key, - password=None, - backend=default_backend() - ) - except ValueError: - raise IpaUtilsException( - 'SSH private key file: %s is not a valid key file.' - % ssh_private_key_file + 'SSH public key file: {key_path} cannot be found.'.format( + key_path=pub_key + ) ) - return private_key.public_key().public_bytes( - serialization.Encoding.OpenSSH, - serialization.PublicFormat.OpenSSH - ) + return key def get_config_values(config_path, section, default='default'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof.egg-info/PKG-INFO new/img-proof-5.1.0/img_proof.egg-info/PKG-INFO --- old/img-proof-5.0.0/img_proof.egg-info/PKG-INFO 2020-04-21 23:51:07.000000000 +0200 +++ new/img-proof-5.1.0/img_proof.egg-info/PKG-INFO 2020-06-01 22:50:18.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: img-proof -Version: 5.0.0 +Version: 5.1.0 Summary: Package for automated testing of cloud images. Home-page: https://github.com/SUSE-Enceladus/img-proof Author: SUSE @@ -56,11 +56,8 @@ - azure-mgmt-compute - azure-mgmt-network - azure-mgmt-resource - - certifi - Click - - cryptography - paramiko - - pycryptodome - pytest - PyYaml - testinfra diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof.egg-info/SOURCES.txt new/img-proof-5.1.0/img_proof.egg-info/SOURCES.txt --- old/img-proof-5.0.0/img_proof.egg-info/SOURCES.txt 2020-04-21 23:51:07.000000000 +0200 +++ new/img-proof-5.1.0/img_proof.egg-info/SOURCES.txt 2020-06-01 22:50:18.000000000 +0200 @@ -65,6 +65,7 @@ tests/data/history2.log tests/data/history2.results tests/data/ida_test +tests/data/ida_test.pub tests/data/invalid.history tests/data/test.results tests/data/injection/test_injection.yaml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/img_proof.egg-info/requires.txt new/img-proof-5.1.0/img_proof.egg-info/requires.txt --- old/img-proof-5.0.0/img_proof.egg-info/requires.txt 2020-04-21 23:51:07.000000000 +0200 +++ new/img-proof-5.1.0/img_proof.egg-info/requires.txt 2020-06-01 22:50:18.000000000 +0200 @@ -3,11 +3,8 @@ azure-mgmt-compute azure-mgmt-network azure-mgmt-resource -certifi Click -cryptography paramiko -pycryptodome pytest PyYAML testinfra diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/package/python3-img-proof.spec new/img-proof-5.1.0/package/python3-img-proof.spec --- old/img-proof-5.0.0/package/python3-img-proof.spec 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/package/python3-img-proof.spec 2020-06-01 22:49:26.000000000 +0200 @@ -18,54 +18,48 @@ %bcond_without test Name: python3-img-proof -Version: 5.0.0 +Version: 5.1.0 Release: 0 Summary: Command line and API for testing custom images License: GPL-3.0-or-later Group: Development/Languages/Python URL: https://github.com/SUSE-Enceladus/img-proof Source: https://files.pythonhosted.org/packages/source/i/img-proof/img-proof-%{version}.tar.gz +BuildRequires: python3-click-man BuildRequires: python3-devel BuildRequires: python3-setuptools -BuildRequires: python3-click-man +BuildRequires: python3-PyYAML +BuildRequires: python3-azure-common +BuildRequires: python3-azure-mgmt-compute +BuildRequires: python3-azure-mgmt-network +BuildRequires: python3-azure-mgmt-resource +BuildRequires: python3-boto3 BuildRequires: python3-click +BuildRequires: python3-google-api-python-client +BuildRequires: python3-google-auth +BuildRequires: python3-oci-sdk +BuildRequires: python3-paramiko +BuildRequires: python3-pytest +BuildRequires: python3-testinfra +%if %{with test} +BuildRequires: python3-coverage +BuildRequires: python3-pytest-cov +%endif Requires: python3-PyYAML -Requires: python3-boto3 -Requires: python3-google-auth -Requires: python3-google-api-python-client Requires: python3-azure-common Requires: python3-azure-mgmt-compute Requires: python3-azure-mgmt-network Requires: python3-azure-mgmt-resource -Requires: python3-certifi +Requires: python3-boto3 Requires: python3-click -Requires: python3-cryptography +Requires: python3-google-api-python-client +Requires: python3-google-auth +Requires: python3-oci-sdk Requires: python3-paramiko -Requires: python3-pycryptodome Requires: python3-pytest Requires: python3-testinfra -Requires: python3-oci-sdk BuildArch: noarch -%if %{with test} -BuildRequires: python3-PyYAML -BuildRequires: python3-boto3 -BuildRequires: python3-google-auth -BuildRequires: python3-google-api-python-client -BuildRequires: python3-azure-common -BuildRequires: python3-azure-mgmt-compute -BuildRequires: python3-azure-mgmt-network -BuildRequires: python3-azure-mgmt-resource -BuildRequires: python3-certifi -BuildRequires: python3-coverage -BuildRequires: python3-cryptography -BuildRequires: python3-paramiko -BuildRequires: python3-pycryptodome -BuildRequires: python3-pytest -BuildRequires: python3-pytest-cov -BuildRequires: python3-testinfra -BuildRequires: python3-oci-sdk -%endif -Obsoletes: python3-ipa < 5.0.0 +Obsoletes: python3-ipa < 5.1.0 %description img-proof provides a command line utility to test images in @@ -76,7 +70,7 @@ Group: Development/Languages/Python Requires: python3-susepubliccloudinfo PreReq: python3-img-proof = %{version} -Obsoletes: python3-ipa-tests < 5.0.0 +Obsoletes: python3-ipa-tests < 5.1.0 %description tests Directory of infrastructure tests for testing images. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/requirements.txt new/img-proof-5.1.0/requirements.txt --- old/img-proof-5.0.0/requirements.txt 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/requirements.txt 2020-06-01 22:49:26.000000000 +0200 @@ -3,11 +3,8 @@ azure-mgmt-compute azure-mgmt-network azure-mgmt-resource -certifi Click -cryptography paramiko -pycryptodome pytest PyYAML testinfra diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/setup.cfg new/img-proof-5.1.0/setup.cfg --- old/img-proof-5.0.0/setup.cfg 2020-04-21 23:51:07.000000000 +0200 +++ new/img-proof-5.1.0/setup.cfg 2020-06-01 22:50:19.000000000 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 5.0.0 +current_version = 5.1.0 commit = True tag = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/setup.py new/img-proof-5.1.0/setup.py --- old/img-proof-5.0.0/setup.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/setup.py 2020-06-01 22:49:26.000000000 +0200 @@ -43,7 +43,7 @@ setup( name='img-proof', - version='5.0.0', + version='5.1.0', description="Package for automated testing of cloud images.", long_description=readme, long_description_content_type="text/markdown", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/tests/data/ida_test.pub new/img-proof-5.1.0/tests/data/ida_test.pub --- old/img-proof-5.0.0/tests/data/ida_test.pub 1970-01-01 01:00:00.000000000 +0100 +++ new/img-proof-5.1.0/tests/data/ida_test.pub 2020-06-01 22:49:26.000000000 +0200 @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjo9ZkUp/dKKVButD+yaDkcWt4goSysXqibMoMedCp1GiKBXA6aeCY8eaenGTxo0fhIVyDX6QyNpE6OP5TYb7emrf7ze7OW2TvtxNZJOoGeT6e7rE/GzvM7UKxUVOl/h1TQ6oASD8nFQgVqjxpaALfouk0lPyBDS0WgvIGUYffYYHQaxzwebhs4ZpcBU3VYJTRFdecw0QzAakSOsUZyMWZUS7GzGR9NfoBf7H3AYp5rcbVOncFnFDZGAZxMJ65I18yU7RsLzaSzBgpUGmhEGaUHhRwGsLT+y+0oO2ftiIGgnYWa1cMDsrWypTm1gSI8+ivHZkmHI9PUDlDzrAQ4FmP \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/tests/test_ipa_azure.py new/img-proof-5.1.0/tests/test_ipa_azure.py --- old/img-proof-5.0.0/tests/test_ipa_azure.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/tests/test_ipa_azure.py 2020-06-01 22:49:26.000000000 +0200 @@ -119,9 +119,9 @@ assert str(error.value) == 'Unable to create resource management ' \ 'client: Not valid.' - @patch('img_proof.ipa_azure.ipa_utils.generate_public_ssh_key') - def test_get_ssh_public_key(self, mock_generate_pub_key): - mock_generate_pub_key.return_value = b'pub-key' + @patch('img_proof.ipa_azure.ipa_utils.get_public_ssh_key') + def test_get_ssh_public_key(self, mock_get_pub_key): + mock_get_pub_key.return_value = b'pub-key' provider = self.helper_get_provider() key = provider._get_ssh_public_key() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/tests/test_ipa_cloud.py new/img-proof-5.1.0/tests/test_ipa_cloud.py --- old/img-proof-5.0.0/tests/test_ipa_cloud.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/tests/test_ipa_cloud.py 2020-06-01 22:49:26.000000000 +0200 @@ -127,9 +127,9 @@ ipa_utils.clear_cache() - @patch('img_proof.ipa_cloud.ipa_utils.generate_public_ssh_key') - def test_cloud_get_user_data(self, mock_generate_ssh_key): - mock_generate_ssh_key.return_value = b'testkey12345' + @patch('img_proof.ipa_cloud.ipa_utils.get_public_ssh_key') + def test_cloud_get_user_data(self, mock_get_ssh_key): + mock_get_ssh_key.return_value = b'testkey12345' provider = IpaCloud(*args, **self.kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/tests/test_ipa_gce.py new/img-proof-5.1.0/tests/test_ipa_gce.py --- old/img-proof-5.0.0/tests/test_ipa_gce.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/tests/test_ipa_gce.py 2020-06-01 22:49:26.000000000 +0200 @@ -289,7 +289,7 @@ ) assert 'metadata' in config - assert 'service_accounts' in config + assert 'serviceAccounts' in config assert 'machineType' in config assert 'disks' in config assert 'networkInterfaces' in config @@ -372,7 +372,12 @@ def test_gce_set_image_id(self, mock_get_instance, mock_get_disk): """Test gce cloud set image id method.""" instance = { - 'disks': [{'deviceName': 'disk123'}] + 'disks': [{ + 'deviceName': 'disk123', + 'boot': True, + 'source': 'https://www.googleapis.com/compute/v1/projects/' + 'test/zones/us-west1-a/disks/disk123' + }] } disk = { 'sourceImage': 'projects/suse/global/images/opensuse-leap-15.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/tests/test_ipa_oci.py new/img-proof-5.1.0/tests/test_ipa_oci.py --- old/img-proof-5.0.0/tests/test_ipa_oci.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/tests/test_ipa_oci.py 2020-06-01 22:49:26.000000000 +0200 @@ -437,12 +437,12 @@ cloud._get_vnic_attachments(compartment_id, instance_id) - @patch('img_proof.ipa_utils.generate_public_ssh_key') + @patch('img_proof.ipa_utils.get_public_ssh_key') @patch.object(OCICloud, '__init__') - def test_get_ssh_public_key(self, mock_init, mock_generate_public_ssh_key): + def test_get_ssh_public_key(self, mock_init, mock_get_public_ssh_key): """Test oci get ssh public key method.""" mock_init.return_value = None - mock_generate_public_ssh_key.return_value = b'key123' + mock_get_public_ssh_key.return_value = b'key123' cloud = OCICloud(**self.kwargs) cloud.ssh_private_key_file = 'tests/oci/api_key.pem' @@ -454,8 +454,18 @@ def test_get_console_log(self, mock_init): """Test oci get console log method.""" mock_init.return_value = None + response = MagicMock() + response.data = b'Test output' + client = MagicMock() + client.get_console_history_content.return_value = response + cloud = OCICloud(**self.kwargs) - cloud.get_console_log() + cloud.compute_client = client + cloud.compute_composite_client = client + cloud.running_instance_id = 'instance-123' + + log = cloud.get_console_log() + assert log == 'Test output' @patch.object(OCICloud, '_wait_on_instance') @patch.object(OCICloud, '_terminate_instance') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/img-proof-5.0.0/usr/share/lib/img_proof/tests/SLES/test_sles_smt_reg.py new/img-proof-5.1.0/usr/share/lib/img_proof/tests/SLES/test_sles_smt_reg.py --- old/img-proof-5.0.0/usr/share/lib/img_proof/tests/SLES/test_sles_smt_reg.py 2020-04-21 23:50:16.000000000 +0200 +++ new/img-proof-5.1.0/usr/share/lib/img_proof/tests/SLES/test_sles_smt_reg.py 2020-06-01 22:49:26.000000000 +0200 @@ -1,15 +1,19 @@ import shlex -def test_sles_smt_reg(check_cloud_register, - determine_provider, - get_smt_server_name, - get_smt_servers, - host): +def test_sles_smt_reg( + check_cloud_register, + determine_provider, + get_smt_server_name, + get_smt_servers, + host +): provider = determine_provider() + # ensure instance registered successfully assert check_cloud_register() + # ensure the correct smt/rmt ip is used servers = get_smt_servers(provider) smt_ips = [server['ip'] for server in servers] @@ -19,3 +23,9 @@ smt_ip = shlex.split(result.stdout)[0] assert smt_ip in smt_ips + + # ensure region hint is in log + cloud_register_log = host.file('/var/log/cloudregister') + assert cloud_register_log.contains( + 'INFO:Region server arguments: ?regionHint=' + )