Hello community, here is the log from the commit of package python3-ipa for openSUSE:Factory checked in at 2018-06-19 12:02:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-ipa (Old) and /work/SRC/openSUSE:Factory/.python3-ipa.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-ipa" Tue Jun 19 12:02:31 2018 rev:5 rq:617023 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python3-ipa/python3-ipa.changes 2018-06-02 12:14:52.957972322 +0200 +++ /work/SRC/openSUSE:Factory/.python3-ipa.new/python3-ipa.changes 2018-06-19 12:02:35.648414208 +0200 @@ -1,0 +2,11 @@ +Thu Jun 14 20:28:43 UTC 2018 - sean.mar...@suse.com + +- Update to v1.2.0 (2018-06-14) + + Add SLES test to ensure root user has no password. + + Fix typo in force new reg test. + + Add --timeout cli and configuration option. + + Add a test to wait on registration for on-demand instances. + + Add azure tests to check billing tag in metadata. + + Handle custom Azure image vhd id's. + +------------------------------------------------------------------- Old: ---- python3-ipa-1.1.1.tar.gz New: ---- python3-ipa-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-ipa.spec ++++++ --- /var/tmp/diff_new_pack.zWNyDH/_old 2018-06-19 12:02:36.228392674 +0200 +++ /var/tmp/diff_new_pack.zWNyDH/_new 2018-06-19 12:02:36.232392525 +0200 @@ -18,7 +18,7 @@ %bcond_without test Name: python3-ipa -Version: 1.1.1 +Version: 1.2.0 Release: 0 Summary: Command line and API for testing custom images License: GPL-3.0-or-later ++++++ python3-ipa-1.1.1.tar.gz -> python3-ipa-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/CHANGES.asciidoc new/python3-ipa-1.2.0/CHANGES.asciidoc --- old/python3-ipa-1.1.1/CHANGES.asciidoc 2018-05-16 22:43:59.000000000 +0200 +++ new/python3-ipa-1.2.0/CHANGES.asciidoc 2018-06-14 22:14:06.000000000 +0200 @@ -1,5 +1,19 @@ = Changelog +== v1.2.0 (2018-06-14) + +* Add SLES test to ensure root user has no password. + link:https://github.com/SUSE/ipa/pull/90[#90] +* Fix typo in force new reg test. +* Add --timeout cli and configuration option. + link:https://github.com/SUSE/ipa/pull/86[#86] +* Add a test to wait on registration for on-demand instances. + link:https://github.com/SUSE/ipa/pull/87[#87] +* Add azure tests to check billing tag in metadata. + link:https://github.com/SUSE/ipa/pull/88[#88] +* Handle custom Azure image vhd id's. + link:https://github.com/SUSE/ipa/pull/89[#89] + == v1.1.1 (2018-05-16) * Cleanup typo in docs. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/PKG-INFO new/python3-ipa-1.2.0/PKG-INFO --- old/python3-ipa-1.1.1/PKG-INFO 2018-05-16 22:55:56.000000000 +0200 +++ new/python3-ipa-1.2.0/PKG-INFO 2018-06-14 22:21:09.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python3-ipa -Version: 1.1.1 +Version: 1.2.0 Summary: Package for automated testing of cloud images. Home-page: https://github.com/SUSE/pubcloud/ipa Author: SUSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/__init__.py new/python3-ipa-1.2.0/ipa/__init__.py --- old/python3-ipa-1.1.1/ipa/__init__.py 2018-05-16 22:44:47.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/__init__.py 2018-06-14 22:15:25.000000000 +0200 @@ -22,4 +22,4 @@ __author__ = """SUSE""" __email__ = 'public-cloud-...@susecloud.net' -__version__ = '1.1.1' +__version__ = '1.2.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/ipa_azure.py new/python3-ipa-1.2.0/ipa/ipa_azure.py --- old/python3-ipa-1.1.1/ipa/ipa_azure.py 2018-05-15 21:01:19.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/ipa_azure.py 2018-06-08 18:25:25.000000000 +0200 @@ -62,6 +62,7 @@ subnet_id=None, test_dirs=None, test_files=None, + timeout=None, vnet_name=None, vnet_resource_group=None): """Initialize Azure Provider class.""" @@ -82,7 +83,8 @@ results_dir, running_instance_id, test_dirs, - test_files) + test_files, + timeout) if subnet_id and not (vnet_name and vnet_resource_group): raise AzureProviderException( @@ -204,6 +206,39 @@ 'Unable to create resource group: {0}.'.format(error) ) + def _create_storage_profile(self): + """ + Create the storage profile for the instance. + + Image reference can be a custom image name or a published urn. + """ + if self.image_publisher: + storage_profile = { + 'image_reference': { + 'publisher': self.image_publisher, + 'offer': self.image_offer, + 'sku': self.image_sku, + 'version': self.image_version + }, + } + else: + for image in self.compute.images.list(): + if image.name == self.image_id: + image_id = image.id + break + else: + raise AzureProviderException( + 'Image with name {0} not found.'.format(self.image_id) + ) + + storage_profile = { + 'image_reference': { + 'id': image_id + } + } + + return storage_profile + def _create_subnet(self, resource_group_name, subnet_name, vnet_name): """ Create a subnet in the provided vnet and resource group. @@ -281,14 +316,7 @@ }] } - storage_profile = { - 'image_reference': { - 'publisher': self.image_publisher, - 'offer': self.image_offer, - 'sku': self.image_sku, - 'version': self.image_version - }, - } + storage_profile = self._create_storage_profile() os_profile = { 'computer_name': self.running_instance_id, @@ -430,7 +458,7 @@ raise else: # Ensure VM is in the running state. - self._wait_on_instance('VM running') + self._wait_on_instance('VM running', timeout=self.timeout) def _process_image_id(self): """ @@ -449,10 +477,7 @@ self.image_sku = image_info[2] self.image_version = image_info[3] except Exception: - raise AzureProviderException( - 'Image ID is invalid. Format must match ' - '{Publisher}:{Offer}:{Sku}:{Version}.' - ) + self.image_publisher = None def _set_default_resource_names(self): """ @@ -473,10 +498,13 @@ instance = self._get_instance() image_info = instance.storage_profile.image_reference - self.image_id = ':'.join([ - image_info.publisher, image_info.offer, - image_info.sku, image_info.version - ]) + if image_info.publisher: + self.image_id = ':'.join([ + image_info.publisher, image_info.offer, + image_info.sku, image_info.version + ]) + else: + self.image_id = image_info.id.rsplit('/', maxsplit=1)[1] def _set_instance_ip(self): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/ipa_controller.py new/python3-ipa-1.2.0/ipa/ipa_controller.py --- old/python3-ipa-1.1.1/ipa/ipa_controller.py 2018-05-15 21:01:19.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/ipa_controller.py 2018-06-07 15:46:18.000000000 +0200 @@ -59,6 +59,7 @@ subnet_id=None, test_dirs=None, tests=None, + timeout=None, vnet_name=None, vnet_resource_group=None): """Creates a cloud provider instance and initiates testing.""" @@ -100,6 +101,7 @@ subnet_id=subnet_id, test_dirs=test_dirs, test_files=tests, + timeout=timeout, vnet_name=vnet_name, vnet_resource_group=vnet_resource_group ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/ipa_ec2.py new/python3-ipa-1.2.0/ipa/ipa_ec2.py --- old/python3-ipa-1.1.1/ipa/ipa_ec2.py 2018-05-15 21:01:19.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/ipa_ec2.py 2018-06-07 15:46:18.000000000 +0200 @@ -64,6 +64,7 @@ subnet_id=None, test_dirs=None, test_files=None, + timeout=None, vnet_name=None, # Not used in EC2 vnet_resource_group=None # Not used in EC2 ): @@ -85,7 +86,8 @@ results_dir, running_instance_id, test_dirs, - test_files) + test_files, + timeout) self.account_name = account_name if not self.account_name: @@ -263,7 +265,10 @@ instance = self.compute_driver.create_node(**kwargs) - self.compute_driver.wait_until_running([instance]) + self.compute_driver.wait_until_running( + [instance], + timeout=self.timeout + ) self.running_instance_id = instance.id def _set_image_id(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/ipa_gce.py new/python3-ipa-1.2.0/ipa/ipa_gce.py --- old/python3-ipa-1.1.1/ipa/ipa_gce.py 2018-05-15 21:01:19.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/ipa_gce.py 2018-06-07 15:46:18.000000000 +0200 @@ -65,6 +65,7 @@ subnet_id=None, test_dirs=None, test_files=None, + timeout=None, vnet_name=None, # Not used in GCE vnet_resource_group=None # Not used in GCE ): @@ -85,7 +86,8 @@ results_dir, running_instance_id, test_dirs, - test_files) + test_files, + timeout) self.service_account_file = ( service_account_file or self._get_value( @@ -226,7 +228,10 @@ ) ) - self.compute_driver.wait_until_running([instance]) + self.compute_driver.wait_until_running( + [instance], + timeout=self.timeout + ) def _set_image_id(self): """If existing image used get image id.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/ipa_libcloud.py new/python3-ipa-1.2.0/ipa/ipa_libcloud.py --- old/python3-ipa-1.1.1/ipa/ipa_libcloud.py 2018-01-24 21:22:13.000000000 +0100 +++ new/python3-ipa-1.2.0/ipa/ipa_libcloud.py 2018-06-07 15:46:18.000000000 +0200 @@ -54,13 +54,16 @@ """Start the instance.""" instance = self._get_instance() self.compute_driver.ex_start_node(instance) - self.compute_driver.wait_until_running([instance]) + self.compute_driver.wait_until_running( + [instance], + timeout=self.timeout + ) def _stop_instance(self): """Stop the instance.""" instance = self._get_instance() self.compute_driver.ex_stop_node(instance) - self._wait_on_instance('stopped') + self._wait_on_instance('stopped', timeout=self.timeout) def _terminate_instance(self): """Terminate the instance.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/ipa_provider.py new/python3-ipa-1.2.0/ipa/ipa_provider.py --- old/python3-ipa-1.1.1/ipa/ipa_provider.py 2018-05-15 21:01:19.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/ipa_provider.py 2018-06-13 21:29:24.000000000 +0200 @@ -76,7 +76,8 @@ results_dir=None, running_instance_id=None, test_dirs=None, - test_files=None): + test_files=None, + timeout=None): """Initialize base provider class.""" super(IpaProvider, self).__init__() log_level = log_level or logging.INFO @@ -107,6 +108,11 @@ self.instance_type = self._get_value(instance_type) self.running_instance_id = self._get_value(running_instance_id) self.test_files = list(self._get_value(test_files, default=[])) + self.timeout = self._get_value( + timeout, + config_key='timeout', + default=600 + ) self.history_log = self._get_value( history_log, @@ -167,7 +173,8 @@ return ipa_utils.get_ssh_client( self.instance_ip, self.ssh_private_key, - self.ssh_user + self.ssh_user, + timeout=self.timeout ) def _get_value(self, arg, config_key=None, default=None): @@ -375,17 +382,19 @@ test_log=self.log_file ) - def _wait_on_instance(self, state, attempts=30): + def _wait_on_instance(self, state, timeout=600, wait_period=10): """Wait until instance is in given state.""" current_state = 'Undefined' - while attempts: + start = time.time() + end = start + timeout + + while time.time() < end: current_state = self._get_instance_state() if state == current_state: return - attempts -= 1 - time.sleep(10) + time.sleep(wait_period) raise IpaProviderException( 'Instance has not arrived at the given state: {state}'.format( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/ipa_utils.py new/python3-ipa-1.2.0/ipa/ipa_utils.py --- old/python3-ipa-1.1.1/ipa/ipa_utils.py 2018-05-16 22:36:17.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/ipa_utils.py 2018-06-13 21:29:29.000000000 +0200 @@ -273,28 +273,30 @@ ssh_private_key, ssh_user='root', port=22, - attempts=3, - timeout=10): + timeout=600, + wait_period=10): """Attempt to establish and test ssh connection.""" if ip in CLIENT_CACHE: return CLIENT_CACHE[ip] + start = time.time() + end = start + timeout + client = None - while attempts: + while time.time() < end: try: client = establish_ssh_connection( ip, ssh_private_key, ssh_user, port, - timeout=timeout + timeout=wait_period ) execute_ssh_command(client, 'ls') except: # noqa: E722 if client: client.close() - attempts -= 1 - timeout += timeout + wait_period += wait_period else: CLIENT_CACHE[ip] = client return client diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/ipa/scripts/cli.py new/python3-ipa-1.2.0/ipa/scripts/cli.py --- old/python3-ipa-1.1.1/ipa/scripts/cli.py 2018-05-15 21:01:19.000000000 +0200 +++ new/python3-ipa-1.2.0/ipa/scripts/cli.py 2018-06-07 15:46:18.000000000 +0200 @@ -210,6 +210,12 @@ help='Directories to search for tests.' ) @click.option( + '--timeout', + help='The time to wait when establishing an SSH ' + 'connection and for instances to change state.', + type=click.IntRange(min=1) +) +@click.option( '--vnet-name', help='Azure virtual network name to attach network interface.' ) @@ -248,6 +254,7 @@ ssh_user, subnet_id, test_dirs, + timeout, vnet_name, vnet_resource_group, provider, @@ -282,6 +289,7 @@ subnet_id, test_dirs, tests, + timeout, vnet_name, vnet_resource_group ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa-list.1 new/python3-ipa-1.2.0/man/man1/ipa-list.1 --- old/python3-ipa-1.1.1/man/man1/ipa-list.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa-list.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA LIST" "1" "28-Mar-2018" "" "ipa list Manual" +.TH "IPA LIST" "1" "31-May-2018" "" "ipa list Manual" .SH NAME ipa\-list \- Print a list of test files or test cases. .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa-results-clear.1 new/python3-ipa-1.2.0/man/man1/ipa-results-clear.1 --- old/python3-ipa-1.1.1/man/man1/ipa-results-clear.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa-results-clear.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA RESULTS CLEAR" "1" "28-Mar-2018" "" "ipa results clear Manual" +.TH "IPA RESULTS CLEAR" "1" "31-May-2018" "" "ipa results clear Manual" .SH NAME ipa\-results\-clear \- Clear the results from the history file. .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa-results-delete.1 new/python3-ipa-1.2.0/man/man1/ipa-results-delete.1 --- old/python3-ipa-1.1.1/man/man1/ipa-results-delete.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa-results-delete.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA RESULTS DELETE" "1" "28-Mar-2018" "" "ipa results delete Manual" +.TH "IPA RESULTS DELETE" "1" "31-May-2018" "" "ipa results delete Manual" .SH NAME ipa\-results\-delete \- Delete the specified history item from the... .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa-results-list.1 new/python3-ipa-1.2.0/man/man1/ipa-results-list.1 --- old/python3-ipa-1.1.1/man/man1/ipa-results-list.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa-results-list.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA RESULTS LIST" "1" "28-Mar-2018" "" "ipa results list Manual" +.TH "IPA RESULTS LIST" "1" "31-May-2018" "" "ipa results list Manual" .SH NAME ipa\-results\-list \- Display list of results history. .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa-results-show.1 new/python3-ipa-1.2.0/man/man1/ipa-results-show.1 --- old/python3-ipa-1.1.1/man/man1/ipa-results-show.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa-results-show.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA RESULTS SHOW" "1" "28-Mar-2018" "" "ipa results show Manual" +.TH "IPA RESULTS SHOW" "1" "31-May-2018" "" "ipa results show Manual" .SH NAME ipa\-results\-show \- Print test results info from provided results... .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa-results.1 new/python3-ipa-1.2.0/man/man1/ipa-results.1 --- old/python3-ipa-1.1.1/man/man1/ipa-results.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa-results.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA RESULTS" "1" "28-Mar-2018" "" "ipa results Manual" +.TH "IPA RESULTS" "1" "31-May-2018" "" "ipa results Manual" .SH NAME ipa\-results \- Process provided history log and results... .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa-test.1 new/python3-ipa-1.2.0/man/man1/ipa-test.1 --- old/python3-ipa-1.1.1/man/man1/ipa-test.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa-test.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA TEST" "1" "28-Mar-2018" "" "ipa test Manual" +.TH "IPA TEST" "1" "31-May-2018" "" "ipa test Manual" .SH NAME ipa\-test \- Test image in the given framework using the... .SH SYNOPSIS @@ -35,6 +35,9 @@ \fB\-i,\fP \-\-image\-id TEXT The ID of the image used for instance. .TP +\fB\-\-inject\fP PATH +Path to an injection yaml config file. +.TP \fB\-t,\fP \-\-instance\-type TEXT Instance type to use for launching machine. .TP @@ -83,6 +86,9 @@ \fB\-\-test\-dirs\fP TEXT Directories to search for tests. .TP +\fB\-\-timeout\fP INTEGER RANGE +The time to wait when establishing an SSH connection and for instances to change state. +.TP \fB\-\-vnet\-name\fP TEXT Azure virtual network name to attach network interface. .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/man/man1/ipa.1 new/python3-ipa-1.2.0/man/man1/ipa.1 --- old/python3-ipa-1.1.1/man/man1/ipa.1 2018-03-30 17:53:45.000000000 +0200 +++ new/python3-ipa-1.2.0/man/man1/ipa.1 2018-06-14 22:05:23.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "IPA" "1" "28-Mar-2018" "" "ipa Manual" +.TH "IPA" "1" "31-May-2018" "" "ipa Manual" .SH NAME ipa \- Ipa provides a Python API and command line... .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/package/python3-ipa.spec new/python3-ipa-1.2.0/package/python3-ipa.spec --- old/python3-ipa-1.1.1/package/python3-ipa.spec 2018-05-16 22:44:47.000000000 +0200 +++ new/python3-ipa-1.2.0/package/python3-ipa.spec 2018-06-14 22:15:25.000000000 +0200 @@ -17,7 +17,7 @@ %bcond_without test Name: python3-ipa -Version: 1.1.1 +Version: 1.2.0 Release: 0 Summary: Command line and API for testing custom images License: GPL-3.0+ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/python3_ipa.egg-info/PKG-INFO new/python3-ipa-1.2.0/python3_ipa.egg-info/PKG-INFO --- old/python3-ipa-1.1.1/python3_ipa.egg-info/PKG-INFO 2018-05-16 22:55:56.000000000 +0200 +++ new/python3-ipa-1.2.0/python3_ipa.egg-info/PKG-INFO 2018-06-14 22:21:08.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: python3-ipa -Version: 1.1.1 +Version: 1.2.0 Summary: Package for automated testing of cloud images. Home-page: https://github.com/SUSE/pubcloud/ipa Author: SUSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/python3_ipa.egg-info/SOURCES.txt new/python3-ipa-1.2.0/python3_ipa.egg-info/SOURCES.txt --- old/python3-ipa-1.1.1/python3_ipa.egg-info/SOURCES.txt 2018-05-16 22:55:56.000000000 +0200 +++ new/python3-ipa-1.2.0/python3_ipa.egg-info/SOURCES.txt 2018-06-14 22:21:09.000000000 +0200 @@ -97,10 +97,15 @@ usr/share/lib/ipa/tests/SLES/test_sles_motd.py usr/share/lib/ipa/tests/SLES/test_sles_on_demand.yaml usr/share/lib/ipa/tests/SLES/test_sles_repos.py +usr/share/lib/ipa/tests/SLES/test_sles_root_pass.py usr/share/lib/ipa/tests/SLES/test_sles_smt_reg.py +usr/share/lib/ipa/tests/SLES/test_sles_wait_on_registration.py usr/share/lib/ipa/tests/SLES/test_sles_zypper_migration.py +usr/share/lib/ipa/tests/SLES/Azure/conftest.py usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure.yaml +usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_infiniband.py +usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_services.py usr/share/lib/ipa/tests/SLES/EC2/test_sles_ec2.yaml usr/share/lib/ipa/tests/SLES/EC2/test_sles_ec2_services.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/setup.cfg new/python3-ipa-1.2.0/setup.cfg --- old/python3-ipa-1.1.1/setup.cfg 2018-05-16 22:55:56.000000000 +0200 +++ new/python3-ipa-1.2.0/setup.cfg 2018-06-14 22:21:09.000000000 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.1.1 +current_version = 1.2.0 commit = True tag = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/setup.py new/python3-ipa-1.2.0/setup.py --- old/python3-ipa-1.1.1/setup.py 2018-05-16 22:44:47.000000000 +0200 +++ new/python3-ipa-1.2.0/setup.py 2018-06-14 22:15:25.000000000 +0200 @@ -60,7 +60,7 @@ setup( name='python3-ipa', - version='1.1.1', + version='1.2.0', description="Package for automated testing of cloud images.", long_description=readme, author="SUSE", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/tests/test_ipa_azure.py new/python3-ipa-1.2.0/tests/test_ipa_azure.py --- old/python3-ipa-1.1.1/tests/test_ipa_azure.py 2018-03-28 15:36:07.000000000 +0200 +++ new/python3-ipa-1.2.0/tests/test_ipa_azure.py 2018-06-08 18:25:25.000000000 +0200 @@ -159,6 +159,28 @@ assert self.client.virtual_networks.create_or_update.call_count == 1 assert provider.running_instance_id == 'azure-test-instance' + @patch.object(AzureProvider, '_wait_on_instance') + @patch('ipa.ipa_utils.generate_instance_name') + def test_create_storage_profile( + self, mock_generate_instance_name, mock_wait_on_instance + ): + """Test launch instance method.""" + mock_generate_instance_name.return_value = 'azure-test-instance' + self.kwargs['image_id'] = 'custom-image.vhd' + + image = MagicMock() + image.name = 'custom-image.vhd' + image.id = '/id/custom-image.vhd' + self.client.images.list.return_value = [image] + + provider = self.helper_get_provider() + + provider._process_image_id() + storage_profile = provider._create_storage_profile() + + assert storage_profile['image_reference']['id'] == \ + '/id/custom-image.vhd' + def test_process_image_id(self): provider = self.helper_get_provider() provider._process_image_id() @@ -168,15 +190,12 @@ assert provider.image_sku == 'image' assert provider.image_version == 'id' - def test_process_image_id_invalid(self): + def test_process_custom_image_id(self): provider = self.helper_get_provider() - provider.image_id = 'invalid:id' + provider.image_id = 'custom-image.vhd' - with pytest.raises(AzureProviderException) as error: - provider._process_image_id() - - assert str(error.value) == 'Image ID is invalid. Format must match ' \ - '{Publisher}:{Offer}:{Sku}:{Version}.' + provider._process_image_id() + assert provider.image_publisher is None def test_set_default_resource_names(self): provider = self.helper_get_provider() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/tests/test_ipa_utils.py new/python3-ipa-1.2.0/tests/test_ipa_utils.py --- old/python3-ipa-1.1.1/tests/test_ipa_utils.py 2018-05-10 18:17:37.000000000 +0200 +++ new/python3-ipa-1.2.0/tests/test_ipa_utils.py 2018-06-07 15:46:18.000000000 +0200 @@ -77,15 +77,21 @@ ipa_utils.clear_cache() +@patch.object(time, 'time') @patch.object(time, 'sleep') @patch.object(paramiko.SSHClient, 'connect') -def test_utils_ssh_connect_exception(mock_connect, mock_sleep): +def test_utils_ssh_connect_exception(mock_connect, mock_sleep, mock_time): """Test exception raised connecting to ssh.""" mock_connect.side_effect = paramiko.ssh_exception.SSHException('ERROR!') mock_sleep.return_value = None + mock_time.side_effect = [0, 0, 2] with pytest.raises(IpaSSHException) as error: - ipa_utils.get_ssh_client(LOCALHOST, 'tests/data/ida_test') + ipa_utils.get_ssh_client( + LOCALHOST, + 'tests/data/ida_test', + timeout=1 + ) assert str(error.value) == 'Attempt to establish SSH connection failed.' assert mock_connect.call_count > 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/Azure/conftest.py new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/Azure/conftest.py --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/Azure/conftest.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/Azure/conftest.py 2018-06-07 15:46:18.000000000 +0200 @@ -0,0 +1,14 @@ +import json +import pytest + + +@pytest.fixture() +def get_azure_billing_tag(host): + def f(): + result = host.run( + 'sudo azuremetadata --tag' + ) + + data = json.loads(result.stdout.strip()) + return data['billingTag'] + return f \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py 2018-06-07 15:46:18.000000000 +0200 @@ -0,0 +1,4 @@ + + +def test_sles_azure_billing_tag(get_azure_billing_tag): + assert get_azure_billing_tag() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml 2018-06-07 15:46:18.000000000 +0200 @@ -0,0 +1,2 @@ +tests: + - test_sles_azure_billing_tag diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/infra/test_sles_force_new_reg.py new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/infra/test_sles_force_new_reg.py --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/infra/test_sles_force_new_reg.py 2017-09-20 20:58:18.000000000 +0200 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/infra/test_sles_force_new_reg.py 2018-06-07 15:45:44.000000000 +0200 @@ -1,5 +1,5 @@ def test_sles_force_new_reg(check_cloud_register, host): host.run("sudo sh -c ': > /var/log/cloudregister'") - result = host.run('sudo registsercloudguest --force-new') + result = host.run('sudo registercloudguest --force-new') assert result.rc == 0 assert check_cloud_register() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles.yaml new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles.yaml --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles.yaml 2018-01-24 21:22:13.000000000 +0100 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles.yaml 2018-05-21 23:42:08.000000000 +0200 @@ -2,6 +2,7 @@ - test_soft_reboot - test_sles_motd - test_sles_license + - test_sles_root_pass - test_hard_reboot - test_sles_hostname - test_sles_haveged diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles_on_demand.yaml new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles_on_demand.yaml --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles_on_demand.yaml 2017-09-19 20:57:32.000000000 +0200 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles_on_demand.yaml 2018-06-07 15:46:18.000000000 +0200 @@ -1,4 +1,5 @@ tests: + - test_sles_wait_on_registration - test_update - test_sles_repos - test_sles_smt_reg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles_root_pass.py new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles_root_pass.py --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles_root_pass.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles_root_pass.py 2018-06-08 18:25:25.000000000 +0200 @@ -0,0 +1,9 @@ +import shlex + + +def test_sles_root_pass(host): + # Ensure root does not have a password + result = host.run( + 'sudo passwd --status root' + ) + assert shlex.split(result.stdout.strip())[1] in ['L', 'NP'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles_wait_on_registration.py new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles_wait_on_registration.py --- old/python3-ipa-1.1.1/usr/share/lib/ipa/tests/SLES/test_sles_wait_on_registration.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python3-ipa-1.2.0/usr/share/lib/ipa/tests/SLES/test_sles_wait_on_registration.py 2018-06-07 15:46:18.000000000 +0200 @@ -0,0 +1,18 @@ +import time + + +def test_sles_wait_on_registration(host): + start = time.time() + end = start + 600 + + while time.time() < end: + result = host.run('pgrep registercloud') + + if not result.stdout.strip(): + break + else: + time.sleep(10) + else: + raise Exception( + 'Registration did not finish properly for on-demand instance.' + )