Add api_samples tests for servers actions
Change-Id: I67446ccd53c83b5fcfc3a1857a10e160263834dd
This commit is contained in:
parent
d68d2fba65
commit
52c850bb1d
5
doc/api_samples/server-action-changepassword.json
Normal file
5
doc/api_samples/server-action-changepassword.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"changePassword" : {
|
||||
"adminPass" : "foo"
|
||||
}
|
||||
}
|
4
doc/api_samples/server-action-changepassword.xml
Normal file
4
doc/api_samples/server-action-changepassword.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<changePassword
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
adminPass="foo"/>
|
3
doc/api_samples/server-action-confirmresize.json
Normal file
3
doc/api_samples/server-action-confirmresize.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"confirmResize" : null
|
||||
}
|
3
doc/api_samples/server-action-confirmresize.xml
Normal file
3
doc/api_samples/server-action-confirmresize.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<confirmResize
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"/>
|
8
doc/api_samples/server-action-createimage.json
Normal file
8
doc/api_samples/server-action-createimage.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"createImage" : {
|
||||
"name" : "foo-image",
|
||||
"metadata": {
|
||||
"myvar": "foobar"
|
||||
}
|
||||
}
|
||||
}
|
8
doc/api_samples/server-action-createimage.xml
Normal file
8
doc/api_samples/server-action-createimage.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<createImage
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
name="foo-image">
|
||||
<metadata>
|
||||
<meta key="myvar">foobar</meta>
|
||||
</metadata>
|
||||
</createImage>
|
5
doc/api_samples/server-action-reboot.json
Normal file
5
doc/api_samples/server-action-reboot.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"reboot" : {
|
||||
"type" : "SOFT"
|
||||
}
|
||||
}
|
4
doc/api_samples/server-action-reboot.xml
Normal file
4
doc/api_samples/server-action-reboot.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<reboot
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
type="SOFT"/>
|
55
doc/api_samples/server-action-rebuild-resp.json
Normal file
55
doc/api_samples/server-action-rebuild-resp.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"server": {
|
||||
"accessIPv4": "1.2.3.4",
|
||||
"accessIPv6": "fe80::100",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"adminPass": "seekr3t",
|
||||
"created": "2012-09-12T17:20:36Z",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hostId": "1e3da81662354c25560b7e5ea6d8123031f67168b6992f20bb84df69",
|
||||
"id": "075e40fe-9f03-4652-ba8e-5f8e2547899a",
|
||||
"image": {
|
||||
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v2/openstack/servers/075e40fe-9f03-4652-ba8e-5f8e2547899a",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/servers/075e40fe-9f03-4652-ba8e-5f8e2547899a",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"meta var": "meta val"
|
||||
},
|
||||
"name": "foobar",
|
||||
"progress": 0,
|
||||
"status": "ACTIVE",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "2012-09-12T17:20:37Z",
|
||||
"user_id": "fake"
|
||||
}
|
||||
}
|
19
doc/api_samples/server-action-rebuild-resp.xml
Normal file
19
doc/api_samples/server-action-rebuild-resp.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?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" status="ACTIVE" updated="2012-09-14T16:41:46Z" hostId="a0e37e3bd9f674600aabeeccb123d80ae2717ace90893d79cd4abc46" name="foobar" created="2012-09-14T16:41:45Z" userId="fake" tenantId="openstack" accessIPv4="1.2.3.4" accessIPv6="fe80::100" progress="0" id="943acea5-2fc8-4f31-bab6-8f7b9ac923ca" adminPass="seekr3t">
|
||||
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
|
||||
<atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link href="http://openstack.example.com/openstack/flavors/1" rel="bookmark"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" addr="192.168.0.3"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link href="http://openstack.example.com/v2/openstack/servers/943acea5-2fc8-4f31-bab6-8f7b9ac923ca" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/openstack/servers/943acea5-2fc8-4f31-bab6-8f7b9ac923ca" rel="bookmark"/>
|
||||
</server>
|
18
doc/api_samples/server-action-rebuild.json
Normal file
18
doc/api_samples/server-action-rebuild.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"rebuild" : {
|
||||
"imageRef" : "http://openstack.example.com/v2/32278/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"name" : "foobar",
|
||||
"adminPass" : "seekr3t",
|
||||
"accessIPv4" : "1.2.3.4",
|
||||
"accessIPv6" : "fe80::100",
|
||||
"metadata" : {
|
||||
"meta var" : "meta val"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
25
doc/api_samples/server-action-rebuild.xml
Normal file
25
doc/api_samples/server-action-rebuild.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rebuild
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
name="foobar"
|
||||
imageRef="http://openstack.example.com/v1.1/32278/images/70a599e0-31e7-49b7-b260-868f441e862b"
|
||||
accessIPv4="1.2.3.4"
|
||||
accessIPv6="fe80::100"
|
||||
adminPass="seekr3t">
|
||||
<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>
|
||||
</rebuild>
|
5
doc/api_samples/server-action-resize.json
Normal file
5
doc/api_samples/server-action-resize.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"resize" : {
|
||||
"flavorRef" : "2"
|
||||
}
|
||||
}
|
4
doc/api_samples/server-action-resize.xml
Normal file
4
doc/api_samples/server-action-resize.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resize
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
flavorRef="2"/>
|
3
doc/api_samples/server-action-revertresize.json
Normal file
3
doc/api_samples/server-action-revertresize.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"revertResize" : null
|
||||
}
|
3
doc/api_samples/server-action-revertresize.xml
Normal file
3
doc/api_samples/server-action-revertresize.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<revertResize
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"/>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"changePassword" : {
|
||||
"adminPass" : "%(password)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<changePassword
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
adminPass="%(password)s"/>
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"confirmResize" : null
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<confirmResize
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"/>
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"createImage" : {
|
||||
"name" : "%(name)s",
|
||||
"metadata": {
|
||||
"%(meta_var)s": "%(meta_val)s"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<createImage
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
name="%(name)s">
|
||||
<metadata>
|
||||
<meta key="%(meta_var)s">%(meta_val)s</meta>
|
||||
</metadata>
|
||||
</createImage>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"reboot" : {
|
||||
"type" : "%(type)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<reboot
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
type="%(type)s"/>
|
@ -0,0 +1,55 @@
|
||||
{
|
||||
"server": {
|
||||
"accessIPv4": "%(ip)s",
|
||||
"accessIPv6": "%(ip6)s",
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
"adminPass": "%(password)s",
|
||||
"created": "%(timestamp)s",
|
||||
"flavor": {
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/openstack/flavors/1",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hostId": "%(hostid)s",
|
||||
"id": "%(uuid)s",
|
||||
"image": {
|
||||
"id": "%(uuid)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/openstack/images/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v2/openstack/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/openstack/servers/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"meta var": "meta val"
|
||||
},
|
||||
"name": "%(name)s",
|
||||
"progress": 0,
|
||||
"status": "ACTIVE",
|
||||
"tenant_id": "openstack",
|
||||
"updated": "%(timestamp)s",
|
||||
"user_id": "fake"
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
id="%(uuid)s"
|
||||
tenantId="openstack" userId="fake"
|
||||
name="%(name)s"
|
||||
hostId="%(hostid)s" progress="0"
|
||||
status="ACTIVE" adminPass="%(password)s"
|
||||
created="%(timestamp)s"
|
||||
updated="%(timestamp)s"
|
||||
accessIPv4="%(ip)s"
|
||||
accessIPv6="%(ip6)s">
|
||||
<image id="%(uuid)s">
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="%(host)s/openstack/images/%(uuid)s"/>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="%(host)s/openstack/images/%(uuid)s"/>
|
||||
</image>
|
||||
<flavor id="1">
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="%(host)s/openstack/flavors/1"/>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="%(host)s/openstack/flavors/1"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="My Server Name">Apache1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="private">
|
||||
<ip version="4" addr="%(ip)s"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="%(host)s/v2/openstack/servers/%(uuid)s"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="%(host)s/openstack/servers/%(uuid)s"/>
|
||||
</server>
|
@ -0,0 +1,18 @@
|
||||
{
|
||||
"rebuild" : {
|
||||
"imageRef" : "%(host)s/v2/32278/images/%(uuid)s",
|
||||
"name" : "%(name)s",
|
||||
"adminPass" : "%(pass)s",
|
||||
"accessIPv4" : "%(ip)s",
|
||||
"accessIPv6" : "%(ip6)s",
|
||||
"metadata" : {
|
||||
"meta var" : "meta val"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rebuild
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
name="%(name)s"
|
||||
imageRef="%(host)s/v1.1/32278/images/%(uuid)s"
|
||||
accessIPv4="%(ip)s"
|
||||
accessIPv6="%(ip6)s"
|
||||
adminPass="%(pass)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>
|
||||
</rebuild>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"resize" : {
|
||||
"flavorRef" : "%(id)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resize
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
flavorRef="%(id)s"/>
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"revertResize" : null
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<revertResize
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"/>
|
@ -200,8 +200,9 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase):
|
||||
'timestamp': '[0-9]{4}-[0,1][0-9]-[0-3][0-9]T'
|
||||
'[0-9]{2}:[0-9]{2}:[0-9]{2}'
|
||||
'(Z|(\+|-)[0-9]{2}:[0-9]{2})',
|
||||
'password': '[0-9a-zA-Z]{12}',
|
||||
'password': '[0-9a-zA-Z]{1,12}',
|
||||
'ip': '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',
|
||||
'ip6': '([0-9a-zA-Z]{1,4}:){1,7}:?[0-9a-zA-Z]',
|
||||
'id': '([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}'
|
||||
'-[0-9a-f]{4}-[0-9a-f]{12})',
|
||||
'uuid': '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}'
|
||||
@ -492,6 +493,77 @@ class LimitsSampleXmlTest(LimitsSampleJsonTest):
|
||||
ctype = 'xml'
|
||||
|
||||
|
||||
class ServersActionsJsonTest(ServersSampleBase):
|
||||
def setUp(self):
|
||||
super(ServersActionsJsonTest, self).setUp()
|
||||
|
||||
def _test_server_action(self, uuid, action,
|
||||
subs={}, resp_tpl=None, code=202):
|
||||
subs.update({'action': action})
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'server-action-%s' % action.lower(),
|
||||
subs)
|
||||
self.assertEqual(response.status, code)
|
||||
if resp_tpl:
|
||||
subs.update(self._get_regexes())
|
||||
return self._verify_response(resp_tpl, subs, response)
|
||||
else:
|
||||
self.assertEqual(response.read(), "")
|
||||
|
||||
def test_server_password(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, "changePassword",
|
||||
{"password": "foo"})
|
||||
|
||||
def test_server_reboot(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, "reboot",
|
||||
{"type": "HARD"})
|
||||
self._test_server_action(uuid, "reboot",
|
||||
{"type": "SOFT"})
|
||||
|
||||
def test_server_rebuild(self):
|
||||
uuid = self._post_server()
|
||||
image = self.api.get_images()[0]['id']
|
||||
subs = {'host': self._get_host(),
|
||||
'uuid': image,
|
||||
'name': 'foobar',
|
||||
'pass': 'seekr3t',
|
||||
'ip': '1.2.3.4',
|
||||
'ip6': 'fe80::100',
|
||||
'hostid': '[a-f0-9]+',
|
||||
}
|
||||
self._test_server_action(uuid, 'rebuild', subs,
|
||||
'server-action-rebuild-resp')
|
||||
|
||||
def test_server_resize(self):
|
||||
FLAGS.allow_resize_to_same_host = True
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, "resize",
|
||||
{"id": 2,
|
||||
"host": self._get_host()})
|
||||
return uuid
|
||||
|
||||
def test_server_revert_resize(self):
|
||||
uuid = self.test_server_resize()
|
||||
self._test_server_action(uuid, "revertResize")
|
||||
|
||||
def test_server_confirm_resize(self):
|
||||
uuid = self.test_server_resize()
|
||||
self._test_server_action(uuid, "confirmResize", code=204)
|
||||
|
||||
def test_server_create_image(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'createImage',
|
||||
{'name': 'foo-image',
|
||||
'meta_var': 'myvar',
|
||||
'meta_val': 'foobar'})
|
||||
|
||||
|
||||
class ServersActionsXmlTest(ServersActionsJsonTest):
|
||||
ctype = 'xml'
|
||||
|
||||
|
||||
class ServerStartStopJsonTest(ServersSampleBase):
|
||||
extension_name = "nova.api.openstack.compute.contrib" + \
|
||||
".server_start_stop.Server_start_stop"
|
||||
|
Loading…
x
Reference in New Issue
Block a user