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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
c6eee57f
Commit
c6eee57f
authored
Dec 02, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Add test when 2 instances edit the instances
It raises if it is not properly indexed.
parent
1cfb4ab9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
...test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
+60
-0
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
View file @
c6eee57f
...
@@ -470,6 +470,66 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -470,6 +470,66 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertRaises
(
NotImplementedError
,
B_instance
.
requestInstance
,
self
.
assertRaises
(
NotImplementedError
,
B_instance
.
requestInstance
,
**
request_kw
)
**
request_kw
)
def
test_request_tree_edit_parameters_change_not_indexed
(
self
):
"""Checks tree change forced by request
For a tree like:
A
|
A
|
\
B C
|
D
When C requests D tree in a while C requests D, but before indexation,
the system shall disallow the operation."""
request_kw
=
self
.
request_kw
.
copy
()
request_kw
[
'software_title'
]
=
self
.
generateNewSoftwareTitle
()
self
.
software_instance
.
requestInstance
(
**
request_kw
)
B_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
request_kw
[
'software_title'
]
=
self
.
generateNewSoftwareTitle
()
self
.
software_instance
.
requestInstance
(
**
request_kw
)
C_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
request_kw
[
'software_title'
]
=
self
.
generateNewSoftwareTitle
()
B_instance
.
requestInstance
(
**
request_kw
)
D_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
self
.
assertSameSet
(
self
.
software_instance
.
getSuccessorList
(),
[
B_instance
.
getRelativeUrl
(),
C_instance
.
getRelativeUrl
()])
self
.
assertSameSet
(
B_instance
.
getSuccessorList
(),
[
D_instance
.
getRelativeUrl
()])
# Ensure all is indexed first
self
.
tic
()
# B edits twice w/o a problem w/o indexation problems
request_kw
[
'instance_xml'
]
=
self
.
generateSafeXml
()
B_instance
.
requestInstance
(
**
request_kw
)
transaction
.
commit
()
C_instance
.
requestInstance
(
**
request_kw
)
transaction
.
commit
()
self
.
assertSameSet
(
C_instance
.
getSuccessorList
(),
[
D_instance
.
getRelativeUrl
()])
self
.
assertSameSet
(
B_instance
.
getSuccessorList
(),
[])
# B request must fails since indexation didnt finished up properly
# which would lead to dupplicated set on sucessor
self
.
assertRaises
(
NotImplementedError
,
B_instance
.
requestInstance
,
**
request_kw
)
def
test_request_started_stopped_destroyed
(
self
):
def
test_request_started_stopped_destroyed
(
self
):
request_kw
=
self
.
request_kw
.
copy
()
request_kw
=
self
.
request_kw
.
copy
()
...
...
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