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
b361ceea
Commit
b361ceea
authored
Nov 02, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: test Instance/Remote Nodes local roles
parent
83aa35c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+62
-0
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
b361ceea
...
@@ -437,6 +437,68 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
...
@@ -437,6 +437,68 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
compute_node
,
'%s_R-INSTANCE'
%
project
.
getReference
(),
[
'Auditor'
])
self
.
assertRoles
(
compute_node
,
'%s_R-INSTANCE'
%
project
.
getReference
(),
[
'Auditor'
])
class
TestInstanceNode
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_InstanceNode_userId
(
self
):
compute_node
=
self
.
portal
.
compute_node_module
.
newContent
(
portal_type
=
'Instance Node'
)
self
.
assertSecurityGroup
(
compute_node
,
[
self
.
user_id
],
False
)
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
compute_node
.
edit
(
user_id
=
None
)
self
.
assertSecurityGroup
(
compute_node
,
[
self
.
user_id
],
False
)
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
def
test_InstanceNode_ProjectMember
(
self
):
project
=
self
.
addProject
()
compute_node
=
self
.
portal
.
compute_node_module
.
newContent
(
portal_type
=
'Instance Node'
)
compute_node
.
edit
(
follow_up_value
=
project
)
self
.
assertSecurityGroup
(
compute_node
,
[
self
.
user_id
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODMAN'
%
project
.
getReference
(),
'%s_F-CUSTOMER'
%
project
.
getReference
(),
],
False
)
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
compute_node
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
compute_node
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
compute_node
,
'%s_F-CUSTOMER'
%
project
.
getReference
(),
[
'Auditor'
])
class
TestRemoteNode
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_RemoteNode_userId
(
self
):
compute_node
=
self
.
portal
.
compute_node_module
.
newContent
(
portal_type
=
'Remote Node'
)
self
.
assertSecurityGroup
(
compute_node
,
[
self
.
user_id
],
False
)
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
compute_node
.
edit
(
user_id
=
None
)
self
.
assertSecurityGroup
(
compute_node
,
[
self
.
user_id
],
False
)
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
def
test_RemoteNode_ProjectMember
(
self
):
project
=
self
.
addProject
()
compute_node
=
self
.
portal
.
compute_node_module
.
newContent
(
portal_type
=
'Remote Node'
)
compute_node
.
edit
(
follow_up_value
=
project
)
self
.
assertSecurityGroup
(
compute_node
,
[
self
.
user_id
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
'%s_F-PRODMAN'
%
project
.
getReference
(),
'%s_F-CUSTOMER'
%
project
.
getReference
(),
],
False
)
self
.
assertRoles
(
compute_node
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
compute_node
,
'%s_F-PRODAGNT'
%
project
.
getReference
(),
[
'Assignee'
])
self
.
assertRoles
(
compute_node
,
'%s_F-PRODMAN'
%
project
.
getReference
(),
[
'Assignor'
])
self
.
assertRoles
(
compute_node
,
'%s_F-CUSTOMER'
%
project
.
getReference
(),
[
'Auditor'
])
class
TestComputerModelModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestComputerModelModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_ComputerModelModule
(
self
):
def
test_ComputerModelModule
(
self
):
module
=
self
.
portal
.
computer_model_module
module
=
self
.
portal
.
computer_model_module
...
...
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