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
Carlos Ramos Carreño
slapos.core
Commits
b07186ef
Commit
b07186ef
authored
Aug 12, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover minimal cyclic case (try to request root)
parent
bd2ec32b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
0 deletions
+109
-0
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+109
-0
No files found.
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
b07186ef
...
@@ -361,6 +361,7 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -361,6 +361,7 @@ class TestVifibSlapWebService(testVifibMixin):
self
.
assertEqual
(
1
,
len
(
software_instance_list
))
self
.
assertEqual
(
1
,
len
(
software_instance_list
))
software_instance
=
software_instance_list
[
0
]
software_instance
=
software_instance_list
[
0
]
sequence
.
edit
(
sequence
.
edit
(
root_software_instance_title
=
software_title
,
software_instance_uid
=
software_instance
.
getUid
(),
software_instance_uid
=
software_instance
.
getUid
(),
software_instance_reference
=
software_instance
.
getReference
(),
software_instance_reference
=
software_instance
.
getReference
(),
hosting_subscription_uid
=
software_instance
.
getAggregateRelatedValue
(
hosting_subscription_uid
=
software_instance
.
getAggregateRelatedValue
(
...
@@ -1187,6 +1188,10 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1187,6 +1188,10 @@ class TestVifibSlapWebService(testVifibMixin):
def
stepSelectRequestedReferenceChildrenBChild
(
self
,
sequence
,
**
kw
):
def
stepSelectRequestedReferenceChildrenBChild
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
requested_reference
=
'children_b_child'
)
sequence
.
edit
(
requested_reference
=
'children_b_child'
)
def
stepSelectRequestedReferenceRootSoftwareInstanceTitle
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
requested_reference
=
sequence
[
'root_software_instance_title'
])
def
stepSelectRequestedReferenceB
(
self
,
sequence
,
**
kw
):
def
stepSelectRequestedReferenceB
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
requested_reference
=
'b'
)
sequence
.
edit
(
requested_reference
=
'b'
)
...
@@ -8349,6 +8354,110 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -8349,6 +8354,110 @@ class TestVifibSlapWebService(testVifibMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
test_bug_cyclic_software_instance_small_tree
(
self
):
"""Check that no cyclic Software Instance trees would be created
In below scenario system shall behave like mentioned:
OpenOrder.request(SR, A) | SR(A)
A.request(SR, B) | SR(A) <- SR(B)
B.request(SR, A) raises immediately, because the result would be:
SR(A) <-> SR(B)
so B and A would be cyclic
"""
# Setup sufficient amount of CP
self
.
computer_partition_amount
=
2
sequence_list
=
SequenceList
()
sequence_string
=
"""
# Prepare software release
LoginTestVifibDeveloper
SelectNewSoftwareReleaseUri
CreateSoftwareRelease
Tic
SubmitSoftwareRelease
Tic
CreateSoftwareProduct
Tic
ValidateSoftwareProduct
Tic
SetSoftwareProductToSoftwareRelease
PublishByActionSoftwareRelease
Logout
# Create the computer
LoginTestVifibAdmin
CreateComputer
Tic
Logout
SlapLoginCurrentComputer
FormatComputer
Tic
SlapLogout
StoreCurrentComputerReferenceBufferA
StoreCurrentComputerUidBufferA
# Install the software release
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
# Create Software Instance A (originates from Open Order)
LoginTestVifibCustomer
PersonRequestSoftwareInstance
Tic
Logout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SetSelectedComputerPartition
SelectCurrentlyUsedSalePackingListUid
Logout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListConfirmed
Logout
# From root request B
SelectRequestedReferenceB
SlapLoginCurrentSoftwareInstance
RequestComputerPartitionNotReadyResponse
Tic
SlapLogout
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
CheckSoftwareInstanceAndRelatedComputerPartitionNoPackingListCheck
CheckRequestedSoftwareInstanceAndRelatedComputerPartition
Logout
LoginDefaultUser
SetCurrentSoftwareInstanceRequested
SetSelectedComputerPartition
SelectCurrentlyUsedSalePackingListUid
Logout
SlapLoginCurrentSoftwareInstance
CheckRequestedComputerPartitionCleanParameterList
Logout
# Try to: From B request root
SelectRequestedReferenceRootSoftwareInstanceTitle
LoginDefaultUser # login as superuser in order to work in erp5
DirectRequestComputerPartitionRaisesCyclicSoftwareTree
"""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
########################################
########################################
# Software Instance graph helpers
# Software Instance graph helpers
########################################
########################################
...
...
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