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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
4e671e0d
Commit
4e671e0d
authored
Jan 23, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: check created upgrade decision
parent
f7b3441b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
24 deletions
+74
-24
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
...ents/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
+74
-24
No files found.
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
View file @
4e671e0d
...
...
@@ -104,6 +104,32 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self
.
tic
()
return
software_product
,
release_variation
,
type_variation
,
compute_node
,
instance_tree
def
checkCreatedUpgradeDecision
(
self
,
upgrade_decision
,
instance_tree
,
software_product
,
release_variation
,
type_variation
):
self
.
assertEqual
(
'confirmed'
,
upgrade_decision
.
getSimulationState
())
project
=
instance_tree
.
getFollowUpValue
()
self
.
assertEqual
(
instance_tree
.
getRelativeUrl
(),
upgrade_decision
.
getAggregate
())
self
.
assertEqual
(
software_product
.
getRelativeUrl
(),
upgrade_decision
.
getResource
())
self
.
assertEqual
(
release_variation
.
getRelativeUrl
(),
upgrade_decision
.
getSoftwareRelease
())
self
.
assertEqual
(
type_variation
.
getRelativeUrl
(),
upgrade_decision
.
getSoftwareType
())
self
.
assertEqual
(
project
.
getRelativeUrl
(),
upgrade_decision
.
getDestinationProject
())
person
=
instance_tree
.
getDestinationSectionValue
()
self
.
assertEqual
(
person
.
getRelativeUrl
(),
upgrade_decision
.
getDestinationDecision
())
self
.
assertEqual
(
person
.
getRelativeUrl
(),
upgrade_decision
.
getDestinationSection
())
# Check that software release url is not the same
self
.
assertEqual
(
type_variation
.
getTitle
(),
instance_tree
.
getSourceReference
())
self
.
assertNotEqual
(
release_variation
.
getUrlString
(),
instance_tree
.
getUrlString
())
##########################################################################
# Not allocated
##########################################################################
...
...
@@ -115,8 +141,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
def
test_createUpgradeDecision_notAllocated_newReleaseOnRemoteNode
(
self
):
software_product
,
_
,
type_variation
,
compute_node
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
node
=
"remote"
)
...
...
@@ -126,8 +154,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
def
test_createUpgradeDecision_notAllocated_newReleaseOnInstanceNode
(
self
):
software_product
,
_
,
type_variation
,
compute_node
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
node
=
"instance"
)
...
...
@@ -169,8 +199,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
self
.
tic
()
self
.
assertEqual
(
None
,
instance_tree
.
InstanceTree_createUpgradeDecision
())
...
...
@@ -183,8 +215,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
self
.
commit
()
self
.
assertEqual
(
None
,
instance_tree
.
InstanceTree_createUpgradeDecision
())
...
...
@@ -198,12 +232,17 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
upgrade_decision
,
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
upgrade_decision
.
reject
()
self
.
tic
()
upgrade_decision2
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision2
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
##########################################################################
# Shared not allocated
...
...
@@ -226,8 +265,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
def
test_createUpgradeDecision_sharedNotAllocated_newReleaseOnInstanceNode
(
self
):
software_product
,
_
,
type_variation
,
compute_node
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
shared
=
True
,
node
=
"instance"
)
...
...
@@ -237,8 +278,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
##########################################################################
# Allocated on Compute Node
...
...
@@ -273,8 +316,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
def
test_createUpgradeDecision_allocatedOnComputeNode_twoRelease
(
self
):
software_product
,
release_variation
,
type_variation
,
compute_node
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_allocated
=
True
)
...
...
@@ -326,8 +371,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
def
test_createUpgradeDecision_allocatedOnRemoteNode_twoRelease
(
self
):
software_product
,
release_variation
,
type_variation
,
remote_node
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_allocated
=
True
,
node
=
"remote"
)
...
...
@@ -369,8 +416,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
def
test_createUpgradeDecision_slaveAllocatedOnRemoteNode_twoRelease
(
self
):
software_product
,
release_variation
,
type_variation
,
remote_node
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_allocated
=
True
,
shared
=
True
,
node
=
"remote"
)
...
...
@@ -412,9 +461,10 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
new_release_variation
,
type_variation
)
self
.
tic
()
upgrade_decision
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
'started'
,
upgrade_decision
.
getSimulationState
())
self
.
checkCreatedUpgradeDecision
(
instance_tree
.
InstanceTree_createUpgradeDecision
(),
instance_tree
,
software_product
,
new_release_variation
,
type_variation
)
def
test_createUpgradeDecision_slaveAllocatedOnInstanceNode_newReleaseOnAnotherInstanceNode
(
self
):
software_product
,
_
,
type_variation
,
_
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_allocated
=
True
,
shared
=
True
,
node
=
"instance"
)
...
...
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