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
Thomas Leymonerie
slapos.core
Commits
3ca1ad85
Commit
3ca1ad85
authored
Oct 11, 2011
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to change the software type of a instance.
This fix OpenOrder.request software type modification
parent
0285c081
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
3 deletions
+82
-3
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance.xml
...rface_workflow/scripts/Person_requestSoftwareInstance.xml
+2
-2
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
+79
-0
No files found.
master/bt5/vifib_slap/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/scripts/Person_requestSoftwareInstance.xml
View file @
3ca1ad85
...
...
@@ -74,13 +74,12 @@ if is_slave == True:\n
else:\n
software_instance_portal_type = "Software Instance"\n
\n
tag = "%s_%s_
%s_inProgress" % (person.getUid(), software_type
, \n
tag = "%s_%s_
inProgress" % (person.getUid()
, \n
software_title)\n
\n
# Check if it already exists\n
request_software_instance = portal.portal_catalog.getResultValue(\n
portal_type=software_instance_portal_type,\n
source_reference=software_type,\n
title=software_title,\n
)\n
if (request_software_instance is None):\n
...
...
@@ -176,6 +175,7 @@ else:\n
# Update existing software instance\n
request_software_instance.edit(\n
text_content=instance_xml,\n
source_reference=software_type,\n
sla_xml=sla_xml,\n
activate_kw={\'tag\': tag},\n
)\n
...
...
master/bt5/vifib_slap/bt/revision
View file @
3ca1ad85
42
5
42
6
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
View file @
3ca1ad85
...
...
@@ -186,6 +186,85 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
stepSetFirstSoftwareType
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
software_type
=
"FirstSoftwareType"
)
def
stepPersonRequestSlapSoftwareInstanceWithAnotherSoftwareType
(
self
,
sequence
,
**
kw
):
software_release
=
sequence
[
'software_release_uri'
]
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
open_order
=
self
.
slap
.
registerOpenOrder
()
requested_slap_computer_partition
=
open_order
.
request
(
software_release
=
software_release
,
software_type
=
"SecondSoftwareType"
,
partition_reference
=
sequence
[
'requested_reference'
],
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}))
def
stepCheckPersonRequestSlapSoftwareInstanceWithAnotherSoftwareType
(
self
,
sequence
,
**
kw
):
software_release
=
sequence
[
'software_release_uri'
]
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
open_order
=
self
.
slap
.
registerOpenOrder
()
requested_slap_computer_partition
=
open_order
.
request
(
software_release
=
software_release
,
software_type
=
"SecondSoftwareType"
,
partition_reference
=
sequence
[
'requested_reference'
],
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}))
self
.
assertEquals
(
sequence
.
get
(
'requested_computer_partition_reference'
),
requested_slap_computer_partition
.
getId
())
self
.
assertEquals
(
"SecondSoftwareType"
,
requested_slap_computer_partition
.
getInstanceParameterDict
()[
'slap_software_type'
])
self
.
assertEquals
(
1
,
requested_slap_computer_partition
.
_need_modification
)
def
test_OpenOrder_request_changeSoftwareType
(
self
):
"""
Check that requesting the same instance with a different software type
does not create a new instance
"""
self
.
computer_partition_amount
=
1
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_published_software_release
+
\
self
.
prepare_formated_computer
+
"""
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
SetRandomRequestedReference
SlapLoginTestVifibCustomer
SetFirstSoftwareType
PersonRequestSlapSoftwareInstancePrepare
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
PersonRequestSlapSoftwareInstanceWithAnotherSoftwareType
Tic
CheckPersonRequestSlapSoftwareInstanceWithAnotherSoftwareType
SlapLogout
"""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestVifibSlapOpenOrderRequest
))
...
...
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