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
Nicolas Wavrant
slapos.core
Commits
da350440
Commit
da350440
authored
Nov 06, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover SlapOSComputerPartitionConstraint.
parent
2206f219
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
...slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
+40
-0
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
View file @
da350440
...
...
@@ -33,6 +33,46 @@ class TestSlapOSConstraintMixin(testSlapOSMixin):
self
.
assertFalse
(
consistency_message
in
getMessageList
(
self
.
software_instance
))
self
.
assertSameSet
(
current_message_list
,
getMessageList
(
self
.
software_instance
))
class
TestSlapOSComputerPartitionConstraint
(
TestSlapOSConstraintMixin
):
def
test_non_busy_partition_has_no_related_instance
(
self
):
computer
=
self
.
portal
.
computer_module
.
template_computer
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
partition
=
computer
.
newContent
(
portal_type
=
'Computer Partition'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
partition
,
'free'
)
software_instance
=
self
.
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
slave_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Slave Instance'
)
partition
.
immediateReindexObject
()
software_instance
.
immediateReindexObject
()
slave_instance
.
immediateReindexObject
()
consistency_message
=
"Arity Error for Relation ['default_aggregate'], "
\
"arity is equal to 1 but should be between 0 and 0"
# test the test: no expected message found
current_message_list
=
getMessageList
(
partition
)
self
.
assertFalse
(
consistency_message
in
current_message_list
)
# check case for Software Instance
software_instance
.
setAggregate
(
partition
.
getRelativeUrl
())
software_instance
.
immediateReindexObject
()
self
.
assertTrue
(
consistency_message
in
getMessageList
(
partition
))
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
partition
,
'busy'
)
self
.
assertFalse
(
consistency_message
in
getMessageList
(
partition
))
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
partition
,
'free'
)
software_instance
.
setAggregate
(
None
)
software_instance
.
immediateReindexObject
()
# check case fo Slave Instance
slave_instance
.
setAggregate
(
partition
.
getRelativeUrl
())
slave_instance
.
immediateReindexObject
()
self
.
assertTrue
(
consistency_message
in
getMessageList
(
partition
))
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
partition
,
'busy'
)
self
.
assertFalse
(
consistency_message
in
getMessageList
(
partition
))
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
partition
,
'free'
)
class
TestSlapOSSoftwareInstanceConstraint
(
TestSlapOSConstraintMixin
):
def
afterSetUp
(
self
):
self
.
software_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
...
...
master/bt5/slapos_cloud/bt/revision
View file @
da350440
215
\ No newline at end of file
216
\ 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