Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos.core
Commits
65cb6a3f
Commit
65cb6a3f
authored
May 04, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Covert software instance GET and certificate fetching.
parent
feb06320
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
566 additions
and
2 deletions
+566
-2
master/bt5/vifib_slapos_rest_api_v1_test/PathTemplateItem/hosting_subscription_module/template_hosting_subscription.xml
...ing_subscription_module/template_hosting_subscription.xml
+153
-0
master/bt5/vifib_slapos_rest_api_v1_test/PathTemplateItem/software_instance_module/template_software_instance.xml
...m/software_instance_module/template_software_instance.xml
+260
-0
master/bt5/vifib_slapos_rest_api_v1_test/TestTemplateItem/testVifibSlaposRestAPIV1.py
..._api_v1_test/TestTemplateItem/testVifibSlaposRestAPIV1.py
+150
-1
master/bt5/vifib_slapos_rest_api_v1_test/bt/revision
master/bt5/vifib_slapos_rest_api_v1_test/bt/revision
+1
-1
master/bt5/vifib_slapos_rest_api_v1_test/bt/template_path_list
...r/bt5/vifib_slapos_rest_api_v1_test/bt/template_path_list
+2
-0
No files found.
master/bt5/vifib_slapos_rest_api_v1_test/PathTemplateItem/hosting_subscription_module/template_hosting_subscription.xml
0 → 100644
View file @
65cb6a3f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Hosting Subscription"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
predecessor/software_instance_module/template_software_instance
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
RootSoftwareInstance
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
template_hosting_subscription
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Hosting Subscription
</string>
</value>
</item>
<item>
<key>
<string>
root_slave
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
root_software_release_url
</string>
</key>
<value>
<string>
http://example.com/root/software/release
</string>
</value>
</item>
<item>
<key>
<string>
sla_xml
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<?xml version=\'1.0\' encoding=\'utf-8\'?>
\n
<instance>
\n
<parameter
id=
"computer_guid"
>
SOMECOMP
</parameter>
\n
</instance>
\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<?xml version="1.0" encoding="utf-8"?>
\n
<instance>
\n
<parameter
id=
"parameter1"
>
valueof1
</parameter>
\n
<parameter
id=
"parameter2"
>
valueof2
</parameter>
\n
</instance>
]]>
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Template Hosting Subscription
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_rest_api_v1_test/PathTemplateItem/software_instance_module/template_software_instance.xml
0 → 100644
View file @
65cb6a3f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Software Instance"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
connection_xml
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<?xml version=\'1.0\' encoding=\'utf-8\'?>
\n
<instance>
\n
<parameter
id=
"parameter1"
>
valueof1
</parameter>
\n
<parameter
id=
"parameter2"
>
https://niut:pass@example.com:4567/arfarf/oink?m=1#4.5
</parameter>
\n
</instance>
\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
default_destination_reference
</string>
</key>
<value>
<string>
02
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
SItestVifibSlaposRestAPIV1.TestVifibSlaposRestAPIV1.test_instance_destruction_started0.325656030454
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
RootSoftwareInstance
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
template_software_instance
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Software Instance
</string>
</value>
</item>
<item>
<key>
<string>
sla_xml
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<?xml version=\'1.0\' encoding=\'utf-8\'?>
\n
<instance>
\n
<parameter
id=
"computer_guid"
>
SOMECOMP
</parameter>
\n
</instance>
\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
ssl_certificate
</string>
</key>
<value>
<string>
Certificate:\n
Data:\n
Version: 3 (0x2)\n
Serial Number: 2 (0x2)\n
Signature Algorithm: sha1WithRSAEncryption\n
Issuer: C=PL, ST=Silesia, L=Bytom, O=Luke Ltd, CN=Certificate Authority bdbe24bc-889b-11e1-973b-00215dc2e59c/emailAddress=luke@nexedi.com\n
Validity\n
Not Before: Apr 19 14:28:02 2012 GMT\n
Not After : Apr 17 14:28:02 2022 GMT\n
Subject: C=PL, ST=Silesia, O=Luke Ltd, CN=SOFTINST-0/emailAddress=luke@nexedi.com\n
Subject Public Key Info:\n
Public Key Algorithm: rsaEncryption\n
Public-Key: (2048 bit)\n
Modulus:\n
00:b8:98:81:1c:ba:85:f3:d0:a6:bd:83:06:5a:06:\n
4a:b6:1e:ed:32:44:81:9e:97:b9:33:0a:e1:cd:7c:\n
02:f8:1e:c5:56:8e:e6:75:c5:a2:44:a8:60:3d:f1:\n
be:b4:c5:91:00:21:a4:89:a7:00:c3:9f:3d:49:1e:\n
ed:be:37:3b:06:95:56:2f:2f:0a:7f:80:e8:69:13:\n
57:51:54:6e:c6:16:bf:3d:74:3a:84:68:10:ec:be:\n
bc:60:5a:d9:07:dd:00:0a:55:78:d9:6d:42:12:c3:\n
ba:93:f4:8f:16:29:00:21:4c:86:cc:40:0f:61:ad:\n
27:aa:42:8a:ff:59:94:21:c0:d1:25:dc:99:c6:20:\n
3b:43:e0:60:0c:e7:86:e1:18:bc:44:eb:12:77:5f:\n
f8:a7:57:61:e4:63:63:f8:20:48:6e:3b:64:c9:97:\n
ab:4b:ea:3a:e8:96:e9:ff:98:36:aa:d8:c6:77:c5:\n
eb:48:24:05:a9:b0:45:34:ea:81:57:df:64:29:a0:\n
fa:0e:5c:d2:ff:47:5a:90:63:a6:3d:27:19:31:88:\n
07:0e:d0:17:ae:17:1a:c8:fc:e8:75:ca:17:24:33:\n
99:4d:51:c2:6b:26:69:35:94:88:97:3c:68:d1:b5:\n
6b:84:75:55:fa:0c:15:d1:8a:80:d1:7e:aa:0a:4e:\n
4e:e7\n
Exponent: 65537 (0x10001)\n
X509v3 extensions:\n
X509v3 Basic Constraints: \n
CA:FALSE\n
Netscape Comment: \n
OpenSSL Generated Certificate\n
X509v3 Subject Key Identifier: \n
DE:9F:89:65:E1:7C:A3:88:A1:EE:79:A4:81:A8:97:C5:F5:E5:6B:DA\n
X509v3 Authority Key Identifier: \n
keyid:98:C1:BA:FC:AE:0A:0E:B1:0D:80:79:95:1A:7B:BE:6E:F4:DE:31:9E\n
\n
Signature Algorithm: sha1WithRSAEncryption\n
73:b2:c7:a9:e2:75:b7:69:a7:11:1b:8b:8a:eb:1f:bd:37:a8:\n
73:d0:67:00:d9:54:ca:c3:82:f5:f4:e1:6f:0d:ad:2c:50:b2:\n
ec:74:ae:c1:87:bc:33:4e:8e:e7:56:be:1c:77:7f:7c:2d:90:\n
19:54:ed:ac:a7:99:cb:01:4c:df:ca:c7:9f:56:32:3e:7a:98:\n
fe:bf:73:fc:12:d3:33:dc:f4:10:16:0a:1f:c4:10:33:e0:14:\n
0a:2f:dd:7a:5d:34:ec:1a:b0:68:d1:ec:91:cb:9a:c6:b7:8a:\n
04:b8:69:50:b0:ef:34:2a:62:af:95:43:86:5b:6c:92:65:25:\n
e5:6d:0c:95:f3:f7:19:0f:33:71:12:80:fe:21:da:f1:8a:24:\n
bb:ae:75:3d:af:b6:22:f4:01:26:31:23:1f:a9:8d:6a:7c:a8:\n
1a:81:7b:38:12:e1:95:62:3c:22:f1:66:81:8e:88:6b:a6:e0:\n
0e:9a:54:69:08:96:ad:42:d4:43:0c:8a:48:7b:fc:72:9c:b8:\n
7c:f9:7b:6f:55:35:86:66:26:92:2c:5f:8d:0a:85:94:87:c4:\n
41:cb:b7:35:52:80:a6:5a:f4:0d:a8:93:bc:88:41:29:d5:cf:\n
af:bd:f2:e5:28:a1:cb:d6:d2:aa:c3:e4:0e:0b:11:e9:85:ea:\n
7b:2d:7b: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SYwbr8rgoOsQ2AeZUae75u9N4xnjANBgkqhkiG9w0B\n
AQUFAAOCAQEAc7LHqeJ1t2mnERuLiusfvTeoc9BnANlUysOC9fThbw2tLFCy7HSu\n
wYe8M06O51a+HHd/fC2QGVTtrKeZywFM38rHn1YyPnqY/r9z/BLTM9z0EBYKH8QQ\n
M+AUCi/del007BqwaNHskcuaxreKBLhpULDvNCpir5VDhltskmUl5W0MlfP3GQ8z\n
cRKA/iHa8Yoku651Pa+2IvQBJjEjH6mNanyoGoF7OBLhlWI8IvFmgY6Ia6bgDppU\n
aQiWrULUQwyKSHv8cpy4fPl7b1U1hmYmkixfjQqFlIfEQcu3NVKAplr0DaiTvIhB\n
KdXPr73y5Sihy9bSqsPkDgsR6YXqey17FA==\n
-----END CERTIFICATE-----\n
</string>
</value>
</item>
<item>
<key>
<string>
ssl_key
</string>
</key>
<value>
<string>
-----BEGIN PRIVATE KEY-----\n
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4mIEcuoXz0Ka9\n
gwZaBkq2Hu0yRIGel7kzCuHNfAL4HsVWjuZ1xaJEqGA98b60xZEAIaSJpwDDnz1J\n
Hu2+NzsGlVYvLwp/gOhpE1dRVG7GFr89dDqEaBDsvrxgWtkH3QAKVXjZbUISw7qT\n
9I8WKQAhTIbMQA9hrSeqQor/WZQhwNEl3JnGIDtD4GAM54bhGLxE6xJ3X/inV2Hk\n
Y2P4IEhuO2TJl6tL6jrolun/mDaq2MZ3xetIJAWpsEU06oFX32QpoPoOXNL/R1qQ\n
Y6Y9JxkxiAcO0BeuFxrI/Oh1yhckM5lNUcJrJmk1lIiXPGjRtWuEdVX6DBXRioDR\n
fqoKTk7nAgMBAAECggEAMh9et3FCHADktYKVP+6DbM4a89I8K9bgt6ZVx5jLqZmZ\n
VbZ5hzMBq4jYkRlKAgW/KHz6E1JgV72uQ2N9hG+0vEXiX+9y90oGUTmqNPArH+hf\n
Rw1/MiKbrdzgg31HfuYYM7Yfm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Cvq9Ta+JM7S1M1hwTCkKPACLa7hC\n
wEsr7FKBunKvatC4k/gNd6dc\n
-----END PRIVATE KEY-----\n
</string>
</value>
</item>
<item>
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<?xml version="1.0" encoding="utf-8"?>
\n
<instance>
\n
<parameter
id=
"parameter1"
>
valueof1
</parameter>
\n
<parameter
id=
"parameter2"
>
valueof2
</parameter>
\n
</instance>
]]>
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Template Software Instance
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_rest_api_v1_test/TestTemplateItem/testVifibSlaposRestAPIV1.py
View file @
65cb6a3f
...
...
@@ -41,7 +41,7 @@ class VifibSlaposRestAPIV1Mixin(ERP5TypeTestCase):
def
createPerson
(
self
):
customer
=
self
.
cloneByPath
(
'person_module/template_member'
)
customer_reference
=
'P'
+
self
.
test_random_id
customer_reference
=
'P'
+
self
.
generateNewId
()
customer
.
edit
(
reference
=
customer_reference
,
default_email_url_string
=
customer_reference
+
'@example.com'
)
...
...
@@ -364,6 +364,38 @@ class TestVifibSlaposRestAPIV1InstanceRequest(VifibSlaposRestAPIV1Mixin):
# and with correct ones are set by default
class
TestVifibSlaposRestAPIV1Instance
(
VifibSlaposRestAPIV1Mixin
):
def
afterSetUp
(
self
):
VifibSlaposRestAPIV1Mixin
.
afterSetUp
(
self
)
self
.
software_instance
=
self
.
createSoftwareInstance
(
self
.
customer
)
def
createSoftwareInstance
(
self
,
person
):
software_instance
=
self
.
cloneByPath
(
'software_instance_module/template_software_instance'
)
hosting_subscription
=
self
.
cloneByPath
(
'hosting_subscription_module/template_hosting_subscription'
)
software_instance
.
edit
(
reference
=
'SI'
+
self
.
test_random_id
,
ssl_key
=
'SSL Key'
,
ssl_certificate
=
'SSL Certificate'
)
software_instance
.
validate
()
hosting_subscription
.
edit
(
reference
=
'HS'
+
self
.
test_random_id
,
predecessor
=
software_instance
.
getRelativeUrl
(),
destination_section
=
person
.
getRelativeUrl
()
)
hosting_subscription
.
validate
()
transaction
.
commit
()
hosting_subscription
.
updateLocalRolesOnSecurityGroups
()
transaction
.
commit
()
hosting_subscription
.
recursiveImmediateReindexObject
()
transaction
.
commit
()
software_instance
.
manage_setLocalRoles
(
person
.
getReference
(),
[
'Assignee'
])
transaction
.
commit
()
software_instance
.
recursiveImmediateReindexObject
()
return
software_instance
def
test_OPTIONS_not_logged_in
(
self
):
self
.
connection
=
CustomHeaderHTTPConnection
(
host
=
self
.
api_netloc
,
custom_header
=
{
...
...
@@ -376,3 +408,120 @@ class TestVifibSlaposRestAPIV1Instance(VifibSlaposRestAPIV1Mixin):
self
.
assertResponseCode
(
204
)
self
.
assertResponseNoContentType
()
self
.
assertSimulatorEmpty
()
def
test_software_instance_GET_non_existing
(
self
):
non_existing
=
'software_instance_module/'
+
self
.
generateNewId
()
try
:
self
.
portal
.
restrictedTraverse
(
non_existing
)
except
KeyError
:
pass
else
:
raise
AssertionError
(
'It was impossible to test'
)
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
non_existing
]),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
404
)
def
test_software_instance_GET_something_else
(
self
):
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getPredecessorRelatedValue
().
getRelativeUrl
()]),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
404
)
def
test_software_instance_GET
(
self
):
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getRelativeUrl
()]),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
200
)
self
.
assertResponseJson
()
self
.
assertEqual
({
"status"
:
"draft"
,
"connection"
:
{
"parameter1"
:
"valueof1"
,
"parameter2"
:
"https://niut:pass@example.com:4567/arfarf/oink?m=1#4.5"
},
"partition"
:
{
"public_ip"
:
[],
"tap_interface"
:
""
,
"private_ip"
:
[]},
"slave"
:
False
,
"children_list"
:
[],
"title"
:
"Template Software Instance"
,
"software_type"
:
"RootSoftwareInstance"
,
"parameter"
:
{
"parameter1"
:
"valueof1"
,
"parameter2"
:
"valueof2"
},
"software_release"
:
""
,
"sla"
:
{
"computer_guid"
:
"SOMECOMP"
}},
self
.
json_response
)
def
test_software_instance_GET_other_one
(
self
):
person
,
person_reference
=
self
.
createPerson
()
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getRelativeUrl
()]),
headers
=
{
'REMOTE_USER'
:
person_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
404
)
def
test_software_instance_GET_certificate
(
self
):
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getRelativeUrl
(),
'certificate'
]),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
200
)
self
.
assertResponseJson
()
self
.
assertEqual
({
"ssl_key"
:
"SSL Key"
,
"ssl_certificate"
:
"SSL Certificate"
},
self
.
json_response
)
def
test_software_instance_GET_certificate_non_existing
(
self
):
non_existing
=
'software_instance_module/'
+
self
.
generateNewId
()
try
:
self
.
portal
.
restrictedTraverse
(
non_existing
)
except
KeyError
:
pass
else
:
raise
AssertionError
(
'It was impossible to test'
)
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
non_existing
,
'certificate'
]),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
404
)
def
test_software_instance_GET_certificate_something_else
(
self
):
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getPredecessorRelatedValue
().
getRelativeUrl
(),
'certificate'
]),
headers
=
{
'REMOTE_USER'
:
self
.
customer_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
404
)
def
test_software_instance_GET_certificate_other_one
(
self
):
person
,
person_reference
=
self
.
createPerson
()
self
.
connection
.
request
(
method
=
'GET'
,
url
=
'/'
.
join
([
self
.
api_path
,
'instance'
,
self
.
software_instance
.
getRelativeUrl
(),
'certificate'
]),
headers
=
{
'REMOTE_USER'
:
person_reference
})
self
.
prepareResponse
()
self
.
assertBasicResponse
()
self
.
assertResponseCode
(
404
)
master/bt5/vifib_slapos_rest_api_v1_test/bt/revision
View file @
65cb6a3f
17
\ No newline at end of file
18
\ No newline at end of file
master/bt5/vifib_slapos_rest_api_v1_test/bt/template_path_list
0 → 100644
View file @
65cb6a3f
hosting_subscription_module/template_hosting_subscription
software_instance_module/template_software_instance
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment