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
450019fe
Commit
450019fe
authored
Jan 09, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: project in test
parent
48856b4e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
44 deletions
+9
-44
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+3
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py
...al_components/test.erp5.testSlapOSCloudAllocationAlarm.py
+6
-44
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
450019fe
...
...
@@ -273,6 +273,8 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
project_reference
=
project
.
getReference
()
)
self
.
person_user
=
self
.
makePerson
(
project
,
new_id
=
new_id
,
index
=
False
)
self
.
commit
()
# prepare part of tree
self
.
instance_tree
=
self
.
portal
.
instance_tree_module
\
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
...
@@ -288,6 +290,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
successor
=
self
.
software_instance
.
getRelativeUrl
(),
destination_section_value
=
self
.
person_user
,
follow_up_value
=
project
)
self
.
instance_tree
.
validate
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py
View file @
450019fe
...
...
@@ -78,7 +78,7 @@ return True""" )
@
simulate
(
'Person_isAllowedToAllocate'
,
'*args, **kwargs'
,
'return True'
)
def
test_allocation_no_free_partition
(
self
):
self
.
_makeTree
self
.
project
(
)
self
.
_makeTree
(
self
.
project
)
self
.
assertEqual
(
None
,
self
.
software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
))
...
...
@@ -205,48 +205,6 @@ return True""" )
self
.
assertEqual
(
None
,
self
.
software_instance
.
getAggregate
(
portal_type
=
'Compute Partition'
))
@
simulate
(
'Person_isAllowedToAllocate'
,
'*args, **kwargs'
,
'return True'
)
def
test_allocation_allocation_scope_open_personal
(
self
):
self
.
_makeTree
(
self
.
project
)
self
.
_makeComputeNode
(
self
.
project
)
self
.
_installSoftware
(
self
.
compute_node
,
self
.
software_instance
.
getUrlString
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
,
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
compute_node
.
setAccessStatus
(
"#access ok"
)
self
.
tic
()
self
.
compute_node
.
ComputeNode_checkAndUpdateCapacityScope
()
self
.
assertEqual
(
self
.
compute_node
.
getCapacityScope
(),
'open'
)
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
))
self
.
software_instance
.
SoftwareInstance_tryToAllocatePartition
()
self
.
assertEqual
(
self
.
partition
.
getRelativeUrl
(),
self
.
software_instance
.
getAggregate
(
portal_type
=
'Compute Partition'
))
@
simulate
(
'Person_isAllowedToAllocate'
,
'*args, **kwargs'
,
'return True'
)
def
test_allocation_host_allocation_scope_open_personal
(
self
):
self
.
_makeSlaveTree
(
self
.
project
)
self
.
_makeComputeNode
(
self
.
project
)
self
.
_allocateHost
(
self
.
requested_software_instance
,
self
.
partition
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
,
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
compute_node
.
setAccessStatus
(
"#access ok"
)
self
.
tic
()
self
.
compute_node
.
ComputeNode_checkAndUpdateCapacityScope
()
self
.
assertEqual
(
self
.
compute_node
.
getCapacityScope
(),
'open'
)
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
))
self
.
software_instance
.
SoftwareInstance_tryToAllocatePartition
()
self
.
assertEqual
(
self
.
partition
.
getRelativeUrl
(),
self
.
software_instance
.
getAggregate
(
portal_type
=
'Compute Partition'
))
@
simulate
(
'Person_isAllowedToAllocate'
,
'*args, **kwargs'
,
'return True'
)
def
test_allocation_does_not_fail_on_instance_with_damaged_sla_xml
(
self
):
self
.
_makeTree
(
self
.
project
)
...
...
@@ -356,7 +314,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
self
.
_makeTree
(
self
.
project
)
self
.
_makeComputeNode
(
self
.
project
)
self
.
assertEqual
(
self
.
compute_node
.
getAllocationScope
(),
"open
/public
"
)
self
.
assertEqual
(
self
.
compute_node
.
getAllocationScope
(),
"open"
)
self
.
assertEqual
(
self
.
compute_node
.
getCapacityScope
(),
"open"
)
self
.
_installSoftware
(
self
.
compute_node
,
...
...
@@ -489,6 +447,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
sla_xml
,
specialise
=
self
.
instance_tree
.
getRelativeUrl
(),
follow_up_value
=
self
.
project
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance2
,
'start_requested'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance2
,
'validated'
)
...
...
@@ -583,6 +542,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
sla_xml
,
specialise
=
self
.
instance_tree
.
getRelativeUrl
(),
follow_up_value
=
self
.
project
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance2
,
'start_requested'
)
software_instance2
.
validate
()
...
...
@@ -603,6 +563,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
sla_xml
,
specialise
=
self
.
instance_tree
.
getRelativeUrl
(),
follow_up_value
=
self
.
project
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance3
,
'start_requested'
)
software_instance3
.
validate
()
...
...
@@ -711,6 +672,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
sla_xml
,
specialise
=
self
.
instance_tree
.
getRelativeUrl
(),
follow_up_value
=
self
.
project
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance2
,
'start_requested'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance2
,
'validated'
)
...
...
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