Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API Sample tests for Snapshots extension.
Partially implements blueprint nova-api-samples Modifies fakes to produce a real timestamp Fixes bug 1126211 Change-Id: I8973d50fa67abbf6f96684ff8a0b898912f09caf
- Loading branch information
Giampaolo Lauria
committed
Feb 25, 2013
1 parent
6053ca1
commit d10a2e1
Showing
22 changed files
with
344 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"snapshot": { | ||
"display_name": "snap-001", | ||
"display_description": "Daily backup", | ||
"volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c", | ||
"force": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<snapshot> | ||
<display_name>snap-001</display_name> | ||
<display_description>Daily backup</display_description> | ||
<volume_id>521752a6-acf6-4b2d-bc7a-119f9148cd8c</volume_id> | ||
<force>false</force> | ||
</snapshot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"snapshot": { | ||
"createdAt": "2013-02-25T16:27:54.680544", | ||
"displayDescription": "Daily backup", | ||
"displayName": "snap-001", | ||
"id": 100, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": { | ||
"attach_status": "attached", | ||
"availability_zone": "fakeaz", | ||
"created_at": "1999-01-01T01:01:01.000000", | ||
"display_description": "displaydesc", | ||
"display_name": "displayname", | ||
"host": "fakehost", | ||
"id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c", | ||
"instance_uuid": "fakeuuid", | ||
"mountpoint": "/", | ||
"name": "vol name", | ||
"project_id": "fakeproject", | ||
"size": 1, | ||
"snapshot_id": null, | ||
"status": "fakestatus", | ||
"user_id": "fakeuser", | ||
"volume_metadata": [], | ||
"volume_type": { | ||
"name": "vol_type_name" | ||
}, | ||
"volume_type_id": "fakevoltype" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshot status="available" displayDescription="Daily backup" displayName="snap-001" volumeId="{'instance_uuid': 'fakeuuid', 'status': 'fakestatus', 'user_id': 'fakeuser', 'name': 'vol name', 'display_name': 'displayname', 'availability_zone': 'fakeaz', 'created_at': datetime.datetime(1999, 1, 1, 1, 1, 1), 'attach_status': 'attached', 'display_description': 'displaydesc', 'host': 'fakehost', 'volume_type_id': 'fakevoltype', 'volume_metadata': [], 'volume_type': {'name': 'vol_type_name'}, 'snapshot_id': None, 'mountpoint': '/', 'project_id': 'fakeproject', 'id': u'521752a6-acf6-4b2d-bc7a-119f9148cd8c', 'size': 1}" id="100" createdAt="2013-02-25 16:27:36.840121" size="100"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"snapshots": [ | ||
{ | ||
"createdAt": "2013-02-25T16:27:54.671372", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 100, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "2013-02-25T16:27:54.671378", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 101, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "2013-02-25T16:27:54.671381", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 102, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshots> | ||
<snapshot status="available" displayDescription="Default description" displayName="Default name" volumeId="12" id="100" createdAt="2013-02-25 16:27:36.862459" size="100"/> | ||
<snapshot status="available" displayDescription="Default description" displayName="Default name" volumeId="12" id="101" createdAt="2013-02-25 16:27:36.862466" size="100"/> | ||
<snapshot status="available" displayDescription="Default description" displayName="Default name" volumeId="12" id="102" createdAt="2013-02-25 16:27:36.862469" size="100"/> | ||
</snapshots> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"snapshots": [ | ||
{ | ||
"createdAt": "2013-02-25T16:27:54.684999", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 100, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "2013-02-25T16:27:54.685005", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 101, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "2013-02-25T16:27:54.685008", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 102, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshots> | ||
<snapshot status="available" displayDescription="Default description" displayName="Default name" volumeId="12" id="100" createdAt="2013-02-25 16:27:36.769149" size="100"/> | ||
<snapshot status="available" displayDescription="Default description" displayName="Default name" volumeId="12" id="101" createdAt="2013-02-25 16:27:36.769154" size="100"/> | ||
<snapshot status="available" displayDescription="Default description" displayName="Default name" volumeId="12" id="102" createdAt="2013-02-25 16:27:36.769157" size="100"/> | ||
</snapshots> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"snapshot": { | ||
"createdAt": "2013-02-25T16:27:54.724209", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": "100", | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshot status="available" displayDescription="Default description" displayName="Default name" volumeId="12" id="100" createdAt="2013-02-25 16:27:36.854206" size="100"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
nova/tests/integrated/api_samples/os-volumes/snapshot-create-req.json.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"snapshot": { | ||
"display_name": "%(snapshot_name)s", | ||
"display_description": "%(description)s", | ||
"volume_id": "%(volume_id)s", | ||
"force": false | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
nova/tests/integrated/api_samples/os-volumes/snapshot-create-req.xml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<snapshot> | ||
<display_name>%(snapshot_name)s</display_name> | ||
<display_description>%(description)s</display_description> | ||
<volume_id>%(volume_id)s</volume_id> | ||
<force>false</force> | ||
</snapshot> |
32 changes: 32 additions & 0 deletions
32
nova/tests/integrated/api_samples/os-volumes/snapshot-create-resp.json.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"snapshot": { | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "%(description)s", | ||
"displayName": "%(snapshot_name)s", | ||
"id": 100, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": { | ||
"attach_status": "attached", | ||
"availability_zone": "fakeaz", | ||
"created_at": "%(timestamp)s", | ||
"display_description": "displaydesc", | ||
"display_name": "displayname", | ||
"host": "fakehost", | ||
"id": "%(uuid)s", | ||
"instance_uuid": "fakeuuid", | ||
"mountpoint": "/", | ||
"name": "vol name", | ||
"project_id": "fakeproject", | ||
"size": 1, | ||
"snapshot_id": null, | ||
"status": "fakestatus", | ||
"user_id": "fakeuser", | ||
"volume_metadata": [], | ||
"volume_type": { | ||
"name": "vol_type_name" | ||
}, | ||
"volume_type_id": "fakevoltype" | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
nova/tests/integrated/api_samples/os-volumes/snapshot-create-resp.xml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshot status="available" displayDescription="%(description)s" displayName="%(snapshot_name)s" volumeId="{'instance_uuid': 'fakeuuid', 'status': 'fakestatus', 'user_id': 'fakeuser', 'name': 'vol name', 'display_name': 'displayname', 'availability_zone': 'fakeaz', 'created_at': datetime.datetime(1999, 1, 1, 1, 1, 1), 'attach_status': 'attached', 'display_description': 'displaydesc', 'host': 'fakehost', 'volume_type_id': 'fakevoltype', 'volume_metadata': [], 'volume_type': {'name': 'vol_type_name'}, 'snapshot_id': None, 'mountpoint': '/', 'project_id': 'fakeproject', 'id': u'521752a6-acf6-4b2d-bc7a-119f9148cd8c', 'size': 1}" id="100" createdAt="%(timestamp)s" size="100"/> |
31 changes: 31 additions & 0 deletions
31
nova/tests/integrated/api_samples/os-volumes/snapshots-detail-resp.json.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"snapshots": [ | ||
{ | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 100, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 101, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "Default description", | ||
"displayName": "Default name", | ||
"id": 102, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
nova/tests/integrated/api_samples/os-volumes/snapshots-detail-resp.xml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshots> | ||
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="100" createdAt="%(timestamp)s" size="100"/> | ||
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="101" createdAt="%(timestamp)s" size="100"/> | ||
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="102" createdAt="%(timestamp)s" size="100"/> | ||
</snapshots> |
31 changes: 31 additions & 0 deletions
31
nova/tests/integrated/api_samples/os-volumes/snapshots-list-resp.json.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"snapshots": [ | ||
{ | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "%(text)s", | ||
"displayName": "%(text)s", | ||
"id": 100, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "%(text)s", | ||
"displayName": "%(text)s", | ||
"id": 101, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
}, | ||
{ | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "%(text)s", | ||
"displayName": "%(text)s", | ||
"id": 102, | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
nova/tests/integrated/api_samples/os-volumes/snapshots-list-resp.xml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshots> | ||
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="100" createdAt="%(timestamp)s" size="100"/> | ||
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="101" createdAt="%(timestamp)s" size="100"/> | ||
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="102" createdAt="%(timestamp)s" size="100"/> | ||
</snapshots> |
11 changes: 11 additions & 0 deletions
11
nova/tests/integrated/api_samples/os-volumes/snapshots-show-resp.json.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"snapshot": { | ||
"createdAt": "%(timestamp)s", | ||
"displayDescription": "%(description)s", | ||
"displayName": "%(snapshot_name)s", | ||
"id": "100", | ||
"size": 100, | ||
"status": "available", | ||
"volumeId": 12 | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
nova/tests/integrated/api_samples/os-volumes/snapshots-show-resp.xml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<snapshot status="available" displayDescription="%(description)s" displayName="%(snapshot_name)s" volumeId="12" id="100" createdAt="%(timestamp)s" size="100"/> |
Oops, something went wrong.