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
Klaus Wölfel
slapos.core
Commits
f29743b8
Commit
f29743b8
authored
Jul 26, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-implement steps to test Slave Instances
parent
da138b1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
49 deletions
+29
-49
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+29
-49
No files found.
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
f29743b8
...
...
@@ -1294,89 +1294,69 @@ class TestVifibSlapWebService(testVifibMixin):
self
.
assertEqual
(
'value'
,
slap_computer_partition
.
getConnectionParameter
(
'parameter'
))
def
stepRequestS
hared
ComputerPartition
(
self
,
sequence
,
**
kw
):
def
stepRequestS
laveInstanceFrom
ComputerPartition
(
self
,
sequence
,
**
kw
):
software_release_uri
=
sequence
[
'software_release_uri'
]
requested_reference
=
sequence
[
'requested_reference'
]
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
)
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
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
())
sequence
[
'computer_reference'
],
sequence
[
'computer_partition_reference'
])
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
,
software_release
=
software_release_uri
,
software_type
=
"SlaveInstance"
,
partition_reference
=
requested_reference
,
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
partition_parameter_kw
=
requested_parameter_dict
,
# XXX The follow API should be slave, but shared was kept for
# Backward compatibility with older versions of slap
shared
=
True
)
sequence
.
edit
(
requested_slap_computer_partition
=
requested_slap_computer_partition
,
requested_computer_partition_reference
=
\
requested_slap_computer_partition
.
getId
())
def
stepRequestS
hared
ComputerPartitionNotReadyResponse
(
self
,
sequence
,
**
kw
):
def
stepRequestS
laveInstanceFrom
ComputerPartitionNotReadyResponse
(
self
,
sequence
,
**
kw
):
software_release_uri
=
sequence
[
'software_release_uri'
]
requested_reference
=
sequence
[
'requested_reference'
]
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
)
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
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
=
None
raise
NotImplementedError
(
'software_type not propagated'
)
sequence
[
'computer_reference'
],
sequence
[
'computer_partition_reference'
])
# first try will raise slap.ResourceNotReady
self
.
assertRaises
(
slap
.
ResourceNotReady
,
slap_computer_partition
.
request
,
software_release
=
software_release_uri
,
software_type
=
software_type
,
self
.
assertRaises
(
slap
.
ResourceNotReady
,
slap_computer_partition
.
request
,
software_release
=
software_release_uri
,
software_type
=
"SlaveInstance"
,
partition_reference
=
requested_reference
,
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
def
stepRequestS
hared
ComputerPartitionNotFoundResponse
(
self
,
sequence
,
**
kw
):
def
stepRequestS
laveInstanceFrom
ComputerPartitionNotFoundResponse
(
self
,
sequence
,
**
kw
):
software_release_uri
=
sequence
[
'software_release_uri'
]
requested_reference
=
sequence
[
'requested_reference'
]
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
)
computer_partition
=
software_instance
.
getAggregateRelatedValue
(
portal_type
=
self
.
sale_packing_list_line_portal_type
).
getAggregateValue
(
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
=
None
raise
NotImplementedError
(
'software_type not propagated'
)
self
.
assertRaises
(
slap
.
NotFoundError
,
slap_computer_partition
.
request
,
software_release
=
software_release_uri
,
sofware_type
=
software_type
,
sequence
[
'computer_reference'
],
sequence
[
'computer_partition_reference'
])
self
.
assertRaises
(
slap
.
NotFoundError
,
slap_computer_partition
.
request
,
software_release
=
software_release_uri
,
software_type
=
"SlaveInstance"
,
partition_reference
=
requested_reference
,
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
partition_parameter_kw
=
requested_parameter_dict
,
shared
=
True
)
def
stepRequestTwoAndCheckDifferentResult
(
self
,
sequence
,
**
kw
):
self
.
slap
=
slap
.
slap
()
...
...
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