Unit tests for LIO and ISER target drivers are horribly written

Bug #1420009 reported by John Griffith
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Anton Arefiev

Bug Description

The unit tests for iser and lio take a lazy approach and just inherit from the tgtAdm test and rerun with LIO driver entries. This is great in order to get wide/broad coverage and interaction with the TgtAdm driver that's used by iser and lio; but defeats the point of a unit test.

It also means that any time a change is made in the Tgt code and unit test that it has a direct impact on the LIO and ISER tests, even though the change has absolutely NO relation to the ISER or LIO drivers.

These tests should be decoupled, as they are now they're just slightly better than useless.

Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

This patch decoupled LIO test cases from tgt.

https://review.openstack.org/#/c/148038/

Revision history for this message
Ivan Kolodyazhny (e0ne) wrote :
Changed in cinder:
status: New → Fix Committed
importance: Undecided → Medium
Revision history for this message
Ivan Kolodyazhny (e0ne) wrote :

ISER test cases still inherit tgt test cases.

Changed in cinder:
status: Fix Committed → Confirmed
Anton Arefiev (aarefiev)
Changed in cinder:
assignee: nobody → Anton Arefiev (aarefiev)
Mike Perez (thingee)
Changed in cinder:
milestone: none → liberty-1
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/179082
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=bdd0ff6c685855a47034cdfa0cdfa50a4d153a1d
Submitter: Jenkins
Branch: master

commit bdd0ff6c685855a47034cdfa0cdfa50a4d153a1d
Author: Anton Arefiev <email address hidden>
Date: Thu Apr 30 16:54:23 2015 +0300

    Targets test refactoring

    The unit tests for iser inherit from the tgtAdm, it means that any
    time run tests for iser, tgtAdm tests run too. This chache add
    TargetFixture to tests, it allows to decouple tests and delete
    duplicated code.

    Other changes:
     - deleted __init__ in test's classes; __init__ may work as a
    replacement for setUp, but setUp should be used instead because
    it is part of the protocol for writing tests. It also has a
    counterpart, tearDown, which __init__ does no;
     - replaced stubs to mock.

    Change-Id: I8aa9f756efb0b4fc4a3a0ea960c6f2d8e20ec18a
    Closes-Bug: #1420009

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/187663

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/kilo)

Change abandoned by Gorka Eguileor (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/187663
Reason: Abandoned by popular demand. :-)

Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-1 → 7.0.0
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.