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
Ophélie Gagnard
slapos.core
Commits
37589c69
Commit
37589c69
authored
Dec 20, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[slapos_pdm] add test for Prevent concurrent transaction to create 2 upgrade decision
parent
849afebe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
+34
-0
No files found.
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
View file @
37589c69
...
@@ -1134,6 +1134,40 @@ class TestSlapOSPDMSkins(SlapOSTestCaseMixin):
...
@@ -1134,6 +1134,40 @@ class TestSlapOSPDMSkins(SlapOSTestCaseMixin):
up_decision
=
hosting_subscription
.
HostingSubscription_createUpgradeDecision
()
up_decision
=
hosting_subscription
.
HostingSubscription_createUpgradeDecision
()
self
.
assertEqual
(
up_decision
,
None
)
self
.
assertEqual
(
up_decision
,
None
)
def
testHostingSubscription_createUpgradeDecision_create_once
(
self
):
person
=
self
.
_makePerson
()
computer
=
self
.
_makeComputer
(
allocation_scope
=
"open/personal"
)
computer
.
edit
(
source_administration_value
=
person
)
self
.
_makeComputerPartitions
(
computer
)
software_product
=
self
.
_makeSoftwareProduct
()
software_release
=
self
.
_requestSoftwareRelease
(
software_product
.
getRelativeUrl
())
url_string
=
software_release
.
getUrlString
()
self
.
_makeSoftwareInstallation
(
computer
,
url_string
)
# Create Hosting Subscription and Software Instance
hosting_subscription
=
self
.
_makeFullHostingSubscription
(
url_string
,
person
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
getPredecessorValue
())
# Install the Newest software release
software_release2
=
self
.
_requestSoftwareRelease
(
software_product
.
getRelativeUrl
())
self
.
_makeSoftwareInstallation
(
computer
,
software_release2
.
getUrlString
())
self
.
tic
()
up_decision
=
hosting_subscription
.
HostingSubscription_createUpgradeDecision
()
self
.
assertNotEqual
(
up_decision
,
None
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'planned'
)
# call a second time without tic
up_decision
=
hosting_subscription
.
HostingSubscription_createUpgradeDecision
()
# no new Upgrade decision created
self
.
assertEqual
(
up_decision
,
None
)
def
testHostingSubscription_createUpgradeDecision
(
self
):
def
testHostingSubscription_createUpgradeDecision
(
self
):
person
=
self
.
_makePerson
()
person
=
self
.
_makePerson
()
computer
=
self
.
_makeComputer
()
computer
=
self
.
_makeComputer
()
...
...
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