Tempest test test_can_create_server_with_max_number_personality_files fails with 'object has no attribute 'b64decode'' error

Bug #1624451 reported by Anna Babich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
High
Anna Babich

Bug Description

The bug has been reproduced against the following env:
Snapshot:
ababich@srv129-bud:~$ grep SNAPSHOT /home/jenkins/env_inject.properties
SNAPSHOT_ID=#268
Environment:
[root@nailgun ~]# fuel node
id | status | name | cluster | ip | mac | roles | pending_roles | online | group_id
---+--------+---------------------------+---------+-------------+-------------------+-------------------+---------------+--------+---------
 1 | ready | slave-05_compute_cinder | 1 | 10.109.20.7 | 64:e1:ac:6f:44:3f | cinder, compute | | 1 | 1
 6 | ready | slave-04_compute_cinder | 1 | 10.109.20.6 | 64:cf:f7:7c:6b:a8 | cinder, compute | | 1 | 1
 4 | ready | slave-03_controller_mongo | 1 | 10.109.20.5 | 64:6f:79:ea:ce:ad | controller, mongo | | 1 | 1
 3 | ready | slave-01_controller_mongo | 1 | 10.109.20.3 | 64:95:c1:35:ef:dd | controller, mongo | | 1 | 1
 2 | ready | slave-06_ironic | 1 | 10.109.20.8 | 64:e4:00:b1:f1:ee | ironic | | 1 | 1
 5 | ready | slave-02_controller_mongo | 1 | 10.109.20.4 | 64:54:55:2b:b0:83 | controller, mongo | | 1 | 1
[root@nailgun ~]#

The Tempest test tempest.api.compute.servers.test_server_personality.ServerPersonalityTestJSON.test_can_create_server_with_max_number_personality_files fails with the following traceback:
Traceback (most recent call last):

  File "tempest/api/compute/servers/test_server_personality.py", line 140, in test_can_create_server_with_max_number_personality_files

    self.assertEqual(base64.b64decode(i['contents']),

AttributeError: 'module' object has no attribute 'b64decode'

The root cause looks like the test case uses b64decode method from Python base64 package instead of method proposed by Oslo's base64 package imported here: https://github.com/openstack/tempest/blob/master/tempest/api/compute/servers/test_server_personality.py#L16

After replacing https://github.com/openstack/tempest/blob/master/tempest/api/compute/servers/test_server_personality.py#L140 by
self.assertEqual(base64.decode_as_text(i['contents']),
     linux_client.exec_command(
                                'sudo cat %s' % i['path']))
and test's re-running it passed:
{0} tempest.api.compute.servers.test_server_personality.ServerPersonalityTestJSON.test_can_create_server_with_max_number_personality_files [39.889848s] ... ok

Tags: tempest
Revision history for this message
Anna Babich (ababich) wrote :
Anna Babich (ababich)
Changed in mos:
status: New → In Progress
importance: Undecided → High
Anna Babich (ababich)
Changed in mos:
status: In Progress → Fix Committed
Revision history for this message
Oleksiy Butenko (obutenko) wrote :

verified on 9.1 snapshot #294

Changed in mos:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.