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
Xavier Thompson
slapos.core
Commits
848fc3e7
Commit
848fc3e7
authored
Oct 25, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test Software Instance requestComputerPartition
parent
aa08b3ef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSSlapTool.py
...r/bt5/slapos_cloud/TestTemplateItem/testSlapOSSlapTool.py
+38
-0
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSSlapTool.py
View file @
848fc3e7
...
...
@@ -1123,3 +1123,41 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
destroy_requested_software_instance
.
getValidationState
())
self
.
assertEqual
(
None
,
self
.
destroy_requested_software_instance
.
getSslKey
())
self
.
assertEqual
(
None
,
self
.
destroy_requested_software_instance
.
getSslCertificate
())
def
assertInstanceRequestSimulator
(
self
,
args
,
kwargs
):
stored
=
eval
(
open
(
self
.
instance_request_simulator
).
read
())
# do the same translation magic as in workflow
self
.
assertEqual
(
stored
,
[{
'recargs'
:
args
,
'reckwargs'
:
kwargs
,
'recmethod'
:
'requestInstance'
}])
def
test_request
(
self
):
self
.
_makeComplexComputer
()
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Computer Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getReference
())
self
.
start_requested_software_instance
.
requestInstance
=
Simulator
(
self
.
instance_request_simulator
,
'requestInstance'
)
response
=
self
.
portal_slap
.
requestComputerPartition
(
self
.
computer_id
,
partition_id
,
'req_release'
,
'req_reference'
,
'<marshal><bool>1</bool></marshal>'
,
'<marshal><dictionary id="i2"/></marshal>'
,
'<marshal><dictionary id="i2"/></marshal>'
,
'<marshal><string>started</string></marshal>'
)
self
.
assertEqual
(
408
,
response
.
status
)
self
.
assertEqual
(
'private'
,
response
.
headers
.
get
(
'cache-control'
))
self
.
assertInstanceRequestSimulator
((),
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'software_title'
:
'<marshal><bool>1</bool></marshal>'
,
'software_release'
:
'req_release'
,
'state'
:
'started'
,
'sla_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'software_type'
:
'req_reference'
,
'shared'
:
False
})
finally
:
if
os
.
path
.
exists
(
self
.
instance_request_simulator
):
os
.
unlink
(
self
.
instance_request_simulator
)
master/bt5/slapos_cloud/bt/revision
View file @
848fc3e7
94
\ No newline at end of file
95
\ No newline at end of file
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