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
Boxiang Sun
slapos.core
Commits
cb1d912d
Commit
cb1d912d
authored
10 years ago
by
Alain Takoudjou
Committed by
Rafael Monnerat
10 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test script for Alarm checkAndUpdateAllocationScope and H_S partial allocation instances
parent
e8dc7513
master
3.12
alain-message
amarisoft
caddy
config_debug
disconnect
erp5_doc
feat/cmmi_cache
feat/testcase
feature/cgroups
feature/format-crumbled
feature/manager-cpuset
feature/option_create_tun
feature/tun-cgroup-cleanup
fix/slapos-ansible
fixup
fixup-1
fraud
golang
hotfix/proxy-root-instance
kylin
master-dev
me
me_bk
message-box
monitor
network
py3_fixup
seb
selenium_test
slapos_doc
tomo_fix_slapos_format
tomo_fix_slapos_node_boot
tomo_fix_status
tomo_listbox_update
vifib-fixup
wechat
wechat_bk
wechat_test
1.4.27
1.4.26
1.4.25
1.4.24
1.4.23
1.4.22
1.4.21
1.4.20
1.4.19
1.4.17
1.4.16
1.4.15
1.4.14
1.4.12
1.4.11
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.18
1.3.17
1.3.16
1.3.15
1.3.14
1.3.13
1.3.12
1.3.11
1.3.10
1.3.9
1.3.8
1.3.7
1.3.6.3
1.3.6.2
1.3.6.1
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
master-20180917
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
319 additions
and
91 deletions
+319
-91
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSkins.py
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSkins.py
+226
-52
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSupportRequestGeneration.py
...TestTemplateItem/testSlapOSCRMSupportRequestGeneration.py
+92
-38
master/bt5/slapos_crm/bt/revision
master/bt5/slapos_crm/bt/revision
+1
-1
No files found.
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSkins.py
View file @
cb1d912d
This diff is collapsed.
Click to expand it.
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSupportRequestGeneration.py
View file @
cb1d912d
...
...
@@ -692,48 +692,102 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
self
.
assertEqual
(
'Visited by SoftwareRelease_testForAllocation'
,
software_release
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_Alarm_notAllowedAllocationScope
(
self
):
computer
=
self
.
_makeComputer
(
self
.
new_id
)
person
=
computer
.
getSourceAdministrationValue
()
self
.
_updatePersonAssignment
(
person
,
'role/member'
)
computer
.
edit
(
allocation_scope
=
'open/public'
)
self
.
portal
.
portal_alarms
.
slapos_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
self
.
assertEquals
(
computer
.
getAllocationScope
(),
'open/personal'
)
def
_simulateComputer_checkAndUpdateAllocationScope
(
self
):
script_name
=
'Computer_checkAndUpdateAllocationScope'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
script_name
,
'*args, **kw'
,
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by Computer_checkAndUpdateAllocationScope') """
)
transaction
.
commit
()
computer
.
edit
(
allocation_scope
=
'open/personal'
)
self
.
portal
.
portal_alarms
.
slapos_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
self
.
assertEquals
(
computer
.
getAllocationScope
(),
'open/personal'
)
def
_dropComputer_checkAndUpdateAllocationScope
(
self
):
script_name
=
'Computer_checkAndUpdateAllocationScope'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
def
test_Alarm_notAllowedAllocationScope_OpenPublic
(
self
):
computer
=
self
.
_makeComputer
(
self
.
new_id
)
computer
.
edit
(
allocation_scope
=
'open/public'
)
friend_person
=
self
.
_makePerson
(
self
.
new_id
)
computer
.
edit
(
allocation_scope
=
'open/friend'
,
destination_section
=
friend_person
.
getRelativeUrl
())
self
.
portal
.
portal_alarms
.
slapos_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
self
.
assertEquals
(
computer
.
getAllocationScope
(),
'open/personal'
)
self
.
_simulateComputer_checkAndUpdateAllocationScope
()
try
:
self
.
portal
.
portal_alarms
.
slapos_crm_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropComputer_checkAndUpdateAllocationScope
()
def
test_Alarm_allowedAllocationScope
(
self
):
self
.
assertEqual
(
'Visited by Computer_checkAndUpdateAllocationScope'
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_Alarm_notAllowedAllocationScope_OpenFriend
(
self
):
computer
=
self
.
_makeComputer
(
self
.
new_id
)
person
=
computer
.
getSourceAdministrationValue
()
self
.
_updatePersonAssignment
(
person
,
'role/service_provider'
)
computer
.
edit
(
allocation_scope
=
'open/friend'
)
computer
.
edit
(
allocation_scope
=
'open/public'
)
self
.
portal
.
portal_alarms
.
slapos_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
self
.
assertEquals
(
computer
.
getAllocationScope
(),
'open/public'
)
self
.
_simulateComputer_checkAndUpdateAllocationScope
()
try
:
self
.
portal
.
portal_alarms
.
slapos_crm_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropComputer_checkAndUpdateAllocationScope
()
self
.
assertEqual
(
'Visited by Computer_checkAndUpdateAllocationScope'
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_Alarm_notAllowedAllocationScope_OpenPersonal
(
self
):
computer
=
self
.
_makeComputer
(
self
.
new_id
)
computer
.
edit
(
allocation_scope
=
'open/personal'
)
computer
.
edit
(
allocation_scope
=
'open/personal'
)
self
.
portal
.
portal_alarms
.
slapos_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
self
.
assertEquals
(
computer
.
getAllocationScope
(),
'open/personal'
)
self
.
_simulateComputer_checkAndUpdateAllocationScope
()
try
:
self
.
portal
.
portal_alarms
.
slapos_crm_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropComputer_checkAndUpdateAllocationScope
()
self
.
assertNotEqual
(
'Visited by Computer_checkAndUpdateAllocationScope'
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
_simulateHostingSubscription_checkSofwareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSofwareInstanceState'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
script_name
,
'*args, **kw'
,
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by HostingSubscription_checkSofwareInstanceState') """
)
transaction
.
commit
()
def
_dropHostingSubscription_checkSofwareInstanceState
(
self
):
script_name
=
'HostingSubscription_checkSofwareInstanceState'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
def
test_Alarm_findAndNofitiyUnallocatedSoftwareInstance
(
self
):
host_sub
=
self
.
_makeHostingSubscription
(
self
.
new_id
)
self
.
_makeSoftwareInstance
(
host_sub
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
host_sub
.
getPredecessorValue
()
self
.
assertEqual
(
instance
.
getAggregate
(
""
),
""
)
friend_person
=
self
.
_makePerson
(
self
.
new_id
)
computer
.
edit
(
allocation_scope
=
'open/friend'
,
destination_section
=
friend_person
.
getRelativeUrl
())
self
.
portal
.
portal_alarms
.
slapos_check_update_allocation_scope
.
activeSense
()
self
.
tic
()
self
.
assertEquals
(
computer
.
getAllocationScope
(),
'open/friend'
)
\ No newline at end of file
self
.
_simulateHostingSubscription_checkSofwareInstanceState
()
try
:
self
.
portal
.
portal_alarms
.
slapos_crm_check_partially_allocated_instance
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropHostingSubscription_checkSofwareInstanceState
()
self
.
assertEqual
(
'Visited by HostingSubscription_checkSofwareInstanceState'
,
host_sub
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
\ No newline at end of file
This diff is collapsed.
Click to expand it.
master/bt5/slapos_crm/bt/revision
View file @
cb1d912d
35
\ No newline at end of file
36
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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