Skip to content

Fixing functional test issues in test/functional/tm/ltm/test_policy.py#568

Merged
zancas merged 3 commits intoF5Networks:developmentfrom
pjbreaux:bugfix.test_policy_11_5_4
Jul 26, 2016
Merged

Fixing functional test issues in test/functional/tm/ltm/test_policy.py#568
zancas merged 3 commits intoF5Networks:developmentfrom
pjbreaux:bugfix.test_policy_11_5_4

Conversation

@pjbreaux
Copy link
Copy Markdown
Contributor

@pjbreaux pjbreaux commented Jul 19, 2016

@zancas
Don't merge until #558 has been merged!

What's this change do?

Implemented a module-level pytest fixture which snapshots the device
before and after the test. The diff between those snapshots is used to
remove objects created by the tests.

Any background context?

During test teardown, an attempt is made to delete the policies that are
not a part of the built-ins. The built-ins have changed between versions
of TMOS. We should snapshot the get_collection call and use that
pre-test snapshot to delete all those policies created by the tests.

Where should the reviewer start?

conftest.py change, then the changes in the test_policy.py file

@caphrim007
Copy link
Copy Markdown
Contributor

which bigip versions were showing the failure? all of them?

@pjbreaux
Copy link
Copy Markdown
Contributor Author

11.5.4

@caphrim007
Copy link
Copy Markdown
Contributor

checking

Comment thread conftest.py
after_snapshot = register_device(mgmt_root)
diff = set(after_snapshot) - set(before_snapshot)
for item in diff:
after_snapshot[item].delete()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add try except around this statement.

@pjbreaux pjbreaux force-pushed the bugfix.test_policy_11_5_4 branch from e200d08 to effa22c Compare July 20, 2016 21:46
@pjbreaux
Copy link
Copy Markdown
Contributor Author

Sorry @tar: reassigning back to @zancas, as he was curious about these changes.

Paul Breaux added 3 commits July 21, 2016 14:14
test/functional/tm/ltm/test_policy.py tests produce errors

Issues:
Fixes F5Networks#567

Problem:
During test teardown, an attempt is made to delete the policies that are
not a part of the built-ins. The built-ins have changed between versions
of TMOS. We should snapshot the get_collection call and use that
pre-test snapshot to delete all those policies created by the tests.

Analysis:
Implemented a module-level pytest fixture which snapshots the device
before and after the test. The diff between those snapshots is used to
remove objects created by the tests.

Tests:
test_policy tests now pass against 11.5.4 and 11.6.0
does not come back online

Issues:
Fixes F5Networks#553

Problem:
If the tests failed in the middle of bringing the device to offline, the
device remains in that state. There are also sleeps in these tests,
which should be removed.

Analysis:
Implemented a pollster to check what state the device is in and created
a teardown that assures the device is active before leaving the test.

Tests:
All these tests pass against 11.5.4 and 11.6.0
@pjbreaux pjbreaux force-pushed the bugfix.test_policy_11_5_4 branch from effa22c to c8e058e Compare July 21, 2016 22:25
Comment thread f5/bigip/resource.py
new_instance._activate_URI(new_instance.selfLink)
return new_instance

def _reduce_boolean_pair(self, config_dict, key1, key2):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zancas: Moved this method up to ResourceBase because the class Failover is an UnnamedResource, which inherits from ResourceBase, not resource.

@zancas zancas merged commit 7c20baa into F5Networks:development Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants