tripleoclient unit test fails on nic validation

Bug #1768337 reported by Alex Schultz
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Low
Alex Schultz

Bug Description

When I run the tests locally I'm getting a a TypeError. This doesn't appear to be affecting the CI gates however.

running: tox -e py27

Results in:
======================================================================
FAIL: tripleoclient.tests.v1.overcloud_netenv_validate.test_overcloud_netenv_validate.TestValidateOvercloudNetenv.test_command
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tripleoclient/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py", line 273, in test_command
    self.cmd.take_action(parsed_args)
  File "tripleoclient/v1/overcloud_netenv_validate.py", line 61, in take_action
    self.NIC_validate(item, data_path)
  File "tripleoclient/v1/overcloud_netenv_validate.py", line 177, in NIC_validate
    for item in nic_data['resources']:
TypeError: 'NoneType' object has no attribute '__getitem__'

Revision history for this message
Alex Schultz (alex-schultz) wrote :

Turns out it was because I had a file in /tmp called foo. We aren't mocking the test correctly.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/565575

Changed in tripleo:
assignee: nobody → Alex Schultz (alex-schultz)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.openstack.org/565575
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=24d6301d92ed4f1f482bbbb68d835c1c1b6a1039
Submitter: Zuul
Branch: master

commit 24d6301d92ed4f1f482bbbb68d835c1c1b6a1039
Author: Alex Schultz <email address hidden>
Date: Tue May 1 14:07:17 2018 -0600

    Fix test for netenv validate

    Previously we were actually attempting to open a file in the
    NIC_validate function when executed by this test because it was not
    properly mocked. If you had an empty file /tmp/foo, the test would fail
    because it would try and read data from it.

    Change-Id: Iab778b756637ae3e3a4beeea66bfa41b3cedd7b8
    Closes-Bug: #1768337

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 10.1.0

This issue was fixed in the openstack/python-tripleoclient 10.1.0 release.

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.