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
Titouan Soulard
slapos.core
Commits
2159c801
Commit
2159c801
authored
May 02, 2023
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: test: bypass Service_getSubscriptionStatus
parent
fbb1c230
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+12
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py
...al_components/test.erp5.testSlapOSCloudAllocationAlarm.py
+7
-0
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
2159c801
...
@@ -583,6 +583,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
...
@@ -583,6 +583,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
url_string
=
'type%s'
%
self
.
generateNewId
(),
url_string
=
'type%s'
%
self
.
generateNewId
(),
)
)
@
simulate
(
'Service_getSubscriptionStatus'
,
'*args, **kwargs'
,
'return "subscribed"'
)
def
bootstrapAllocableInstanceTree
(
self
,
allocation_state
=
'possible'
,
shared
=
False
,
node
=
"compute"
,
def
bootstrapAllocableInstanceTree
(
self
,
allocation_state
=
'possible'
,
shared
=
False
,
node
=
"compute"
,
is_accountable
=
False
,
base_price
=
None
,
has_organisation
=
False
):
is_accountable
=
False
,
base_price
=
None
,
has_organisation
=
False
):
if
allocation_state
not
in
(
'impossible'
,
'possible'
,
'allocated'
):
if
allocation_state
not
in
(
'impossible'
,
'possible'
,
'allocated'
):
...
@@ -714,6 +715,17 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
...
@@ -714,6 +715,17 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
if
not
((
node
==
"instance"
)
and
(
shared
)):
if
not
((
node
==
"instance"
)
and
(
shared
)):
partition
.
markBusy
()
partition
.
markBusy
()
# create fake open order, to bypass Service_getSubscriptionStatus
for
item
in
[
instance_tree
.
getSuccessorValue
(),
partition
.
getParentValue
()]:
open_order
=
self
.
portal
.
open_sale_order_module
.
newContent
(
portal_type
=
"Open Sale Order"
,
ledger
=
"automated"
,
destination_section_value
=
person
)
open_order
.
newContent
(
aggregate_value
=
item
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
open_order
,
'validated'
)
self
.
tic
()
self
.
tic
()
return
software_product
,
release_variation
,
type_variation
,
compute_node
,
partition
,
instance_tree
return
software_product
,
release_variation
,
type_variation
,
compute_node
,
partition
,
instance_tree
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py
View file @
2159c801
...
@@ -15,6 +15,13 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
...
@@ -15,6 +15,13 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
compute_node
,
compute_node
,
release_variation
.
getUrlString
()
release_variation
.
getUrlString
()
)
)
open_order
=
self
.
portal
.
open_sale_order_module
.
newContent
(
portal_type
=
"Open Sale Order"
,
)
open_order
.
newContent
(
aggregate_value
=
compute_node
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
open_order
,
'validated'
)
self
.
tic
()
self
.
tic
()
return
compute_node
,
partition
return
compute_node
,
partition
...
...
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