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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
8e13c762
Commit
8e13c762
authored
May 04, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create template software release.
Fix state name. Fix instance_xml, sla_xml.
parent
fc7d38f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
206 additions
and
34 deletions
+206
-34
master/bt5/vifib_slapos_core_test/PathTemplateItem/software_release_module/template_software_release.xml
...tem/software_release_module/template_software_release.xml
+105
-0
master/bt5/vifib_slapos_core_test/TestTemplateItem/testSlapOSCorePersonRequest.py
...core_test/TestTemplateItem/testSlapOSCorePersonRequest.py
+97
-32
master/bt5/vifib_slapos_core_test/bt/revision
master/bt5/vifib_slapos_core_test/bt/revision
+1
-1
master/bt5/vifib_slapos_core_test/bt/template_path_list
master/bt5/vifib_slapos_core_test/bt/template_path_list
+3
-1
No files found.
master/bt5/vifib_slapos_core_test/PathTemplateItem/software_release_module/template_software_release.xml
0 → 100644
View file @
8e13c762
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Software Release"
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>
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>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</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>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
template_software_release
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Software Release
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Software Release Template
</string>
</value>
</item>
<item>
<key>
<string>
url_protocol
</string>
</key>
<value>
<string>
http
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_core_test/TestTemplateItem/testSlapOSCorePersonRequest.py
View file @
8e13c762
...
...
@@ -8,10 +8,35 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
return
self
.
getPortalObject
().
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewSoftwareReleaseUrl
(
self
):
return
'http://example.org/test%s.cfg'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
portal
=
self
.
getPortalObject
()
new_id
=
self
.
generateNewId
()
# Clone software release document
software_release
=
portal
.
software_release_module
.
template_software_release
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
software_release
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
url_string
=
self
.
generateNewSoftwareReleaseUrl
(),
)
software_release
.
publish
()
self
.
software_release
=
software_release
new_id
=
self
.
generateNewId
()
software_release
=
portal
.
software_release_module
.
template_software_release
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
software_release
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
url_string
=
self
.
generateNewSoftwareReleaseUrl
(),
)
software_release
.
publish
()
self
.
software_release2
=
software_release
# Clone person document
person_user
=
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -37,10 +62,13 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
def
test_Person_requestSoftwareInstance_requiredParameter
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
state
=
"started"
...
...
@@ -130,10 +158,13 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
def
test_Person_requestSoftwareInstance_acceptedState
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
state
=
"started"
...
...
@@ -159,7 +190,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
state
=
"started"
,
)
hosting_subscription
=
person
.
REQUEST
.
get
(
'request_hosting_subscription'
)
self
.
assertEquals
(
"started"
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"start
_request
ed"
,
hosting_subscription
.
getSlapState
())
person
.
requestSoftwareInstance
(
software_release
=
software_release
,
...
...
@@ -171,7 +202,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
state
=
"stopped"
,
)
hosting_subscription
=
person
.
REQUEST
.
get
(
'request_hosting_subscription'
)
self
.
assertEquals
(
"stop
p
ed"
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"stop
_request
ed"
,
hosting_subscription
.
getSlapState
())
person
.
requestSoftwareInstance
(
software_release
=
software_release
,
...
...
@@ -183,15 +214,18 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
state
=
"destroyed"
,
)
hosting_subscription
=
person
.
REQUEST
.
get
(
'request_hosting_subscription'
)
self
.
assertEquals
(
"destroyed"
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"destroy
_request
ed"
,
hosting_subscription
.
getSlapState
())
def
test_Person_requestSoftwareInstance_returnHostingSubscriptionUrl
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
state
=
"started"
...
...
@@ -212,10 +246,13 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
def
test_Person_requestSoftwareInstance_createHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
state
=
"started"
...
...
@@ -241,7 +278,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
self
.
assertEquals
(
instance_xml
,
hosting_subscription
.
getTextContent
())
self
.
assertEquals
(
sla_xml
,
hosting_subscription
.
getSlaXml
())
self
.
assertEquals
(
shared
,
hosting_subscription
.
getRootSlave
())
self
.
assertEquals
(
state
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"start_requested"
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"HOSTSUBS-%s"
%
(
previous_id
+
1
),
hosting_subscription
.
getReference
())
self
.
assertEquals
(
"validated"
,
hosting_subscription
.
getValidationState
())
...
...
@@ -249,10 +286,13 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
def
test_Person_requestSoftwareInstance_HostingSubscriptionNotReindexed
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
state
=
"started"
...
...
@@ -281,10 +321,13 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
def
test_Person_requestSoftwareInstance_updateHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
state
=
"started"
...
...
@@ -304,10 +347,16 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
transaction
.
commit
()
self
.
tic
()
software_release2
=
"http://example.org/test.cfg2"
software_release2
=
self
.
software_release
.
getUrlString
()
software_type2
=
"test2"
instance_xml2
=
"test2"
sla_xml2
=
"test2"
instance_xml2
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
</instance>"""
sla_xml2
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
</instance>"""
shared2
=
False
state2
=
"stopped"
...
...
@@ -334,16 +383,19 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
self
.
assertEquals
(
instance_xml2
,
hosting_subscription
.
getTextContent
())
self
.
assertEquals
(
sla_xml2
,
hosting_subscription
.
getSlaXml
())
self
.
assertEquals
(
shared2
,
hosting_subscription
.
getRootSlave
())
self
.
assertEquals
(
state2
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"stop_requested"
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"validated"
,
hosting_subscription
.
getValidationState
())
def
test_Person_requestSoftwareInstance_duplicatedHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
state
=
"started"
...
...
@@ -380,11 +432,15 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
def
test_Person_requestSoftwareInstance_HostingSubscriptionNewTitle
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
sla_xml
=
"test"
instance_xml
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
</instance>"""
sla_xml
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
</instance>"""
shared
=
True
state
=
"started"
...
...
@@ -401,11 +457,17 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
transaction
.
commit
()
software_release2
=
"http://example.org/test.cfg2"
software_release2
=
self
.
software_release
.
getUrlString
()
software_title2
=
"test2"
software_type2
=
"test2"
instance_xml2
=
"test2"
sla_xml2
=
"test2"
instance_xml2
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
</instance>"""
sla_xml2
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
</instance>"""
shared2
=
False
state2
=
"stopped"
...
...
@@ -432,16 +494,19 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
self
.
assertEquals
(
instance_xml2
,
hosting_subscription2
.
getTextContent
())
self
.
assertEquals
(
sla_xml2
,
hosting_subscription2
.
getSlaXml
())
self
.
assertEquals
(
shared2
,
hosting_subscription2
.
getRootSlave
())
self
.
assertEquals
(
state2
,
hosting_subscription2
.
getSlapState
())
self
.
assertEquals
(
"stop_requested"
,
hosting_subscription2
.
getSlapState
())
self
.
assertEquals
(
"validated"
,
hosting_subscription2
.
getValidationState
())
def
test_Person_requestSoftwareInstance_noConflictWithDeletedHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPersonValue
()
software_release
=
"http://example.org/test.cfg"
software_release
=
self
.
software_release
.
getUrlString
()
software_title
=
"test"
software_type
=
"test"
instance_xml
=
"test"
instance_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>
"""
sla_xml
=
"test"
shared
=
True
...
...
@@ -455,7 +520,7 @@ class TestSlapOSCorePersonRequest(ERP5TypeTestCase):
state
=
"destroyed"
,
)
hosting_subscription
=
person
.
REQUEST
.
get
(
'request_hosting_subscription'
)
self
.
assertEquals
(
"destroyed"
,
hosting_subscription
.
getSlapState
())
self
.
assertEquals
(
"destroy
_request
ed"
,
hosting_subscription
.
getSlapState
())
transaction
.
commit
()
self
.
tic
()
...
...
master/bt5/vifib_slapos_core_test/bt/revision
View file @
8e13c762
4
\ No newline at end of file
5
\ No newline at end of file
master/bt5/vifib_slapos_core_test/bt/template_path_list
View file @
8e13c762
person_module/template_member
person_module/template_member/**
\ No newline at end of file
person_module/template_member/**
software_release_module/template_software_release
software_release_module/template_software_release/**
\ 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