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
78ca9e68
Commit
78ca9e68
authored
Jun 01, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: add customer project assignment
parent
5694a8fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
36 deletions
+32
-36
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.py
...tal_components/test.erp5.testSlapOSERP5DefaultScenario.py
+29
-12
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.xml
...al_components/test.erp5.testSlapOSERP5DefaultScenario.xml
+3
-24
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.py
View file @
78ca9e68
...
...
@@ -26,6 +26,13 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
function
=
'computer/manager'
).
open
()
def
addProjectCustomerAssignment
(
self
,
person
,
project
):
person
.
newContent
(
portal_type
=
'Assignment'
,
destination_project_value
=
project
,
function
=
'customer'
).
open
()
def
addProject
(
self
):
project
=
self
.
portal
.
project_module
.
newContent
(
portal_type
=
'Project'
,
...
...
@@ -83,13 +90,14 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
public_person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"ERP5 Login"
,
reference
=
public_reference
).
getParentValue
()
self
.
addProjectCustomerAssignment
(
public_person
,
project
)
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
)
public_server
,
project
.
getReference
()
)
# turn public guy to a friend and check that he can allocate slave
...
...
@@ -103,7 +111,8 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
# and the instances
self
.
checkInstanceUnallocation
(
public_person
.
getUserId
(),
public_reference
,
public_instance_title
,
public_server_software
,
public_instance_type
,
public_server
)
public_server_software
,
public_instance_type
,
public_server
,
project
.
getReference
())
# and uninstall some software on them
self
.
logout
()
...
...
@@ -120,6 +129,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
self
.
stepCallSlaposRequestUpdateInstanceTreeOpenSaleOrderAlarm
()
self
.
tic
()
self
.
logout
()
self
.
login
()
self
.
assertOpenSaleOrderCoverage
(
public_reference
)
...
...
@@ -204,16 +214,23 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
self
.
stepCallSlaposManageBuildingCalculatingDeliveryAlarm
()
self
.
tic
()
"""
self.logout()
self.login('ERP5TypeTestCase')
# trigger the CRM interaction
self.stepCallSlaposCrmCreateRegularisationRequestAlarm()
self.tic()
self.logout()
self.login()
# check final document state
for person_reference in (owner_reference, ):
person = self.portal.portal_catalog.getResultValue(
portal_type='ERP5 Login', reference=person_reference).getParentValue()
self.assertPersonDocumentCoverage(person)
"""
def
test_default_scenario
(
self
):
# some preparation
...
...
@@ -286,7 +303,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
self
.
checkInstanceAllocation
(
public_person
.
getUserId
(),
public_reference
,
public_instance_title
,
public_server_software
,
public_instance_type
,
public_server
)
public_server
,
'XXX'
)
# join as owner friend and request a software instance on compute_node
# configured by owner
...
...
@@ -307,7 +324,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
friend_instance_type
=
'friend_type'
self
.
checkInstanceAllocation
(
friend_person
.
getUserId
(),
friend_reference
,
friend_instance_title
,
friend_server_software
,
friend_instance_type
,
friend_server
)
friend_server
,
'XXX'
)
# check that friend is able to request slave instance matching the
# public's compute_node software instance
...
...
@@ -315,7 +332,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
generateNewId
()
self
.
checkSlaveInstanceAllocation
(
friend_person
.
getUserId
(),
friend_reference
,
friend_slave_instance_title
,
public_server_software
,
public_instance_type
,
public_server
)
public_instance_type
,
public_server
,
'XXX'
)
# turn public guy to a friend and check that he can allocate slave
# instance on instance provided by friend
...
...
@@ -331,25 +348,25 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
.
generateNewId
()
self
.
checkSlaveInstanceAllocation
(
public_person
.
getUserId
(),
public_reference
,
public_slave_instance_title
,
friend_server_software
,
friend_instance_type
,
friend_server
)
friend_instance_type
,
friend_server
,
'XXX'
)
# now deallocate the slaves
self
.
checkSlaveInstanceUnallocation
(
public_person
.
getUserId
(),
public_reference
,
public_slave_instance_title
,
friend_server_software
,
friend_instance_type
,
friend_server
)
friend_instance_type
,
friend_server
,
'XXX'
)
self
.
checkSlaveInstanceUnallocation
(
friend_person
.
getUserId
(),
friend_reference
,
friend_slave_instance_title
,
public_server_software
,
public_instance_type
,
public_server
)
public_instance_type
,
public_server
,
'XXX'
)
# and the instances
self
.
checkInstanceUnallocation
(
public_person
.
getUserId
(),
public_reference
,
public_instance_title
,
public_server_software
,
public_instance_type
,
public_server
)
public_server_software
,
public_instance_type
,
public_server
,
'XXX'
)
self
.
checkInstanceUnallocation
(
friend_person
.
getUserId
(),
friend_reference
,
friend_instance_title
,
friend_server_software
,
friend_instance_type
,
friend_server
)
friend_server_software
,
friend_instance_type
,
friend_server
,
'XXX'
)
# and uninstall some software on them
self
.
logout
()
...
...
@@ -605,7 +622,7 @@ class TestSlapOSDefaultCRMEscalation(DefaultScenarioMixin):
public_instance_type
=
'public type'
public_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
requestInstance
(
person
.
getUserId
(),
public_instance_title
,
public_server_software
,
public_instance_type
)
public_server_software
,
public_instance_type
,
'XXX'
)
# check the Open Sale Order coverage
self
.
stepCallSlaposRequestUpdateInstanceTreeOpenSaleOrderAlarm
()
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.xml
View file @
78ca9e68
...
...
@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSERP5DefaultScenario
</string>
</value>
...
...
@@ -55,28 +49,13 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -89,7 +68,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
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