Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
107
Merge Requests
107
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
ffd465e7
Commit
ffd465e7
authored
Oct 31, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initiate instance_slap_interface_workflow testing.
parent
94ec0fc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
2 deletions
+87
-2
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreInstanceSlapInterfaceWorkflow.py
...mplateItem/testSlapOSCoreInstanceSlapInterfaceWorkflow.py
+84
-0
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
master/bt5/slapos_cloud/bt/template_test_id_list
master/bt5/slapos_cloud/bt/template_test_id_list
+2
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreInstanceSlapInterfaceWorkflow.py
0 → 100644
View file @
ffd465e7
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
import
transaction
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestSlapOSCoreInstanceSlapInterfaceWorkflow
(
testSlapOSMixin
):
def
afterSetUp
(
self
):
super
(
TestSlapOSCoreInstanceSlapInterfaceWorkflow
,
self
).
afterSetUp
()
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
edit
(
)
hosting_subscription
.
validate
()
hosting_subscription
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTHS-%s"
%
self
.
generateNewId
(),
)
kw
=
dict
(
software_release
=
\
self
.
generateNewSoftwareReleaseUrl
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
hosting_subscription
.
getTitle
(),
state
=
'started'
)
hosting_subscription
.
requestStart
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
self
.
instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
tic
()
def
_countInstanceBang
(
self
,
instance
,
comment
):
return
len
([
q
for
q
in
instance
.
workflow_history
[
'instance_slap_interface_workflow'
]
if
q
[
'action'
]
==
'bang'
and
\
q
[
'comment'
]
==
comment
])
def
test_bang_required_comment
(
self
):
self
.
login
(
self
.
instance
.
getReference
())
self
.
assertRaises
(
KeyError
,
self
.
instance
.
bang
,
bang_tree
=
0
)
transaction
.
abort
()
def
test_bang_required_bang_tree
(
self
):
self
.
login
(
self
.
instance
.
getReference
())
comment
=
'Comment %s'
%
self
.
generateNewId
()
self
.
assertRaises
(
KeyError
,
self
.
instance
.
bang
,
comment
=
comment
)
transaction
.
abort
()
def
test_bang
(
self
):
self
.
login
(
self
.
instance
.
getReference
())
comment
=
'Comment %s'
%
self
.
generateNewId
()
count
=
self
.
_countInstanceBang
(
self
.
instance
,
comment
)
self
.
instance
.
bang
(
bang_tree
=
0
,
comment
=
comment
)
self
.
assertEqual
(
count
+
1
,
self
.
_countInstanceBang
(
self
.
instance
,
comment
))
def
test_bang_tree
(
self
):
self
.
login
(
self
.
instance
.
getReference
())
request_kw
=
dict
(
software_release
=
\
self
.
generateNewSoftwareReleaseUrl
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
'New %s'
%
self
.
generateNewId
(),
state
=
'started'
)
self
.
instance
.
requestInstance
(
**
request_kw
)
request_instance
=
self
.
instance
.
REQUEST
[
'request_instance'
]
self
.
instance
.
REQUEST
[
'request_instance'
]
=
None
self
.
tic
()
comment
=
'Comment %s'
%
self
.
generateNewId
()
count1
=
self
.
_countInstanceBang
(
self
.
instance
,
comment
)
count2
=
self
.
_countInstanceBang
(
request_instance
,
comment
)
self
.
instance
.
bang
(
bang_tree
=
1
,
comment
=
comment
)
self
.
tic
()
self
.
assertEqual
(
count1
+
1
,
self
.
_countInstanceBang
(
self
.
instance
,
comment
))
self
.
assertEqual
(
count2
+
1
,
self
.
_countInstanceBang
(
request_instance
,
comment
))
master/bt5/slapos_cloud/bt/revision
View file @
ffd465e7
167
\ No newline at end of file
168
\ No newline at end of file
master/bt5/slapos_cloud/bt/template_test_id_list
View file @
ffd465e7
...
...
@@ -5,4 +5,5 @@ testSlapOSCoreSoftwareInstanceRequest
testSlapOSShadow
testSlapOSCoreAllocation
testSlapOSCoreComputerSlapInterfaceWorkflow
testSlapOSCoreComputerPartitionSlapInterfaceWorkflow
\ No newline at end of file
testSlapOSCoreComputerPartitionSlapInterfaceWorkflow
testSlapOSCoreInstanceSlapInterfaceWorkflow
\ 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