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
Eric Zheng
slapos.core
Commits
37c9b322
Commit
37c9b322
authored
Nov 06, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorise tree creation.
parent
6ba03c85
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
252 deletions
+79
-252
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSAllocateInstanceAlarm.py
...TemplateItem/testSlapOSCoreSlapOSAllocateInstanceAlarm.py
+1
-59
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSAssertHostingSubscriptionPredecessorAlarm.py
...pOSCoreSlapOSAssertHostingSubscriptionPredecessorAlarm.py
+1
-59
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSFreeComputerPartitionAlarm.py
...ateItem/testSlapOSCoreSlapOSFreeComputerPartitionAlarm.py
+1
-59
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSGarbageCollectDestroyedRootTreeAlarm.py
...stSlapOSCoreSlapOSGarbageCollectDestroyedRootTreeAlarm.py
+1
-74
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
master/product/SlapOS/tests/testSlapOSMixin.py
master/product/SlapOS/tests/testSlapOSMixin.py
+74
-0
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSAllocateInstanceAlarm.py
View file @
37c9b322
...
...
@@ -8,65 +8,7 @@ class TestSlapOSAllocation(testSlapOSMixin):
def
afterSetUp
(
self
):
super
(
TestSlapOSAllocation
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
new_id
=
self
.
generateNewId
()
self
.
request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_title
=
self
.
generateNewSoftwareTitle
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateEmptyXml
(),
shared
=
False
,
state
=
"started"
)
# Clone person document
self
.
person_user
=
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
new_id
,
)
self
.
person_user
.
validate
()
for
assignment
in
self
.
person_user
.
contentValues
(
portal_type
=
"Assignment"
):
assignment
.
open
()
transaction
.
commit
()
# prepare part of tree
hosting_subscription
=
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
software_instance
=
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTHS-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
predecessor
=
self
.
software_instance
.
getRelativeUrl
(),
destination_section
=
self
.
person_user
.
getRelativeUrl
()
)
hosting_subscription
.
validate
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
hosting_subscription
,
'start_requested'
)
self
.
software_instance
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTSI-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
hosting_subscription
.
getRelativeUrl
(),
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
software_instance
,
'start_requested'
)
self
.
software_instance
.
validate
()
self
.
tic
()
self
.
_makeTree
()
self
.
login
()
def
beforeTearDown
(
self
):
...
...
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSAssertHostingSubscriptionPredecessorAlarm.py
View file @
37c9b322
...
...
@@ -10,65 +10,7 @@ class TestSlapOSCoreSlapOSAssertHostingSubscriptionPredecessorAlarm(
def
afterSetUp
(
self
):
super
(
TestSlapOSCoreSlapOSAssertHostingSubscriptionPredecessorAlarm
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
new_id
=
self
.
generateNewId
()
self
.
request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_title
=
self
.
generateNewSoftwareTitle
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateEmptyXml
(),
shared
=
False
,
state
=
"started"
)
# Clone person document
self
.
person_user
=
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
new_id
,
)
self
.
person_user
.
validate
()
for
assignment
in
self
.
person_user
.
contentValues
(
portal_type
=
"Assignment"
):
assignment
.
open
()
transaction
.
commit
()
# prepare part of tree
self
.
hosting_subscription
=
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
software_instance
=
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
hosting_subscription
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTHS-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
predecessor
=
self
.
software_instance
.
getRelativeUrl
(),
destination_section
=
self
.
person_user
.
getRelativeUrl
()
)
self
.
hosting_subscription
.
validate
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
hosting_subscription
,
'start_requested'
)
self
.
software_instance
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTSI-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
self
.
hosting_subscription
.
getRelativeUrl
(),
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
software_instance
,
'start_requested'
)
self
.
software_instance
.
validate
()
self
.
tic
()
self
.
_makeTree
()
self
.
login
()
def
test_HostingSubscription_assertPredecessor
(
self
):
...
...
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSFreeComputerPartitionAlarm.py
View file @
37c9b322
...
...
@@ -8,65 +8,7 @@ class TestSlapOSFreeComputerPartitionAlarm(testSlapOSMixin):
def
afterSetUp
(
self
):
super
(
TestSlapOSFreeComputerPartitionAlarm
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
new_id
=
self
.
generateNewId
()
self
.
request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_title
=
self
.
generateNewSoftwareTitle
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateEmptyXml
(),
shared
=
False
,
state
=
"started"
)
# Clone person document
self
.
person_user
=
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
new_id
,
)
self
.
person_user
.
validate
()
for
assignment
in
self
.
person_user
.
contentValues
(
portal_type
=
"Assignment"
):
assignment
.
open
()
transaction
.
commit
()
# prepare part of tree
hosting_subscription
=
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
software_instance
=
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTHS-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
predecessor
=
self
.
software_instance
.
getRelativeUrl
(),
destination_section
=
self
.
person_user
.
getRelativeUrl
()
)
hosting_subscription
.
validate
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
hosting_subscription
,
'start_requested'
)
self
.
software_instance
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTSI-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
hosting_subscription
.
getRelativeUrl
(),
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
software_instance
,
'start_requested'
)
self
.
software_instance
.
validate
()
self
.
tic
()
self
.
_makeTree
()
self
.
login
()
def
test_Instance_tryToUnallocatePartition
(
self
):
...
...
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSlapOSGarbageCollectDestroyedRootTreeAlarm.py
View file @
37c9b322
...
...
@@ -8,80 +8,7 @@ class TestSlapOSGarbageCollectDestroyedRootTreeAlarm(testSlapOSMixin):
def
afterSetUp
(
self
):
super
(
TestSlapOSGarbageCollectDestroyedRootTreeAlarm
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
new_id
=
self
.
generateNewId
()
self
.
request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_title
=
self
.
generateNewSoftwareTitle
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateEmptyXml
(),
shared
=
False
,
state
=
"started"
)
# Clone person document
self
.
person_user
=
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
new_id
,
)
self
.
person_user
.
validate
()
for
assignment
in
self
.
person_user
.
contentValues
(
portal_type
=
"Assignment"
):
assignment
.
open
()
transaction
.
commit
()
# prepare part of tree
self
.
hosting_subscription
=
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
software_instance
=
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
hosting_subscription
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTHS-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
predecessor
=
self
.
software_instance
.
getRelativeUrl
(),
destination_section
=
self
.
person_user
.
getRelativeUrl
()
)
self
.
hosting_subscription
.
validate
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
hosting_subscription
,
'start_requested'
)
self
.
requested_software_instance
=
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
software_instance
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTSI-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
self
.
hosting_subscription
.
getRelativeUrl
(),
predecessor
=
self
.
requested_software_instance
.
getRelativeUrl
()
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
software_instance
,
'start_requested'
)
self
.
software_instance
.
validate
()
self
.
requested_software_instance
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTSI-%s"
%
self
.
generateNewId
(),
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
self
.
hosting_subscription
.
getRelativeUrl
(),
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
requested_software_instance
,
'start_requested'
)
self
.
requested_software_instance
.
validate
()
self
.
tic
()
self
.
_makeTree
()
self
.
login
()
def
test_Instance_tryToGarbageCollect
(
self
):
...
...
master/bt5/slapos_cloud/bt/revision
View file @
37c9b322
207
\ No newline at end of file
208
\ No newline at end of file
master/product/SlapOS/tests/testSlapOSMixin.py
View file @
37c9b322
...
...
@@ -122,6 +122,80 @@ class testSlapOSMixin(Products.Vifib.tests.VifibMixin.testVifibMixin):
]
return
result
def
_makeTree
(
self
):
new_id
=
self
.
generateNewId
()
self
.
request_kw
=
dict
(
software_release
=
self
.
generateNewSoftwareReleaseUrl
(),
software_title
=
self
.
generateNewSoftwareTitle
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateEmptyXml
(),
shared
=
False
,
state
=
"started"
)
# Clone person document
self
.
person_user
=
self
.
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
new_id
,
)
self
.
person_user
.
validate
()
for
assignment
in
self
.
person_user
.
contentValues
(
portal_type
=
"Assignment"
):
assignment
.
open
()
transaction
.
commit
()
# prepare part of tree
self
.
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
software_instance
=
self
.
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
hosting_subscription
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTHS-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
predecessor
=
self
.
software_instance
.
getRelativeUrl
(),
destination_section
=
self
.
person_user
.
getRelativeUrl
()
)
self
.
hosting_subscription
.
validate
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
hosting_subscription
,
'start_requested'
)
self
.
requested_software_instance
=
self
.
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
software_instance
.
edit
(
title
=
self
.
request_kw
[
'software_title'
],
reference
=
"TESTSI-%s"
%
new_id
,
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
self
.
hosting_subscription
.
getRelativeUrl
(),
predecessor
=
self
.
requested_software_instance
.
getRelativeUrl
()
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
software_instance
,
'start_requested'
)
self
.
software_instance
.
validate
()
self
.
requested_software_instance
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTSI-%s"
%
self
.
generateNewId
(),
url_string
=
self
.
request_kw
[
'software_release'
],
source_reference
=
self
.
request_kw
[
'software_type'
],
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
self
.
hosting_subscription
.
getRelativeUrl
(),
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
requested_software_instance
,
'start_requested'
)
self
.
requested_software_instance
.
validate
()
self
.
tic
()
def
_makeComputer
(
self
):
self
.
computer
=
self
.
portal
.
computer_module
.
template_computer
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
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