Add availability zone extension to API samples test.
Change-Id: I43e64d6637ef850119475c5d470cc54e7168c388 Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
This commit is contained in:
parent
1123c87e58
commit
7fbe9ad597
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"server" : {
|
||||||
|
"name" : "new-server-test",
|
||||||
|
"imageRef" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||||
|
"flavorRef" : "http://openstack.example.com/openstack/flavors/1",
|
||||||
|
"metadata" : {
|
||||||
|
"My Server Name" : "Apache1"
|
||||||
|
},
|
||||||
|
"availability_zone": "nova",
|
||||||
|
"personality" : [
|
||||||
|
{
|
||||||
|
"path" : "/etc/banner.txt",
|
||||||
|
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||||
|
imageRef="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b"
|
||||||
|
flavorRef="http://openstack.example.com/openstack/flavors/1"
|
||||||
|
name="new-server-test"
|
||||||
|
availability_zone="nova">
|
||||||
|
<metadata>
|
||||||
|
<meta key="My Server Name">Apache1</meta>
|
||||||
|
</metadata>
|
||||||
|
<personality>
|
||||||
|
<file path="/etc/banner.txt">
|
||||||
|
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
|
||||||
|
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
|
||||||
|
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
|
||||||
|
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
|
||||||
|
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
|
||||||
|
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
|
||||||
|
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
|
||||||
|
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
|
||||||
|
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
|
||||||
|
</file>
|
||||||
|
</personality>
|
||||||
|
</server>
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"server": {
|
||||||
|
"adminPass": "k4pKvTfcA4gY",
|
||||||
|
"id": "3e45fa2a-5204-466f-a684-c2a8e1c82d7f",
|
||||||
|
"links": [
|
||||||
|
{
|
||||||
|
"href": "http://openstack.example.com/v2/openstack/servers/3e45fa2a-5204-466f-a684-c2a8e1c82d7f",
|
||||||
|
"rel": "self"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "http://openstack.example.com/openstack/servers/3e45fa2a-5204-466f-a684-c2a8e1c82d7f",
|
||||||
|
"rel": "bookmark"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="9196924a-9646-41e9-852a-77b39d7af053" adminPass="a4UHSHEwLeJk">
|
||||||
|
<metadata/>
|
||||||
|
<atom:link href="http://openstack.example.com/v2/openstack/servers/9196924a-9646-41e9-852a-77b39d7af053" rel="self"/>
|
||||||
|
<atom:link href="http://openstack.example.com/openstack/servers/9196924a-9646-41e9-852a-77b39d7af053" rel="bookmark"/>
|
||||||
|
</server>
|
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"server" : {
|
||||||
|
"name" : "new-server-test",
|
||||||
|
"imageRef" : "%(host)s/openstack/images/%(image_id)s",
|
||||||
|
"flavorRef" : "%(host)s/openstack/flavors/1",
|
||||||
|
"metadata" : {
|
||||||
|
"My Server Name" : "Apache1"
|
||||||
|
},
|
||||||
|
"availability_zone": "%(availability_zone)s",
|
||||||
|
"personality" : [
|
||||||
|
{
|
||||||
|
"path" : "/etc/banner.txt",
|
||||||
|
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||||
|
imageRef="%(host)s/openstack/images/%(image_id)s"
|
||||||
|
flavorRef="%(host)s/openstack/flavors/1"
|
||||||
|
name="new-server-test"
|
||||||
|
availability_zone="%(availability_zone)s">
|
||||||
|
<metadata>
|
||||||
|
<meta key="My Server Name">Apache1</meta>
|
||||||
|
</metadata>
|
||||||
|
<personality>
|
||||||
|
<file path="/etc/banner.txt">
|
||||||
|
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
|
||||||
|
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
|
||||||
|
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
|
||||||
|
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
|
||||||
|
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
|
||||||
|
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
|
||||||
|
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
|
||||||
|
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
|
||||||
|
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
|
||||||
|
</file>
|
||||||
|
</personality>
|
||||||
|
</server>
|
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"server": {
|
||||||
|
"adminPass": "%(password)s",
|
||||||
|
"id": "%(id)s",
|
||||||
|
"links": [
|
||||||
|
{
|
||||||
|
"href": "%(host)s/v2/openstack/servers/%(uuid)s",
|
||||||
|
"rel": "self"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "%(host)s/openstack/servers/%(uuid)s",
|
||||||
|
"rel": "bookmark"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<server xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||||
|
id="%(id)s" adminPass="%(password)s">
|
||||||
|
<metadata/>
|
||||||
|
<atom:link href="%(host)s/v2/openstack/servers/%(uuid)s" rel="self"/>
|
||||||
|
<atom:link href="%(host)s/openstack/servers/%(uuid)s" rel="bookmark"/>
|
||||||
|
</server>
|
@ -1286,3 +1286,24 @@ class ServerDiagnosticsSamplesJsonTest(ServersSampleBase):
|
|||||||
|
|
||||||
class ServerDiagnosticsSamplesXmlTest(ServerDiagnosticsSamplesJsonTest):
|
class ServerDiagnosticsSamplesXmlTest(ServerDiagnosticsSamplesJsonTest):
|
||||||
ctype = "xml"
|
ctype = "xml"
|
||||||
|
|
||||||
|
|
||||||
|
class AvailabilityZoneJsonTest(ServersSampleBase):
|
||||||
|
extension_name = ("nova.api.openstack.compute.contrib.availability_zone."
|
||||||
|
"Availability_zone")
|
||||||
|
|
||||||
|
def test_create_availability_zone(self):
|
||||||
|
subs = {
|
||||||
|
'image_id': fake.get_valid_image_id(),
|
||||||
|
'host': self._get_host(),
|
||||||
|
"availability_zone": "nova"
|
||||||
|
}
|
||||||
|
response = self._do_post('servers', 'availability-zone-post-req', subs)
|
||||||
|
self.assertEqual(response.status, 202)
|
||||||
|
subs.update(self._get_regexes())
|
||||||
|
return self._verify_response('availability-zone-post-resp',
|
||||||
|
subs, response)
|
||||||
|
|
||||||
|
|
||||||
|
class AvailabilityZoneXmlTest(AvailabilityZoneJsonTest):
|
||||||
|
ctype = 'xml'
|
||||||
|
Loading…
Reference in New Issue
Block a user