Commit Graph

135 Commits

Author SHA1 Message Date
Eric Fried ac3c90236c Remove blacklisted py3 xen tests
Xen UT failures seem to have cleared up, which may or may not have
anything to do with [1]. Remove the blacklist file and get these back
in the py3 jobs.

[1] https://review.openstack.org/#/c/591061/

Change-Id: Iacc1ae01f535caed64793d57b757ea07a8c46620
2018-08-14 16:34:19 +00:00
Takashi NATSUME b20682f913 Remove mox in unit/virt/xenapi/test_vmops.py
Replace mox with mock in
nova/tests/unit/virt/xenapi/test_vmops.py.

The 'stubout_session' will be modified
at the same time when nova/tests/unit/virt/xenapi/stubs.by
is modified in another patch.

Change-Id: I192a67585d81cc76980139ee8f8f046d4029ecfe
Implements: blueprint mox-removal
2018-05-06 22:31:05 +00:00
ChangBo Guo(gcb) 1b7191f4f2 Skip unit tests for SSL + py3
When we request something from SSL wrapped app using py3 and we do
not get answer at all. In case of unit tests we face test timeout.
So, skip these tests until related bug is fixed. This also enables
other test cases in this module.

Related-Bug: #1482633
Partially-Implements: blueprint goal-python35

Change-Id: I4933e47b0759716f387ec26e3bd8a4e725eb4f91
2017-03-02 14:30:16 +08:00
Maciej Szankin 6a571a4493 Remove invalid tests-py3 whitelist item
The tests for XenAPI plugins were introduced with change [1].
This change also appended them to the python3 test whitelist,
as the functionality could only be executed on python2.4 environment.
The aforementioned changes were removed with change [2], but
the whitelist item was left behind. This change removes the obsolete
line.

[1] 2aa81e9ef6
[2] 21149582ff

Change-Id: Ibc15e9a06adf34512eda904d0bb3eba1eed04784
2017-02-27 18:11:11 +00:00
ChangBo Guo(gcb) 6eda84422a Enable virt.vmwareapi test cases on Python
Enable unstable test one by one and figure out failure easily when
it fails again.

Partially-Implements: blueprint goal-python35

Change-Id: I6c373abff887fc44add59a6dbb6620af0340915d
2017-01-18 11:14:24 +08:00
ChangBo Guo(gcb) 7d67cdf269 Enable virt.test_virt_drivers.AbstractDriverTestCase on Python 3
Enable unstable test one by one and figure out failure easily when
it fails again.

Partially-Implements: blueprint goal-python35
Change-Id: I15d5562b46bb87cd6849a01670f81d31418bf971
2017-01-18 11:13:53 +08:00
ChangBo Guo(gcb) d28ca27ee1 Port compute.test_user_data.ServersControllerCreateTest to Python 3
base64.b64encode accept bytes-like object on Python 3.

Partially-Implements: blueprint goal-python35

Change-Id: I116840888ee96c11781f1cbba4bbf9ea75aff61a
2017-01-18 11:08:09 +08:00
Jenkins cee14139bd Merge "Enable TestOSAPIFixture.test_responds_to_version on Python 3" 2017-01-16 03:14:45 +00:00
Jenkins 83e62df83c Merge "Enble network.test_neutronv2.TestNeutronv2 on Python 3" 2017-01-11 03:55:40 +00:00
ChangBo Guo(gcb) d631ac0c97 Port xenapi test_vm_utils to Python 3
* we can't compare str and int in Python 3, and code make sure
  product_version must be a tuple of 3 integers[1], so we can remove
  invalid tests.

* Set correct exception type to catch

[1]3304115b73/nova/virt/xenapi/client/session.py (L173)

Partially-Implements: blueprint goal-python35

Change-Id: I0ba1e1f2ef37ade9bdc6d19066e4a33a07246416
2017-01-08 11:39:14 +08:00
ChangBo Guo(gcb) 6a6457b5a6 Port libvirt.test_vif to Python 3
We can't compare int or None with str on Python 3, need convert str
into int or just skip. We do this comprehensively for vlan by ensuring
that it is initially parsed as an int.

Partially-Implements: blueprint goal-python35

Co-Authored-By: Matthew Booth <mbooth@redhat.com>
Change-Id: I000839a341aa6164343b6c44e29a8b7d79084b73
2017-01-05 10:27:13 +00:00
ChangBo Guo(gcb) 83923ad227 Port libvirt.test_firewall to Python 3
* Replace filter() with a list-comprehension to get a list on Python 3
* Decode proecess_input if it is bytes according to recent change in
  1a2db4cdc0

Partially-Implements: blueprint goal-python35

Change-Id: Ic7e087c165074df7aaae082e4477fffd9f241e35
2017-01-05 10:26:19 +00:00
ChangBo Guo(gcb) 91f8a02b2c Port virt.libvirt.test_imagebackend to Python 3
* Don't compare mock with int on Python 3
* Can't compare None with int on Python 3
* Ensure libvirt secret is bytes

Partially-Implements: blueprint goal-python35

Change-Id: I564039f48f7b41798bb71768b6eeaf5d2f854a9c
2017-01-04 20:19:48 +08:00
ChangBo Guo(gcb) 4173e41921 Enable TestOSAPIFixture.test_responds_to_version on Python 3
It takes about 2.5 seconds to run this test, seems the issue
has gone. Not sure this is fixed by eventlet now. Let's enable
it now and figure out root cause and fix the issue.

Related-Bug: #1558105
Partially-Implements: blueprint goal-python35

Change-Id: I6826a4ba3ea5656471cdffbaa2883b522b4b22f0
2017-01-03 11:16:49 +00:00
Jenkins a74d3ae4e8 Merge "Enble compute.test_compute_mgr.ComputeManagerUnitTestCase on Python 3" 2016-12-28 13:38:01 +00:00
ChangBo Guo(gcb) 99757f8f0b Port security group related tests to Python 3
* Use encode_utils.safe_decode from oslo.utils
  to decode result of urllib.parse.unquote(cidr)

Partially-Implements: blueprint goal-python35

Change-Id: If139d093f8951f59753c06a88a59b4fb2f878940
2016-12-26 13:29:25 +08:00
Jenkins a8973ecb12 Merge "Port compute unit tests to Python 3" 2016-12-24 13:55:37 +00:00
Jenkins 4a0783fad7 Merge "Port api.openstack.compute.test_disk_config to Python 3" 2016-12-24 12:38:53 +00:00
ChangBo Guo(gcb) e31af46bca Port compute unit tests to Python 3
Use base64 module from oslo.serialization to handle
base64 encoding and decoding.

Partially-Implements: blueprint goal-python35

Change-Id: I973c4932f5f71e09d4b6c4b3077bdc5119af41dc
2016-12-23 19:21:05 +08:00
Jenkins 8601b2c496 Merge "Port test_matchers.TestDictMatches.test__str__ to Python 3" 2016-12-23 10:36:59 +00:00
ChangBo Guo(gcb) f1103392b9 Enble network.test_neutronv2.TestNeutronv2 on Python 3
Enable unstable test one by one and figure out failure easily when
it fails again.

Partially-Implements: blueprint goal-python35

Change-Id: I2fb79178184cb9b300023e38a414621a0ca6ccbc
2016-12-23 13:17:05 +08:00
ChangBo Guo(gcb) 9a8a67022c Enble compute.test_compute_mgr.ComputeManagerUnitTestCase on Python 3
Enable unstable test one by one and figure out failure easily when
it fails again.

Partially-Implements: blueprint goal-python35

Change-Id: Ie396241de6e677cdb25778c1dfb2307b40156bfa
2016-12-23 13:15:54 +08:00
ChangBo Guo(gcb) 282dd9aea5 Port api.openstack.compute.test_disk_config to Python 3
Make sure error message is unicode.

Partially-Implements: blueprint goal-python35

Change-Id: Ief1ffb188ae90430d820436d5a78217a337a20a3
2016-12-23 04:29:49 +00:00
Jenkins 33fc8070cf Merge "Skip network.test_manager.LdapDNSTestCase on Python 3" 2016-12-22 22:43:16 +00:00
ChangBo Guo(gcb) 8f4dfdb55d Port test_matchers.TestDictMatches.test__str__ to Python 3
Method pprint.pformat(OrderedDict)'s output is different on Python 2
and Python 3. Its outputs equals "DictMatches({0})".format(OrderedDict)
only on Python 2. Let's just use pprint.pformat.

Partially-Implements: blueprint goal-python35

Change-Id: I220a7edf4f8f35ecb3763e4e3817c6c6c024efd9
2016-12-20 11:11:44 +08:00
ChangBo Guo(gcb) 4c05cb0913 Skip network.test_manager.LdapDNSTestCase on Python 3
ldapdns module is used for nova-network which was depecated, and
Python-ldap sometimes behaves poorly when receiving unicode strings,
so we can just skip tests if using Python3.

Partially-Implements: blueprint goal-python35

Change-Id: I9fa0b6b0d397318b52f0fe3784d6e7047aefaab2
2016-12-20 11:04:26 +08:00
Jenkins 4b71d7e221 Merge "Port libvirt.storage.test_rbd to Python 3" 2016-12-19 17:41:13 +00:00
Jenkins 502910761c Merge "Port virt vmwareapi tests to Python 3" 2016-12-17 18:13:30 +00:00
ChangBo Guo(gcb) ba81d2458f Port libvirt.storage.test_rbd to Python 3
* Stop explicitly encoding strings we pass to rbd: the library
  supports multiple string types now.
* We mock module rbd from rbd_utils.py, also need set module rbd's
  specific exceptions with object inherit from BaseException to avoid
  TypeError like: 'TypeError: catching classes that do not inherit from
  BaseException is not allowed'

Partially-Implements: blueprint goal-python35

Co-Authored-By: Davanum Srinivas <davanum@gmail.com>

Change-Id: I3eec213ad9bc13f0a371a5c4f28d3df377796125
2016-12-15 13:38:53 +00:00
Diana Clarke 83404013cb Simple tenant usage pagination
Add optional parameters 'limit' and 'marker' to the
os-simple-tenant-usage endpoints for pagaination.

  /os-simple-tenant-usage?limit={limit}&marker={instance_uuid}
  /os-simple-tenant-usage/{tenant}?limit={limit}&marker={instance_uuid}

The aggregate usage totals may no longer reflect all instances for a
tenant, but rather just the instances for a given page. API consumers
will need to stitch the aggregate data back together (add the totals)
if a tenant's instances span several pages.

Implements blueprint paginate-simple-tenant-usage
Change-Id: Ic8e9f869f1b855f968967bedbf77542f287f26c0
2016-12-14 03:33:50 +00:00
ChangBo Guo(gcb) 3fe0faa09d Port virt vmwareapi tests to Python 3
* ensure etree.fromstring accept bytes string
* Fix mock object comparison failure in Python 3

Partially-Implements: blueprint goal-python35

Change-Id: I915b2eacce74bafd7887a96e0e8d1f4eafb6ed78
2016-12-13 15:32:04 +08:00
Jenkins b3172acfb3 Merge "Port virt.xenapi.client.test_session to Python 3" 2016-12-12 17:20:56 +00:00
Jenkins 777fd0a57e Merge "Port test_virt_drivers to Python 3" 2016-12-12 09:30:35 +00:00
Jenkins 5bfa7c2f35 Merge "Enable test_bdm.BlockDeviceMappingEc2CloudTestCase on Python 3" 2016-12-11 13:51:29 +00:00
Jenkins fa34c77f87 Merge "Port compute.test_extended_ip* to Python 3" 2016-12-09 16:15:18 +00:00
ChangBo Guo(gcb) d7d19a202e Enable test_bdm.BlockDeviceMappingEc2CloudTestCase on Python 3
This test cases was removed during ec2 removal, just remove it
from tests-py3.txt.

Partially-Implements: blueprint goal-python35

Change-Id: I2de52025b517dcd75c60c3f77c4eafbbfd21c52c
2016-12-09 17:06:55 +08:00
Jenkins ca8d5ff533 Merge "Port virt.disk.mount.test_nbd to Python 3" 2016-12-08 11:28:49 +00:00
Jenkins 43bdae4c90 Merge "Port libvirt test_imagecache to Python 3" 2016-12-08 11:24:56 +00:00
ChangBo Guo(gcb) 6882b97266 Port test_virt_drivers to Python 3
This is follow-up of dda8d45c0d,
just enable following tests:
nova.tests.unit.virt.test_virt_drivers.FakeConnectionTestCase
nova.tests.unit.virt.test_virt_drivers.LibvirtConnTestCase

Implements: blueprint goal-python35

Change-Id: I8c3eb6e072e1771581db83e6260eecb152446a03
2016-12-08 18:38:12 +08:00
ChangBo Guo(gcb) 1b4d279c09 Port virt.disk.mount.test_nbd to Python 3
os.listdir also accepts file descriptor on Python 3,
need make sure path is string in _fake_listdir_nbd_devices.

Partially-Implements: blueprint goal-python35

Change-Id: I882d3feaa6a68212b6ce3bea4aedbe85dcbd5092
2016-12-08 10:15:41 +08:00
Jenkins 63eca7e751 Merge "Port xenapi test_xenapi to Python 3" 2016-12-07 21:11:59 +00:00
Jenkins bc34c0a8b2 Merge "Port libvirt test_driver to Python 3" 2016-12-07 21:07:24 +00:00
Jenkins bf26d65677 Merge "Port test_serversV21 to Python 3" 2016-12-02 15:27:00 +00:00
ChangBo Guo(gcb) 88746b86a1 Port compute.test_extended_ip* to Python 3
* Fix TypeError on Python 3 like:
  'TypeError: unorderable types: dict() < dict()'

Partially-Implements: blueprint goal-python35

Change-Id: Id2599e4e465aad1cf21be8f8cea39e95a28fd5bf
2016-12-01 10:25:12 +08:00
ChangBo Guo(gcb) 6969a18193 Remove more tests from tests-py3.txt
This is follow-up of a338274720,
these tests can run on Python 3, just enable them:

nova.tests.unit.api.openstack.compute.test_extended_availability_zone.ExtendedAvailabilityZoneTestV21
nova.tests.unit.api.openstack.compute.test_hide_server_addresses.HideServerAddressesTestV21
nova.tests.unit.api.openstack.compute.test_limits.WsgiLimiterProxyTest
nova.tests.unit.api.openstack.compute.test_scheduler_hints.SchedulerHintsTestCaseV21
nova.tests.unit.api.openstack.compute.test_urlmap.UrlmapTest
nova.tests.unit.api.openstack.compute.test_volumes.BootFromVolumeTest
nova.tests.unit.api.test_compute_req_id.RequestIdTest
nova.tests.unit.test_configdrive2.ConfigDriveTestCase

Partially-Implements: blueprint goal-python35

Change-Id: Ie2a6c44f3cbcd82e37da2e0c002e866d25823eda
2016-12-01 10:21:47 +08:00
Jenkins 42741b5f3b Merge "Port ironic unit tests to Python 3" 2016-11-30 22:55:58 +00:00
Jenkins 96802f5503 Merge "Port test_keypairs to Python 3" 2016-11-30 22:55:17 +00:00
Jenkins cb49fc6e46 Merge "Port test_metadata to Python 3" 2016-11-30 22:54:22 +00:00
ChangBo Guo(gcb) a54c1bc784 Port xenapi test_xenapi to Python 3
* Use base64 module from oslo.serialization to convert things
  as needed
* Replace filter() with a list-comprehension to get a list on
  Python 3

Partially-Implements: blueprint goal-python35

Change-Id: Ibe7e212cea5e6dd32b9b92a814c3ad8222ed2bc6
2016-11-29 19:38:32 +08:00
ChangBo Guo(gcb) 0ae8cbf83e Port libvirt test_driver to Python 3
* Use binary files, not text files, in fake_libvirt_utils.file_open()
* Use byte strings for XML
* Set disk size to 0 in mocks to avoid fix TypeError on comparison
  on Python 3
* Replace filter() and map() with a list-comprehension to get a list
  on Python 3
* Replace six.moves.range() with range() in driver.py: there is
  a "from six.moves import range" import at top level
* Replace six.iteritems(dict) with dict.items() to cleanup the code.
* Make sure call mox.UnsetStubs at last to make mox work properly on
  Python 3.

Co-Authored-By: Davanum Srinivas <davanum@gmail.com>
Co-Authored-By: Victor Stinner <vstinner@redhat.com>

Change-Id: I568c72c611024d32c35dd0629cc041ca5c5969b8
Partially-Implements: blueprint goal-python35
2016-11-29 19:36:55 +08:00