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
Jérome Perrin
slapos.core
Commits
f36c8ae4
Commit
f36c8ae4
authored
Aug 04, 2014
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: Added Test for UpgradeDecision_processUpgrade
parent
9a4e3874
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
3 deletions
+66
-3
master/bt5/slapos_pdm/TestTemplateItem/testSlapOSPDMSkins.py
master/bt5/slapos_pdm/TestTemplateItem/testSlapOSPDMSkins.py
+65
-2
master/bt5/slapos_pdm/bt/revision
master/bt5/slapos_pdm/bt/revision
+1
-1
No files found.
master/bt5/slapos_pdm/TestTemplateItem/testSlapOSPDMSkins.py
View file @
f36c8ae4
...
@@ -408,6 +408,43 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -408,6 +408,43 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
assertEqual
(
slap_state
,
hosting_subscription
.
getSlapState
())
self
.
assertEqual
(
slap_state
,
hosting_subscription
.
getSlapState
())
self
.
assertEqual
(
'stopped'
,
upgrade_decision
.
getSimulationState
())
self
.
assertEqual
(
'stopped'
,
upgrade_decision
.
getSimulationState
())
def
testUpgradeDecision_processUpgradeeHostingSubscription
(
self
):
person
=
self
.
_makePerson
(
self
.
new_id
)
hosting_subscription
=
self
.
_makeHostingSubscription
(
self
.
new_id
)
hosting_subscription
.
edit
(
destination_section_value
=
person
.
getRelativeUrl
())
self
.
_makeSoftwareInstance
(
hosting_subscription
,
hosting_subscription
.
getUrlString
())
software_release
=
self
.
_makeSoftwareRelease
(
self
.
new_id
)
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision_line
=
self
.
_makeUpgradeDecisionLine
(
upgrade_decision
)
upgrade_decision_line
.
setAggregateValueList
(
[
software_release
,
hosting_subscription
])
self
.
tic
()
slap_state
=
hosting_subscription
.
getSlapState
()
self
.
assertFalse
(
upgrade_decision
.
UpgradeDecision_processUpgrade
())
self
.
assertNotEqual
(
software_release
.
getUrlString
(),
hosting_subscription
.
getUrlString
())
upgrade_decision
.
confirm
()
upgrade_decision
.
start
()
# Check that url_string change, but slap state doesn't
self
.
assertNotEqual
(
software_release
.
getUrlString
(),
hosting_subscription
.
getUrlString
())
self
.
assertTrue
(
upgrade_decision
.
UpgradeDecision_processUpgrade
())
self
.
assertEqual
(
software_release
.
getUrlString
(),
hosting_subscription
.
getUrlString
())
self
.
assertEqual
(
slap_state
,
hosting_subscription
.
getSlapState
())
self
.
assertEqual
(
'stopped'
,
upgrade_decision
.
getSimulationState
())
def
testUpgradeDecision_upgradeHostingSubscription_no_software_release
(
self
):
def
testUpgradeDecision_upgradeHostingSubscription_no_software_release
(
self
):
person
=
self
.
_makePerson
(
self
.
new_id
)
person
=
self
.
_makePerson
(
self
.
new_id
)
...
@@ -503,6 +540,33 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -503,6 +540,33 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
self
.
assertEqual
(
'stopped'
,
upgrade_decision
.
getSimulationState
())
self
.
assertEqual
(
'stopped'
,
upgrade_decision
.
getSimulationState
())
def
testUpgradeDecision_processUpgradeComputer
(
self
):
person
=
self
.
_makePerson
(
self
.
new_id
)
computer
=
self
.
_makeComputer
(
self
.
new_id
)
software_release
=
self
.
_makeSoftwareRelease
(
self
.
new_id
)
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision_line
=
self
.
_makeUpgradeDecisionLine
(
upgrade_decision
)
upgrade_decision_line
.
setAggregateValueList
([
software_release
,
computer
])
url
=
software_release
.
getUrlString
()
self
.
tic
()
self
.
assertFalse
(
upgrade_decision
.
UpgradeDecision_processUpgrade
())
upgrade_decision
.
confirm
()
upgrade_decision
.
start
()
self
.
assertTrue
(
upgrade_decision
.
UpgradeDecision_processUpgrade
())
self
.
tic
()
software_installation
=
computer
.
getAggregateRelatedValue
(
portal_type
=
'Software Installation'
)
self
.
assertEqual
(
'start_requested'
,
software_installation
.
getSlapState
())
self
.
assertEqual
(
url
,
software_installation
.
getUrlString
())
self
.
assertEqual
(
'validated'
,
software_installation
.
getValidationState
())
self
.
assertEqual
(
'stopped'
,
upgrade_decision
.
getSimulationState
())
def
testSoftwareRelease_createUpgradeDecision_computer
(
self
):
def
testSoftwareRelease_createUpgradeDecision_computer
(
self
):
person
=
self
.
_makePerson
(
self
.
new_id
)
person
=
self
.
_makePerson
(
self
.
new_id
)
computer
=
self
.
_makeComputer
(
self
.
new_id
)
computer
=
self
.
_makeComputer
(
self
.
new_id
)
...
@@ -624,8 +688,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
...
@@ -624,8 +688,7 @@ class TestSlapOSPDMSkins(testSlapOSMixin):
upgrade_decision2
=
computer
.
Computer_checkAndCreateUpgradeDecision
()
upgrade_decision2
=
computer
.
Computer_checkAndCreateUpgradeDecision
()
self
.
assertEqual
(
upgrade_decision2
,
None
)
self
.
assertEqual
(
upgrade_decision2
,
None
)
def
testComputer_hostingSubscriptionCreateUpgradeDecision_no_newer
(
self
):
def
testComputer_hostingSubscriptionCreateUpgradeDecision_no_newer
(
self
):
person
=
self
.
_makePerson
(
self
.
new_id
)
person
=
self
.
_makePerson
(
self
.
new_id
)
computer
=
self
.
_makeComputer
(
self
.
new_id
)
computer
=
self
.
_makeComputer
(
self
.
new_id
)
...
...
master/bt5/slapos_pdm/bt/revision
View file @
f36c8ae4
25
26
\ No newline at end of file
\ 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