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
0ed82865
Commit
0ed82865
authored
Nov 08, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prove that it is possible to reuse software instance title.
Additionaly update some assertions to support such case.
parent
46263eca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
9 deletions
+71
-9
master/product/Vifib/tests/testVifibSlapBug.py
master/product/Vifib/tests/testVifibSlapBug.py
+49
-3
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+22
-6
No files found.
master/product/Vifib/tests/testVifibSlapBug.py
View file @
0ed82865
...
@@ -1079,7 +1079,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
...
@@ -1079,7 +1079,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
stepSetRequestedStateStarted
(
self
,
sequence
,
**
kw
):
def
stepSetRequestedStateStarted
(
self
,
sequence
,
**
kw
):
sequence
[
'state'
]
=
'started'
sequence
[
'requested_state'
]
=
'started'
def
stepSetRequestedStateStopped
(
self
,
sequence
,
**
kw
):
sequence
[
'requested_state'
]
=
'stopped'
def
stepSetRequestedReferenceRandom
(
self
,
sequence
,
**
kw
):
def
stepSetRequestedReferenceRandom
(
self
,
sequence
,
**
kw
):
sequence
[
'requested_reference'
]
=
str
(
random
.
random
())
sequence
[
'requested_reference'
]
=
str
(
random
.
random
())
...
@@ -1131,6 +1134,8 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
...
@@ -1131,6 +1134,8 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_published_software_release
+
\
sequence_string
=
self
.
prepare_published_software_release
+
\
self
.
prepare_formated_computer
+
"""
self
.
prepare_formated_computer
+
"""
SetRequestedStateStopped
LoginTestVifibAdmin
LoginTestVifibAdmin
RequestSoftwareInstallation
RequestSoftwareInstallation
Tic
Tic
...
@@ -1157,6 +1162,49 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
...
@@ -1157,6 +1162,49 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
Tic
Tic
SlapLogout
SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition
SetSelectedComputerPartition
SetRequestedComputerPartition
CheckComputerPartitionNoInstanceHostingSalePackingList
CheckComputerPartitionInstanceSetupSalePackingListConfirmed
Logout
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
Logout
SlapLoginCurrentComputer
SoftwareInstanceDestroyed
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListDelivered
CheckComputerPartitionIsFree
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstancePrepare
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
SetCurrentPersonSlapRequestedSoftwareInstance
CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition
CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition
...
@@ -1169,8 +1217,6 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
...
@@ -1169,8 +1217,6 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
raise
NotImplementedError
def
test_request_new_with_destroyed_reference_web_ui
(
self
):
def
test_request_new_with_destroyed_reference_web_ui
(
self
):
"""Prove that having destroyed SI allows to request new one with same
"""Prove that having destroyed SI allows to request new one with same
reference
reference
...
...
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
0ed82865
...
@@ -223,9 +223,18 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
...
@@ -223,9 +223,18 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
requested_slap_computer_partition
.
getId
())
requested_slap_computer_partition
.
getId
())
def
stepSetCurrentPersonSlapRequestedSoftwareInstance
(
self
,
sequence
,
**
kw
):
def
stepSetCurrentPersonSlapRequestedSoftwareInstance
(
self
,
sequence
,
**
kw
):
software_instance_list
=
self
.
portal
.
portal_catalog
(
cleanup_resource
=
self
.
portal
.
portal_preferences
\
.
getPreferredInstanceCleanupResource
()
software_instance_list
=
[]
for
software_instance
in
self
.
portal
.
portal_catalog
(
portal_type
=
self
.
software_instance_portal_type
,
portal_type
=
self
.
software_instance_portal_type
,
title
=
sequence
[
'requested_reference'
])
title
=
sequence
[
'requested_reference'
]):
# only not yet destroyed ones
try
:
software_instance
.
Item_getInstancePackingListLine
(
cleanup_resource
)
except
ValueError
:
software_instance_list
.
append
(
software_instance
)
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
(
...
@@ -3415,9 +3424,13 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
...
@@ -3415,9 +3424,13 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition
=
computer_partition_list
[
0
]
computer_partition
=
computer_partition_list
[
0
]
# This Computer Partition shall have only Sale Packing List Line related
# This Computer Partition shall have only Sale Packing List Line related
computer_partition_sale_packing_list_line_list
=
computer_partition
\
computer_partition_sale_packing_list_line_list
=
[]
for
delivery_line
in
computer_partition
\
.
getAggregateRelatedValueList
(
.
getAggregateRelatedValueList
(
portal_type
=
self
.
sale_packing_list_line_portal_type
)
portal_type
=
self
.
sale_packing_list_line_portal_type
):
if
sequence
[
'software_instance_uid'
]
in
delivery_line
\
.
getAggregateUidList
():
computer_partition_sale_packing_list_line_list
.
append
(
delivery_line
)
self
.
assertEqual
(
1
,
len
(
computer_partition_sale_packing_list_line_list
))
self
.
assertEqual
(
1
,
len
(
computer_partition_sale_packing_list_line_list
))
# There should be only one Sale Order Line
# There should be only one Sale Order Line
...
@@ -3434,9 +3447,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
...
@@ -3434,9 +3447,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition
=
computer_partition_list
[
0
]
computer_partition
=
computer_partition_list
[
0
]
# This Computer Partition shall have only Sale Order Line related
# This Computer Partition shall have only Sale Order Line related
computer_partition_sale_order_line_list
=
computer_partition
\
computer_partition_sale_order_line_list
=
[]
for
order_line
in
computer_partition
\
.
getAggregateRelatedValueList
(
.
getAggregateRelatedValueList
(
portal_type
=
self
.
sale_order_line_portal_type
)
portal_type
=
self
.
sale_order_line_portal_type
):
if
sequence
[
'software_instance_uid'
]
in
order_line
.
getAggregateUidList
():
computer_partition_sale_order_line_list
.
append
(
order_line
)
self
.
assertEqual
(
1
,
len
(
computer_partition_sale_order_line_list
))
self
.
assertEqual
(
1
,
len
(
computer_partition_sale_order_line_list
))
def
stepCheckSoftwareInstanceAndRelatedComputerPartition
(
self
,
def
stepCheckSoftwareInstanceAndRelatedComputerPartition
(
self
,
...
...
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