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
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
017fc545
Commit
017fc545
authored
Aug 10, 2011
by
Antoine Catton
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into promises
parents
81b74b86
ea09a424
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
157 additions
and
1 deletion
+157
-1
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+157
-1
No files found.
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
017fc545
...
@@ -1187,6 +1187,12 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1187,6 +1187,12 @@ 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
stepSelectRequestedReferenceB
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
requested_reference
=
'b'
)
def
stepSelectRequestedReferenceC
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
requested_reference
=
'c'
)
def
stepSelectEmptyRequestedParameterDict
(
self
,
sequence
,
**
kw
):
def
stepSelectEmptyRequestedParameterDict
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
requested_parameter_dict
=
None
)
sequence
.
edit
(
requested_parameter_dict
=
None
)
...
@@ -1355,6 +1361,7 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1355,6 +1361,7 @@ class TestVifibSlapWebService(testVifibMixin):
requested_computer_partition_reference
=
\
requested_computer_partition_reference
=
\
requested_slap_computer_partition
.
getId
())
requested_slap_computer_partition
.
getId
())
def
stepDirectRequestComputerPartitionNotReadyResponseWithoutState
(
self
,
def
stepDirectRequestComputerPartitionNotReadyResponseWithoutState
(
self
,
sequence
,
**
kw
):
sequence
,
**
kw
):
request_dict
=
{
'computer_id'
:
sequence
[
'computer_reference'
]
,
request_dict
=
{
'computer_id'
:
sequence
[
'computer_reference'
]
,
...
@@ -7938,7 +7945,7 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -7938,7 +7945,7 @@ class TestVifibSlapWebService(testVifibMixin):
RestoreSoftwareInstanceUidFromBufferA
RestoreSoftwareInstanceUidFromBufferA
RestoreComputerReferenceFromBufferA
RestoreComputerReferenceFromBufferA
RestoreComputerUidFromBufferA
RestoreComputerUidFromBufferA
SlapLoginCurrentComputer
SlapLoginCurrentComputer
SoftwareInstanceDestroyed
SoftwareInstanceDestroyed
Tic
Tic
...
@@ -8042,6 +8049,155 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -8042,6 +8049,155 @@ class TestVifibSlapWebService(testVifibMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
stepDirectRequestComputerPartitionRaisesValueError
(
self
,
sequence
,
**
kw
):
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'software_instance_uid'
])
requested_reference
=
sequence
[
'requested_reference'
]
self
.
assertRaises
(
ValueError
,
software_instance
.
requestSoftwareInstance
,
software_release
=
sequence
[
'software_release_uri'
],
software_type
=
sequence
[
'requested_reference'
],
partition_reference
=
sequence
[
'requested_reference'
],
shared
=
False
,
instance_xml
=
self
.
minimal_correct_xml
,
sla_xml
=
self
.
minimal_correct_xml
,
state
=
'started'
)
def
test_bug_orhpaned_software_instance
(
self
):
"""Check that no orphaned Software Instances 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, C) | SR(A) <- SR(B) <- SR(C)
C.request(SR, B) raises immediately, because the result would be:
SR(A)
SR(B) <- SR(C)
do B would become root of orphaned tree.
"""
# Setup sufficient amount of CP
self
.
computer_partition_amount
=
3
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
# From B request C
SelectRequestedReferenceC
SlapLoginCurrentSoftwareInstance
RequestComputerPartitionNotReadyResponse
Tic
SlapLogout
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
CheckSoftwareInstanceAndRelatedComputerPartitionNoPackingListCheck
CheckRequestedSoftwareInstanceAndRelatedComputerPartition
Logout
LoginDefaultUser
SetCurrentSoftwareInstanceRequested
SetSelectedComputerPartition
SelectCurrentlyUsedSalePackingListUid
Logout
SlapLoginCurrentSoftwareInstance
CheckRequestedComputerPartitionCleanParameterList
Logout
# Try to: from C request B and prove that it raises
SelectRequestedReferenceB
LoginDefaultUser # login as superuser in order to work in erp5
DirectRequestComputerPartitionRaisesValueError
"""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
########################################
########################################
# Other tests
# Other tests
########################################
########################################
...
...
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