Adds V3 API samples for remote consoles, deferred delete
Adds V3 API samples for remote consoles, deferred delete extensions. Bundling them together to save on review load Partially implements blueprint v3-api-unittests Partially implements blueprint v3-api-specification Change-Id: I595532d9e1b8eed80336c0258be3e9d07ec7461e
This commit is contained in:
parent
4e842e38a2
commit
c4b8dd6a39
@ -0,0 +1,3 @@
|
||||
{
|
||||
"force_delete": null
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<force_delete />
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"restore": null
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<restore />
|
16
doc/v3/api_samples/os-deferred-delete/server-post-req.json
Normal file
16
doc/v3/api_samples/os-deferred-delete/server-post-req.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
19
doc/v3/api_samples/os-deferred-delete/server-post-req.xml
Normal file
19
doc/v3/api_samples/os-deferred-delete/server-post-req.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" flavor_ref="http://openstack.example.com/openstack/flavors/1" name="new-server-test">
|
||||
<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>
|
16
doc/v3/api_samples/os-deferred-delete/server-post-resp.json
Normal file
16
doc/v3/api_samples/os-deferred-delete/server-post-resp.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "hqgU8QzT54wF",
|
||||
"id": "4a3bde9b-fa37-408d-b167-68e1724c923e",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/4a3bde9b-fa37-408d-b167-68e1724c923e",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/4a3bde9b-fa37-408d-b167-68e1724c923e",
|
||||
"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="1259ad4e-7541-4079-9794-bf7cb8ec3579" admin_pass="JBxtVyh6ggbm">
|
||||
<metadata/>
|
||||
<atom:link href="http://openstack.example.com/v3/servers/1259ad4e-7541-4079-9794-bf7cb8ec3579" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/servers/1259ad4e-7541-4079-9794-bf7cb8ec3579" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"get_spice_console": {
|
||||
"type": "spice-html5"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<get_spice_console>
|
||||
<type>spice-html5</type>
|
||||
</get_spice_console>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"console": {
|
||||
"type": "spice-html5",
|
||||
"url": "http://127.0.0.1:6082/spice_auto.html?token=a30e5d08-6a20-4043-958f-0852440c6af4"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<console>
|
||||
<url>http://127.0.0.1:6082/spice_auto.html?token=45eb7f39-5157-4864-a443-41ac2d498748</url>
|
||||
<type>spice-html5</type>
|
||||
</console>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"get_vnc_console": {
|
||||
"type": "novnc"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<get_vnc_console>
|
||||
<type>novnc</type>
|
||||
</get_vnc_console>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"console": {
|
||||
"type": "novnc",
|
||||
"url": "http://127.0.0.1:6080/vnc_auto.html?token=191996c3-7b0f-42f3-95a7-f1839f2da6ed"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<console>
|
||||
<url>http://127.0.0.1:6080/vnc_auto.html?token=ba493af2-559b-4893-951c-a835bdd3f823</url>
|
||||
<type>novnc</type>
|
||||
</console>
|
16
doc/v3/api_samples/os-remote-consoles/server-post-req.json
Normal file
16
doc/v3/api_samples/os-remote-consoles/server-post-req.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
19
doc/v3/api_samples/os-remote-consoles/server-post-req.xml
Normal file
19
doc/v3/api_samples/os-remote-consoles/server-post-req.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" flavor_ref="http://openstack.example.com/openstack/flavors/1" name="new-server-test">
|
||||
<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>
|
16
doc/v3/api_samples/os-remote-consoles/server-post-resp.json
Normal file
16
doc/v3/api_samples/os-remote-consoles/server-post-resp.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "Kwg5tff6KiUU",
|
||||
"id": "8619225c-67c8-424f-9b46-cec5bad137a2",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/8619225c-67c8-424f-9b46-cec5bad137a2",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/8619225c-67c8-424f-9b46-cec5bad137a2",
|
||||
"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="7cfaf61c-9b84-40b1-95f3-4ecd07b7b4db" admin_pass="cAKiM6sT5LaU">
|
||||
<metadata/>
|
||||
<atom:link href="http://openstack.example.com/v3/servers/7cfaf61c-9b84-40b1-95f3-4ecd07b7b4db" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/servers/7cfaf61c-9b84-40b1-95f3-4ecd07b7b4db" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"force_delete": null
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<force_delete />
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"restore": null
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<restore />
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
|
||||
"flavor_ref" : "%(host)s/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="%(host)s/openstack/images/%(image_id)s" flavor_ref="%(host)s/openstack/flavors/1" name="new-server-test">
|
||||
<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": {
|
||||
"admin_pass": "%(password)s",
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/servers/%(uuid)s",
|
||||
"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="%(id)s" admin_pass="%(password)s">
|
||||
<metadata/>
|
||||
<atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
|
||||
<atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"get_spice_console": {
|
||||
"type": "spice-html5"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<get_spice_console>
|
||||
<type>spice-html5</type>
|
||||
</get_spice_console>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"console": {
|
||||
"type": "spice-html5",
|
||||
"url": "http://127.0.0.1:6082/spice_auto.html?token=%(uuid)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<console>
|
||||
<url>http://127.0.0.1:6082/spice_auto.html?token=%(uuid)s</url>
|
||||
<type>spice-html5</type>
|
||||
</console>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"get_vnc_console": {
|
||||
"type": "novnc"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<get_vnc_console>
|
||||
<type>novnc</type>
|
||||
</get_vnc_console>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"console": {
|
||||
"type": "novnc",
|
||||
"url": "http://127.0.0.1:6080/vnc_auto.html?token=%(uuid)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<console>
|
||||
<url>http://127.0.0.1:6080/vnc_auto.html?token=%(uuid)s</url>
|
||||
<type>novnc</type>
|
||||
</console>
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
|
||||
"flavor_ref" : "%(host)s/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="%(host)s/openstack/images/%(image_id)s" flavor_ref="%(host)s/openstack/flavors/1" name="new-server-test">
|
||||
<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": {
|
||||
"admin_pass": "%(password)s",
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v3/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/servers/%(uuid)s",
|
||||
"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="%(id)s" admin_pass="%(password)s">
|
||||
<metadata/>
|
||||
<atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
|
||||
<atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
|
||||
</server>
|
47
nova/tests/integrated/v3/test_deferred_delete.py
Normal file
47
nova/tests/integrated/v3/test_deferred_delete.py
Normal file
@ -0,0 +1,47 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
# Copyright 2012 Nebula, Inc.
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova.tests.integrated.v3 import test_servers
|
||||
|
||||
|
||||
class DeferredDeleteSampleJsonTests(test_servers.ServersSampleBase):
|
||||
extension_name = "os-deferred-delete"
|
||||
|
||||
def setUp(self):
|
||||
super(DeferredDeleteSampleJsonTests, self).setUp()
|
||||
self.flags(reclaim_instance_interval=1)
|
||||
|
||||
def test_restore(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_delete('servers/%s' % uuid)
|
||||
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'restore-post-req', {})
|
||||
self.assertEqual(response.status, 202)
|
||||
self.assertEqual(response.read(), '')
|
||||
|
||||
def test_force_delete(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_delete('servers/%s' % uuid)
|
||||
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'force-delete-post-req', {})
|
||||
self.assertEqual(response.status, 202)
|
||||
self.assertEqual(response.read(), '')
|
||||
|
||||
|
||||
class DeferredDeleteSampleXmlTests(DeferredDeleteSampleJsonTests):
|
||||
ctype = 'xml'
|
51
nova/tests/integrated/v3/test_remote_consoles.py
Normal file
51
nova/tests/integrated/v3/test_remote_consoles.py
Normal file
@ -0,0 +1,51 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
# Copyright 2012 Nebula, Inc.
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova.tests.integrated.v3 import test_servers
|
||||
|
||||
|
||||
class ConsolesSampleJsonTests(test_servers.ServersSampleBase):
|
||||
extension_name = "os-remote-consoles"
|
||||
|
||||
def setUp(self):
|
||||
super(ConsolesSampleJsonTests, self).setUp()
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='spice')
|
||||
|
||||
def test_get_vnc_console(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'get-vnc-console-post-req',
|
||||
{'action': 'os-getVNCConsole'})
|
||||
subs = self._get_regexes()
|
||||
subs["url"] = \
|
||||
"((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)"
|
||||
self._verify_response('get-vnc-console-post-resp', subs, response, 200)
|
||||
|
||||
def test_get_spice_console(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'get-spice-console-post-req',
|
||||
{'action': 'os-getSPICEConsole'})
|
||||
subs = self._get_regexes()
|
||||
subs["url"] = \
|
||||
"((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)"
|
||||
self._verify_response('get-spice-console-post-resp', subs,
|
||||
response, 200)
|
||||
|
||||
|
||||
class ConsolesSampleXmlTests(ConsolesSampleJsonTests):
|
||||
ctype = 'xml'
|
Loading…
x
Reference in New Issue
Block a user