Merge lp:~justin-fathomdb/nova/test-openstack-api-servers into lp:~hudson-openstack/nova/trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~justin-fathomdb/nova/test-openstack-api-servers |
Merge into: | lp:~hudson-openstack/nova/trunk |
Prerequisite: | lp:~justin-fathomdb/nova/justinsb-openstack-api-volumes |
Diff against target: |
657 lines (+458/-29) 7 files modified
nova/api/openstack/ratelimiting/__init__.py (+13/-5) nova/image/fake.py (+108/-0) nova/tests/integrated/api/client.py (+40/-0) nova/tests/integrated/integrated_helpers.py (+77/-22) nova/tests/integrated/test_keys.py (+2/-1) nova/tests/integrated/test_servers.py (+216/-0) nova/tests/integrated/test_volumes.py (+2/-1) |
To merge this branch: | bzr merge lp:~justin-fathomdb/nova/test-openstack-api-servers |
Related bugs: | |
Related blueprints: |
Achieve Stability in Cactus
(Undefined)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nova Core security contacts | Pending | ||
Review via email:
|
Description of the change
Basic unit testing of the OpenStack API for /servers.
Unmerged revisions
- 732. By justinsb
-
PEP8 fun
- 731. By justinsb
-
Finally figured out how to work around the latest flip-flops on what the image service should be returning
- 730. By justinsb
-
More changing of print -> LOG.debug
- 729. By justinsb
-
Removed known_bugs based on community opinion. Commented out the test cases that otherwise won't work.
- 728. By justinsb
-
Merged with head, fixing up bazaar's pathetic attempts at conflict resolution.
- 727. By justinsb
-
PEP8 fix
- 726. By justinsb
-
Need spurious import to pull in flags
- 725. By justinsb
-
Scale up rate limits for tests massively, to effectively turn them off
- 724. By justinsb
-
More careful checking of servers detail vs non-detail views
- 723. By justinsb
-
Add integrated unit tests for server metadata. Also add KNOWN_BUGS list, so that we can test bugs separately from fixing them
Overall this looks good.
The known_bugs addition looks pretty nifty (but I worry a bit about the added complexity of it). The fake image service looks like a really nice addition.
Below are a few femto-nits:
658 + # Not supported till Python 2.7 / 3.1 create_ metadata_ throws_ unhashable_ type' in KNOWN_BUGS, BUG:server_ create_ metadata_ throws_ unhashable_ type')
659 + #@unittest.skipIf(
660 + # 'server_
661 + # 'KNOWN_
If we're going to go this route, perhaps we could roll our own decorator which the TestRunner can use to skip the relevant tests. This would make adoption of this under 2.6 just as easy as 2.7+.
Something along the lines of:
@tests_ known_bug( "my_known_ bug") known_bug( self): assert_ (False)
def test_my_
self.
586 +# print driver. LoggingVolumeDr iver.all_ logs() LoggingVolumeDr iver.logs_ like( volume_ id) ls(1, len(create_ actions) ) ls(create_ action[ 'id'], created_server_id) ls(create_ action[ 'availability_ zone'], 'nova') ls(create_ action[ 'size'] , 1) LoggingVolumeDr iver.logs_ like( server_ id) ls(1, len(export_ actions) ) ls(export_ action[ 'id'], created_server_id) ls(export_ action[ 'availability_ zone'], 'nova') LoggingVolumeDr iver.logs_ like( server_ id) ls(1, len(delete_ actions) ) ls(delete_ action[ 'id'], created_server_id)
587 +#
588 +#
589 +# create_actions = driver.
590 +# 'create_volume',
591 +# id=created_
592 +# print create_actions
593 +# self.assertEqua
594 +# create_action = create_actions[0]
595 +# self.assertEqua
596 +# self.assertEqua
597 +# self.assertEqua
598 +#
599 +# export_actions = driver.
600 +# 'create_export',
601 +# id=created_
602 +# self.assertEqua
603 +# export_action = export_actions[0]
604 +# self.assertEqua
605 +# self.assertEqua
606 +#
607 +# delete_actions = driver.
608 +# 'delete_volume',
609 +# id=created_
610 +# self.assertEqua
611 +# delete_action = export_actions[0]
612 +# self.assertEqua
Was this left in on purpose? If so, it probably should have a TODO with it.
> 509 + def test_get_ servers( self): get_servers( )
> 510 + """Simple check that listing servers works"""
> 511 + servers = self.api.
> 512 + for server in servers:
> 513 + print("server: %s" % server)
Can we put an assert in here? Perhaps just a assertNotRaises or something.
> 334 + raise exception.Error("No way to create an image through API??")
This line (and a few others) need i18n treatment, the _("blah").
> 628 + #if found_server[ 'status' ] != 'deleting':
> 629 + # break
Left in by accident, or does that need a TODO/FIXME?
> 129 + raise exception.NotFound
Might be helpful to pass in a string with the Exception which includes the Id of the image not found. Something like
raise exception. NotFound( _("Image %(image_id)s not found) % locals())
> 489 +import time
Should be moved up to top section of imports (per HACKING)
> 641 + #TODO(justinsb): This is FUBAR
Agree wit...