Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
106
Merge Requests
106
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
43d67ce0
Commit
43d67ce0
authored
Jun 07, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert work which shall be done on branch.
parent
0ab7fdfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
78 deletions
+42
-78
master/product/VifibTest/tests/testVifibSlapWebService.py
master/product/VifibTest/tests/testVifibSlapWebService.py
+42
-78
No files found.
master/product/VifibTest/tests/testVifibSlapWebService.py
View file @
43d67ce0
...
@@ -912,15 +912,6 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -912,15 +912,6 @@ class TestVifibSlapWebService(testVifibMixin):
uid
=
slave_partition_uid
)
uid
=
slave_partition_uid
)
slave_partition
.
markBusy
()
slave_partition
.
markBusy
()
def
stepReplaceComputerPartitionBySlavePartition
(
self
,
sequence
,
**
kw
):
"""
Use Slave Partition instead of Computer Partition
"""
sequence
[
"computer_partition_uid"
]
=
sequence
[
"slave_partition_uid"
]
slave
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
"slave_partition_uid"
])
sequence
[
"computer_partition_reference"
]
=
slave
.
getReference
()
sequence
[
"computer_partition_reference_list"
].
append
(
slave
.
getReference
())
def
stepCreateSlavePartition
(
self
,
sequence
,
**
kw
):
def
stepCreateSlavePartition
(
self
,
sequence
,
**
kw
):
"""
"""
Create a Slave Partition document.
Create a Slave Partition document.
...
@@ -953,12 +944,6 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -953,12 +944,6 @@ class TestVifibSlapWebService(testVifibMixin):
self
.
assertNotEqual
(
None
,
computer_partition_uid
)
self
.
assertNotEqual
(
None
,
computer_partition_uid
)
sequence
.
edit
(
slave_owner_uid
=
computer_partition_uid
)
sequence
.
edit
(
slave_owner_uid
=
computer_partition_uid
)
def
stepSelectNewComputerPartitionReference
(
self
,
sequence
,
**
kw
):
portal
=
self
.
getPortalObject
()
computer
=
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
"computer_uid"
])
reference
=
"slappart%s"
%
len
(
computer
.
objectValues
())
sequence
.
edit
(
computer_partition_reference
=
reference
)
def
stepCreateComputerPartition
(
self
,
sequence
,
**
kw
):
def
stepCreateComputerPartition
(
self
,
sequence
,
**
kw
):
"""
"""
Create a computer partition document.
Create a computer partition document.
...
@@ -1217,16 +1202,15 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1217,16 +1202,15 @@ class TestVifibSlapWebService(testVifibMixin):
def
stepRequestSharedComputerPartition
(
self
,
sequence
,
**
kw
):
def
stepRequestSharedComputerPartition
(
self
,
sequence
,
**
kw
):
software_release_uri
=
sequence
[
'software_release_uri'
]
software_release_uri
=
sequence
[
'software_release_uri'
]
requested_parameter_dict
=
sequence
.
get
(
'requested_parameter_dict'
,
{})
requested_reference
=
sequence
[
'requested_reference'
]
requested_parameter_dict
=
sequence
[
'requested_parameter_dict'
]
software_instance_uid
=
sequence
[
'software_instance_uid'
]
software_instance_uid
=
sequence
[
'software_instance_uid'
]
portal_catalog
=
self
.
portal
.
portal_catalog
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
software_instance
=
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
)
uid
=
software_instance_uid
)
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
portal_type
=
[
"Computer Partition"
,
"Slave Partition"
])
portal_type
=
self
.
computer_partition_portal_type
)
requested_reference
=
computer_partition
.
getReference
()
computer
=
computer_partition
computer
=
computer_partition
while
computer
.
getPortalType
()
!=
self
.
computer_portal_type
:
while
computer
.
getPortalType
()
!=
self
.
computer_portal_type
:
computer
=
computer
.
getParentValue
()
computer
=
computer
.
getParentValue
()
...
@@ -1235,8 +1219,9 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1235,8 +1219,9 @@ class TestVifibSlapWebService(testVifibMixin):
self
.
slap
.
initializeConnection
(
self
.
server_url
)
self
.
slap
.
initializeConnection
(
self
.
server_url
)
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
computer
.
getReference
(),
computer_partition
.
getReference
())
computer
.
getReference
(),
computer_partition
.
getReference
())
software_type
=
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
).
getTitle
()
software_type
=
None
raise
NotImplementedError
(
'software_type not propagated'
)
requested_slap_computer_partition
=
slap_computer_partition
.
request
(
requested_slap_computer_partition
=
slap_computer_partition
.
request
(
software_release
=
software_release_uri
,
software_type
=
software_type
,
software_release
=
software_release_uri
,
software_type
=
software_type
,
partition_reference
=
requested_reference
,
partition_reference
=
requested_reference
,
...
@@ -1249,34 +1234,34 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1249,34 +1234,34 @@ class TestVifibSlapWebService(testVifibMixin):
def
stepRequestSharedComputerPartitionNotReadyResponse
(
self
,
sequence
,
**
kw
):
def
stepRequestSharedComputerPartitionNotReadyResponse
(
self
,
sequence
,
**
kw
):
software_release_uri
=
sequence
[
'software_release_uri'
]
software_release_uri
=
sequence
[
'software_release_uri'
]
requested_parameter_dict
=
sequence
.
get
(
'requested_parameter_dict'
,
{})
requested_reference
=
sequence
[
'requested_reference'
]
requested_parameter_dict
=
sequence
[
'requested_parameter_dict'
]
software_instance_uid
=
sequence
[
'software_instance_uid'
]
software_instance_uid
=
sequence
[
'software_instance_uid'
]
portal_catalog
=
self
.
portal
.
portal_catalog
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
software_instance
=
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
)
uid
=
software_instance_uid
)
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
portal_type
=
[
"Slave Partition"
,
"Computer Partition"
])
portal_type
=
self
.
computer_partition_portal_type
)
requested_reference
=
computer_partition
.
getReference
()
computer
=
computer_partition
computer
=
computer_partition
while
computer
.
getPortalType
()
!=
self
.
computer_portal_type
:
while
computer
.
getPortalType
()
!=
self
.
computer_portal_type
:
computer
=
computer
.
getParentValue
()
computer
=
computer
.
getParentValue
()
self
.
slap
=
slap
.
slap
()
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
self
.
slap
.
initializeConnection
(
self
.
server_url
)
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
computer
.
getReference
(),
computer_partition
.
getReference
())
computer
.
getReference
(),
computer_partition
.
getReference
())
software_type
=
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
).
getTitle
()
software_type
=
None
raise
NotImplementedError
(
'software_type not propagated'
)
# first try will raise slap.ResourceNotReady
# first try will raise slap.ResourceNotReady
self
.
assertRaises
(
slap
.
ResourceNotReady
,
slap_computer_partition
.
request
,
self
.
assertRaises
(
slap
.
ResourceNotReady
,
slap_computer_partition
.
request
,
software_release
=
software_release_uri
,
software_type
=
software_type
,
software_release
=
software_release_uri
,
software_type
=
software_type
,
partition_reference
=
requested_reference
,
partition_reference
=
requested_reference
,
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
sequence
.
edit
(
requested_reference
=
requested_reference
)
def
stepRequestSharedComputerPartitionNotFoundResponse
(
self
,
sequence
,
**
kw
):
def
stepRequestSharedComputerPartitionNotFoundResponse
(
self
,
sequence
,
**
kw
):
software_release_uri
=
sequence
[
'software_release_uri'
]
software_release_uri
=
sequence
[
'software_release_uri'
]
requested_reference
=
sequence
[
'requested_reference'
]
requested_reference
=
sequence
[
'requested_reference'
]
requested_parameter_dict
=
sequence
.
get
(
'requested_parameter_dict'
,
{})
requested_parameter_dict
=
sequence
[
'requested_parameter_dict'
]
software_instance_uid
=
sequence
[
'software_instance_uid'
]
software_instance_uid
=
sequence
[
'software_instance_uid'
]
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
)
uid
=
software_instance_uid
)
...
@@ -1293,9 +1278,9 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1293,9 +1278,9 @@ class TestVifibSlapWebService(testVifibMixin):
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
computer
.
getReference
(),
computer_partition
.
getReference
())
computer
.
getReference
(),
computer_partition
.
getReference
())
software_type
=
None
software_type
=
None
raise
AtributeError
(
"software_type is not propagated"
)
raise
NotImplementedError
(
'software_type not propagated'
)
self
.
assertRaises
(
slap
.
NotFoundError
,
slap_computer_partition
.
request
,
self
.
assertRaises
(
slap
.
NotFoundError
,
slap_computer_partition
.
request
,
software_release
=
software_release_uri
,
sof
t
ware_type
=
software_type
,
software_release
=
software_release_uri
,
sofware_type
=
software_type
,
partition_reference
=
requested_reference
,
partition_reference
=
requested_reference
,
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
...
@@ -2924,6 +2909,7 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -2924,6 +2909,7 @@ class TestVifibSlapWebService(testVifibMixin):
uid
=
software_instance_uid
)
uid
=
software_instance_uid
)
# There should be only one predecessor
# There should be only one predecessor
self
.
assertEqual
(
1
,
len
(
software_instance
.
getPredecessorList
()))
self
.
assertEqual
(
1
,
len
(
software_instance
.
getPredecessorList
()))
self
.
_checkSoftwareInstanceAndRelatedPartition
(
software_instance
,
self
.
_checkSoftwareInstanceAndRelatedPartition
(
software_instance
,
self
.
computer_partition_portal_type
)
self
.
computer_partition_portal_type
)
...
@@ -4093,8 +4079,9 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -4093,8 +4079,9 @@ class TestVifibSlapWebService(testVifibMixin):
# ComputerPartition.request - shared
# ComputerPartition.request - shared
########################################
########################################
computer_with_software_release
=
prepare_computer
+
"""
computer_with_software_release
=
"""
LoginDefaultUser
CreateComputer
Tic
CreatePurchasePackingList
CreatePurchasePackingList
Tic
Tic
CreatePurchasePackingListLine
CreatePurchasePackingListLine
...
@@ -4118,7 +4105,8 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -4118,7 +4105,8 @@ class TestVifibSlapWebService(testVifibMixin):
Tic
Tic
"""
"""
requesting_computer_partition_with_software_instance
=
"""
requesting_computer_partition_with_software_instance
=
"""
LoginDefaultUser
SelectNewComputerPartitionReference
CreateComputerPartition
CreateSalePackingList
CreateSalePackingList
Tic
Tic
CreateSalePackingListLine
CreateSalePackingListLine
...
@@ -4127,19 +4115,16 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -4127,19 +4115,16 @@ class TestVifibSlapWebService(testVifibMixin):
SetSalePackingListLineAggregate
SetSalePackingListLineAggregate
ConfirmSalePackingList
ConfirmSalePackingList
Tic
Tic
Logout
"""
"""
slave_owner_computer_partition_with_software_instance
=
"""
slave_owner_computer_partition_with_software_instance
=
"""
SelectNewComputerPartitionReference
CreateComputerPartition
SetSoftwareInstanceTitle
CreateSalePackingList
CreateSalePackingList
Tic
Tic
CreateSalePackingListLine
CreateSalePackingListLine
Tic
Tic
LoginTestVifibCustomer
stepPersonRequestSoftwareInstance
Tic
Logout
LoginDefaultUser
SetSalePackingListLineSetupResource
SetSalePackingListLineSetupResource
SetSalePackingListLineAggregate
SetSalePackingListLineAggregate
ConfirmSalePackingList
ConfirmSalePackingList
...
@@ -4150,41 +4135,29 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -4150,41 +4135,29 @@ class TestVifibSlapWebService(testVifibMixin):
"""
"""
check_positive_request_shared
=
"""
check_positive_request_shared
=
"""
LoginDefaultUser
SlapLoginCurrentSoftwareInstance
RequestSharedComputerPartitionNotReadyResponse
RequestSharedComputerPartitionNotReadyResponse
Tic
Tic
RequestSharedComputerPartition
RequestSharedComputerPartition
Tic
CheckSoftwareInstanceAndRelatedSlavePartition
CheckSoftwareInstanceAndRelatedSlavePartition
CheckRequestedSoftwareInstanceAndRelatedSlavePartition
CheckRequestedSoftwareInstanceAndRelatedSlavePartition
Logout
"""
"""
@
skip
(
'Not implemented'
)
def
test_ComputerPartition_request_shared_simpleCase
(
self
):
def
test_ComputerPartition_request_shared_simpleCase
(
self
):
"""
"""
Check that requesting shared partition works in system capable to fulfill
Check that requesting shared partition works in system capable to fulfill
such request, with existing slave partition
such request, with existing slave partition
"""
"""
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
self
.
computer_with_software_release
+
"""
sequence_string
=
\
SelectNewComputerPartitionReference
self
.
computer_with_software_release
+
\
CreateComputerPartition
self
.
slave_owner_computer_partition_with_software_instance
+
\
"""
CreateSlavePartition
Tic
"""
+
\
"""
+
\
self
.
slave_owner_computer_partition_with_software_instance
+
"""
self
.
requesting_computer_partition_with_software_instance
+
\
LoginTestVifibAdmin
self
.
check_positive_request_shared
CreateSlavePartition
Tic
CreateSlavePartition
Tic
SlapLoginCurrentComputer
FormatComputer
SlapLogout
LoginTestVifibAdmin
Tic
ReplaceComputerPartitionBySlavePartition
"""
+
self
.
check_positive_request_shared
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
...
@@ -4196,19 +4169,14 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -4196,19 +4169,14 @@ class TestVifibSlapWebService(testVifibMixin):
"""
"""
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
\
sequence_string
=
\
self
.
computer_with_software_release
+
"""
self
.
computer_with_software_release
+
\
SelectNewComputerPartitionReference
CreateComputerPartition
"""
+
\
self
.
slave_owner_computer_partition_with_software_instance
+
\
self
.
slave_owner_computer_partition_with_software_instance
+
\
self
.
requesting_computer_partition_with_software_instance
+
\
self
.
requesting_computer_partition_with_software_instance
+
\
self
.
check_positive_request_shared
self
.
check_positive_request_shared
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
check_notfound_request_shared
=
"""
check_notfound_request_shared
=
"""
SlapLoginCurrentSoftwareInstance
RequestSharedComputerPartitionNotFoundResponse
RequestSharedComputerPartitionNotFoundResponse
"""
"""
...
@@ -4220,20 +4188,16 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -4220,20 +4188,16 @@ class TestVifibSlapWebService(testVifibMixin):
"""
"""
sequence_list
=
SequenceList
()
sequence_list
=
SequenceList
()
sequence_string
=
\
sequence_string
=
\
self
.
computer_with_software_release
+
"""
self
.
computer_with_software_release
+
\
SelectNewComputerPartitionReference
self
.
slave_owner_computer_partition_with_software_instance
+
\
CreateComputerPartition
"""
+
self
.
slave_owner_computer_partition_with_software_instance
+
\
"""
"""
CreateSlavePartition
CreateSlavePartition
Tic
Tic
MarkSlavePartitionBusy
MarkSlavePartitionBusy
Tic
Tic
SelectRequestedReference
"""
+
\
"""
+
\
self
.
requesting_computer_partition_with_software_instance
+
\
self
.
requesting_computer_partition_with_software_instance
+
\
self
.
check_notfound_request_shared
self
.
check_notfound_request_shared
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
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