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
Xiaowu Zhang
slapos.core
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
Show 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):
uid
=
slave_partition_uid
)
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
):
"""
Create a Slave Partition document.
...
...
@@ -953,12 +944,6 @@ class TestVifibSlapWebService(testVifibMixin):
self
.
assertNotEqual
(
None
,
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
):
"""
Create a computer partition document.
...
...
@@ -1217,16 +1202,15 @@ class TestVifibSlapWebService(testVifibMixin):
def
stepRequestSharedComputerPartition
(
self
,
sequence
,
**
kw
):
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'
]
portal_catalog
=
self
.
portal
.
portal_catalog
software_instance
=
portal_catalog
.
getResultValue
(
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
)
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
portal_type
=
[
"Computer Partition"
,
"Slave Partition"
])
requested_reference
=
computer_partition
.
getReference
()
portal_type
=
self
.
computer_partition_portal_type
)
computer
=
computer_partition
while
computer
.
getPortalType
()
!=
self
.
computer_portal_type
:
computer
=
computer
.
getParentValue
()
...
...
@@ -1235,8 +1219,9 @@ class TestVifibSlapWebService(testVifibMixin):
self
.
slap
.
initializeConnection
(
self
.
server_url
)
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
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
(
software_release
=
software_release_uri
,
software_type
=
software_type
,
partition_reference
=
requested_reference
,
...
...
@@ -1249,34 +1234,34 @@ class TestVifibSlapWebService(testVifibMixin):
def
stepRequestSharedComputerPartitionNotReadyResponse
(
self
,
sequence
,
**
kw
):
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'
]
portal_catalog
=
self
.
portal
.
portal_catalog
software_instance
=
portal_catalog
.
getResultValue
(
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
)
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
portal_type
=
[
"Slave Partition"
,
"Computer Partition"
])
requested_reference
=
computer_partition
.
getReference
()
portal_type
=
self
.
computer_partition_portal_type
)
computer
=
computer_partition
while
computer
.
getPortalType
()
!=
self
.
computer_portal_type
:
computer
=
computer
.
getParentValue
()
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
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
self
.
assertRaises
(
slap
.
ResourceNotReady
,
slap_computer_partition
.
request
,
software_release
=
software_release_uri
,
software_type
=
software_type
,
partition_reference
=
requested_reference
,
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
sequence
.
edit
(
requested_reference
=
requested_reference
)
def
stepRequestSharedComputerPartitionNotFoundResponse
(
self
,
sequence
,
**
kw
):
software_release_uri
=
sequence
[
'software_release_uri'
]
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
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
software_instance_uid
)
...
...
@@ -1293,9 +1278,9 @@ class TestVifibSlapWebService(testVifibMixin):
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
computer
.
getReference
(),
computer_partition
.
getReference
())
software_type
=
None
raise
AtributeError
(
"software_type is not propagated"
)
raise
NotImplementedError
(
'software_type not propagated'
)
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_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
...
...
@@ -2924,6 +2909,7 @@ class TestVifibSlapWebService(testVifibMixin):
uid
=
software_instance_uid
)
# There should be only one predecessor
self
.
assertEqual
(
1
,
len
(
software_instance
.
getPredecessorList
()))
self
.
_checkSoftwareInstanceAndRelatedPartition
(
software_instance
,
self
.
computer_partition_portal_type
)
...
...
@@ -4093,8 +4079,9 @@ class TestVifibSlapWebService(testVifibMixin):
# ComputerPartition.request - shared
########################################
computer_with_software_release
=
prepare_computer
+
"""
LoginDefaultUser
computer_with_software_release
=
"""
CreateComputer
Tic
CreatePurchasePackingList
Tic
CreatePurchasePackingListLine
...
...
@@ -4118,7 +4105,8 @@ class TestVifibSlapWebService(testVifibMixin):
Tic
"""
requesting_computer_partition_with_software_instance
=
"""
LoginDefaultUser
SelectNewComputerPartitionReference
CreateComputerPartition
CreateSalePackingList
Tic
CreateSalePackingListLine
...
...
@@ -4127,19 +4115,16 @@ class TestVifibSlapWebService(testVifibMixin):
SetSalePackingListLineAggregate
ConfirmSalePackingList
Tic
Logout
"""
slave_owner_computer_partition_with_software_instance
=
"""
SelectNewComputerPartitionReference
CreateComputerPartition
SetSoftwareInstanceTitle
CreateSalePackingList
Tic
CreateSalePackingListLine
Tic
LoginTestVifibCustomer
stepPersonRequestSoftwareInstance
Tic
Logout
LoginDefaultUser
SetSalePackingListLineSetupResource
SetSalePackingListLineAggregate
ConfirmSalePackingList
...
...
@@ -4150,41 +4135,29 @@ class TestVifibSlapWebService(testVifibMixin):
"""
check_positive_request_shared
=
"""
LoginDefaultUser
SlapLoginCurrentSoftwareInstance
RequestSharedComputerPartitionNotReadyResponse
Tic
RequestSharedComputerPartition
Tic
CheckSoftwareInstanceAndRelatedSlavePartition
CheckRequestedSoftwareInstanceAndRelatedSlavePartition
Logout
"""
@
skip
(
'Not implemented'
)
def
test_ComputerPartition_request_shared_simpleCase
(
self
):
"""
Check that requesting shared partition works in system capable to fulfill
such request, with existing slave partition
"""
sequence_list
=
SequenceList
()
sequence_string
=
self
.
computer_with_software_release
+
"""
SelectNewComputerPartitionReference
CreateComputerPartition
"""
+
\
self
.
slave_owner_computer_partition_with_software_instance
+
"""
LoginTestVifibAdmin
CreateSlavePartition
Tic
sequence_string
=
\
self
.
computer_with_software_release
+
\
self
.
slave_owner_computer_partition_with_software_instance
+
\
"""
CreateSlavePartition
Tic
SlapLoginCurrentComputer
FormatComputer
SlapLogout
LoginTestVifibAdmin
Tic
ReplaceComputerPartitionBySlavePartition
"""
+
self
.
check_positive_request_shared
"""
+
\
self
.
requesting_computer_partition_with_software_instance
+
\
self
.
check_positive_request_shared
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
...
...
@@ -4196,19 +4169,14 @@ class TestVifibSlapWebService(testVifibMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
computer_with_software_release
+
"""
SelectNewComputerPartitionReference
CreateComputerPartition
"""
+
\
self
.
computer_with_software_release
+
\
self
.
slave_owner_computer_partition_with_software_instance
+
\
self
.
requesting_computer_partition_with_software_instance
+
\
self
.
check_positive_request_shared
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
check_notfound_request_shared
=
"""
SlapLoginCurrentSoftwareInstance
RequestSharedComputerPartitionNotFoundResponse
"""
...
...
@@ -4220,20 +4188,16 @@ class TestVifibSlapWebService(testVifibMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
computer_with_software_release
+
"""
SelectNewComputerPartitionReference
CreateComputerPartition
"""
+
self
.
slave_owner_computer_partition_with_software_instance
+
\
self
.
computer_with_software_release
+
\
self
.
slave_owner_computer_partition_with_software_instance
+
\
"""
CreateSlavePartition
Tic
MarkSlavePartitionBusy
Tic
SelectRequestedReference
"""
+
\
self
.
requesting_computer_partition_with_software_instance
+
\
self
.
check_notfound_request_shared
sequence_list
.
addSequenceString
(
sequence_string
)
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