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
9ad12df1
Commit
9ad12df1
authored
Oct 12, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: WIP slave test.
Compare behaviour outsied my dev instance
parent
8a1e319b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
0 deletions
+117
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+117
-0
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
9ad12df1
...
...
@@ -399,6 +399,123 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
assert
last_message
is
None
,
last_message
def
test_virtual_master_slave_without_accounting_scenario
(
self
):
# create a default project
project
=
self
.
addProject
()
self
.
web_site
=
self
.
portal
.
web_site_module
.
slapos_master_panel
preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
preference
.
edit
(
preferred_subscription_assignment_category_list
=
[
'function/customer'
,
'role/client'
,
'destination_project/%s'
%
project
.
getRelativeUrl
()
]
)
# some preparation
self
.
logout
()
# lets join as slapos administrator, which will own few compute_nodes
owner_reference
=
'owner-%s'
%
self
.
generateNewId
()
self
.
joinSlapOS
(
self
.
web_site
,
owner_reference
)
self
.
login
()
owner_person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"ERP5 Login"
,
reference
=
owner_reference
).
getParentValue
()
# first slapos administrator assignment can only be created by
# the erp5 manager
self
.
addProjectProductionManagerAssignment
(
owner_person
,
project
)
self
.
tic
()
# hooray, now it is time to create compute_nodes
self
.
login
(
owner_person
.
getUserId
())
public_server_title
=
'Public Server for %s'
%
owner_reference
public_server_id
=
self
.
requestComputeNode
(
public_server_title
,
project
.
getReference
())
public_server
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Compute Node'
,
reference
=
public_server_id
)
self
.
setAccessToMemcached
(
public_server
)
self
.
assertNotEqual
(
None
,
public_server
)
self
.
setServerOpenPublic
(
public_server
)
# and install some software on them
public_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
supplySoftware
(
public_server
,
public_server_software
)
# format the compute_nodes
self
.
formatComputeNode
(
public_server
)
# join as the another visitor and request software instance on public
# compute_node
self
.
logout
()
public_reference
=
'public-%s'
%
self
.
generateNewId
()
self
.
joinSlapOS
(
self
.
web_site
,
public_reference
)
self
.
login
()
public_person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"ERP5 Login"
,
reference
=
public_reference
).
getParentValue
()
public_instance_title
=
'Public title %s'
%
self
.
generateNewId
()
public_instance_type
=
'public type'
self
.
checkInstanceAllocation
(
public_person
.
getUserId
(),
public_reference
,
public_instance_title
,
public_server_software
,
public_instance_type
,
public_server
,
project
.
getReference
())
public_instance_title
=
'Slave title %s'
%
self
.
generateNewId
()
self
.
checkSlaveInstanceAllocation
(
public_person
.
getUserId
(),
public_reference
,
public_instance_title
,
public_server_software
,
public_instance_type
,
public_server
,
project
.
getReference
())
self
.
login
()
public_person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'ERP5 Login'
,
reference
=
public_reference
).
getParentValue
()
self
.
login
(
owner_person
.
getUserId
())
# and the instances
self
.
checkSlaveInstanceUnallocation
(
public_person
.
getUserId
(),
public_reference
,
public_instance_title
,
public_server_software
,
public_instance_type
,
public_server
,
project
.
getReference
())
# and uninstall some software on them
self
.
logout
()
self
.
login
(
owner_person
.
getUserId
())
self
.
supplySoftware
(
public_server
,
public_server_software
,
state
=
'destroyed'
)
self
.
logout
()
# Uninstall from compute_node
self
.
login
()
self
.
simulateSlapgridSR
(
public_server
)
self
.
tic
()
# XXX Do this for every scenario tests
self
.
logout
()
self
.
stepCallAlarmList
()
self
.
tic
()
self
.
login
()
# Ensure no unexpected object has been created
# 3 (can reduce to 2) assignment, 1 instance tree, 1 compute node, 1 software installation
# 1 software instance
# 2 credential request
related_object_list
=
project
.
Base_getRelatedObjectList
(
**
{
'category.category_strict_membership'
:
1
})
assert
len
(
related_object_list
)
==
9
,
[
x
.
getRelativeUrl
()
for
x
in
related_object_list
]
self
.
stepcheckERP5Consistency
()
# after accept, an email is send containing the reset link
last_message
=
self
.
portal
.
MailHost
.
_last_message
assert
last_message
is
None
,
last_message
def
test_open_order_with_service_scenario
(
self
):
# create a default project
...
...
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