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
Xiaowu Zhang
slapos.core
Commits
62f5693f
Commit
62f5693f
authored
Mar 06, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Server refuses to set incorrect instance_xml.
Also update consistency checking.
parent
b6aba77f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
master/product/Vifib/tests/testVifibSlapComputerGetComputerPartitionList.py
...ib/tests/testVifibSlapComputerGetComputerPartitionList.py
+22
-4
No files found.
master/product/Vifib/tests/testVifibSlapComputerGetComputerPartitionList.py
View file @
62f5693f
...
...
@@ -3,6 +3,7 @@ from Products.ERP5Type.tests.backportUnittest import skip
import
transaction
import
unittest
from
testVifibSlapWebService
import
TestVifibSlapWebServiceMixin
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
class
TestVifibSlapComputerGetComputerPartitionList
(
TestVifibSlapWebServiceMixin
):
########################################
...
...
@@ -690,11 +691,28 @@ class TestVifibSlapComputerGetComputerPartitionList(TestVifibSlapWebServiceMixin
def
stepDamageSoftwareInstanceXml
(
self
,
sequence
,
**
kw
):
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'software_instance_uid'
])
software_instance
.
edit
(
text_content
=
"""
DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>"""
)
self
.
assertRaises
(
ValidationFailed
,
software_instance
.
edit
,
text_content
=
"""DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>"""
)
def
stepCheckDamageSoftwareInstanceSiteConsistency
(
self
,
sequence
,
**
kw
):
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'software_instance_uid'
])
self
.
portal
.
portal_alarms
.
vifib_check_consistency
.
activeSense
()
transaction
.
commit
()
self
.
tic
()
consistency_error_list
=
self
.
portal
.
portal_alarms
.
vifib_check_consistency
\
.
Alarm_getConsistencyCheckReportLineList
()
self
.
assertEqual
(
1
,
len
(
consistency_error_list
))
consistency_error
=
consistency_error_list
[
0
]
self
.
assertEqual
(
consistency_error
.
getObject
().
getPath
(),
software_instance
.
getPath
())
self
.
assertTrue
(
'Sla XML is invalid'
in
str
(
consistency_error
.
getMessage
()))
self
.
assertTrue
(
self
.
portal
.
portal_alarms
.
vifib_check_consistency
.
sense
())
self
.
checkDivergency
()
def
test_Computer_getComputerPartitionList_damaged_xml
(
self
):
"""Check that getComputerPartitionList works in case of damaged XML on instance."""
"""Check that getComputerPartitionList works in case of trying to damag XML,
which is refused."""
sequence_list
=
SequenceList
()
sequence_string
=
self
\
.
prepare_install_requested_computer_partition_sequence_string
+
"""
...
...
@@ -728,7 +746,7 @@ class TestVifibSlapComputerGetComputerPartitionList(TestVifibSlapWebServiceMixin
SlapLogout
LoginERP5TypeTestCase
CheckSiteConsistency
Check
DamageSoftwareInstance
SiteConsistency
Logout
"""
sequence_list
.
addSequenceString
(
sequence_string
)
...
...
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