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
Eric Zheng
slapos.core
Commits
99d4b44a
Commit
99d4b44a
authored
Nov 07, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test up to Software Installation Module.
parent
af46e85d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
4 deletions
+52
-4
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
...apos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
+51
-3
master/bt5/slapos_erp5/bt/revision
master/bt5/slapos_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
View file @
99d4b44a
...
@@ -539,12 +539,60 @@ class TestSlaveInstance(TestSlapOSGroupRoleSecurityMixin):
...
@@ -539,12 +539,60 @@ class TestSlaveInstance(TestSlapOSGroupRoleSecurityMixin):
test_Computer
=
test_SoftwareInstanceWhichProvidesThisSlaveInstance
test_Computer
=
test_SoftwareInstanceWhichProvidesThisSlaveInstance
class
TestSoftwareInstallation
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareInstallation
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test_GroupCompany
(
self
):
raise
NotImplementedError
installation
=
self
.
portal
.
software_installation_module
.
newContent
(
portal_type
=
'Software Installation'
)
installation
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
installation
,
[
self
.
user_id
,
'G-COMPANY'
],
False
)
self
.
assertRoles
(
installation
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
installation
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
test_OwnerBecomeAssignee
=
test_GroupCompany
def
test_Computer
(
self
):
computer_reference
=
'TESTCOMP-%s'
%
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
template_computer
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
computer
.
edit
(
reference
=
computer_reference
)
installation
=
self
.
portal
.
software_installation_module
.
newContent
(
portal_type
=
'Software Installation'
,
aggregate
=
computer
.
getRelativeUrl
())
installation
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
installation
,
[
self
.
user_id
,
'G-COMPANY'
,
computer_reference
],
False
)
self
.
assertRoles
(
installation
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
installation
,
computer_reference
,
[
'Assignor'
])
self
.
assertRoles
(
installation
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
def
test_ProviderOfTheInstallation
(
self
):
provider_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
provider
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
provider_reference
)
installation
=
self
.
portal
.
software_installation_module
.
newContent
(
portal_type
=
'Software Installation'
,
destination_section
=
provider
.
getRelativeUrl
())
installation
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
installation
,
[
self
.
user_id
,
'G-COMPANY'
,
provider_reference
],
False
)
self
.
assertRoles
(
installation
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
installation
,
provider_reference
,
[
'Assignee'
])
self
.
assertRoles
(
installation
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
class
TestSoftwareInstallationModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareInstallationModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
raise
NotImplementedError
module
=
self
.
portal
.
software_installation_module
self
.
assertSecurityGroup
(
module
,
[
'G-COMPANY'
,
'R-MEMBER'
,
'R-COMPUTER'
,
'zope'
],
False
)
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
class
TestSoftwareInstance
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareInstance
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
...
...
master/bt5/slapos_erp5/bt/revision
View file @
99d4b44a
56
57
\ No newline at end of file
\ No newline at end of file
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