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
Jérome Perrin
slapos.core
Commits
e45a44a3
Commit
e45a44a3
authored
Jun 21, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for state parmeter functionality.
parent
01ba9050
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
3 deletions
+88
-3
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+88
-3
No files found.
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
e45a44a3
...
@@ -203,6 +203,15 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -203,6 +203,15 @@ class TestVifibSlapWebService(testVifibMixin):
and
q
.
getSimulationState
()
==
state
]
and
q
.
getSimulationState
()
==
state
]
self
.
assertEqual
(
1
,
len
(
delivery_line_list
))
self
.
assertEqual
(
1
,
len
(
delivery_line_list
))
def
_checkComputerPartitionNoSalePackingList
(
self
,
resource
,
sequence
):
computer_partition
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'computer_partition_uid'
])
delivery_line_list
=
[
q
for
q
in
computer_partition
.
getAggregateRelatedValueList
(
portal_type
=
self
.
sale_packing_list_line_portal_type
)
if
q
.
getResource
()
==
resource
]
self
.
assertEqual
(
0
,
len
(
delivery_line_list
))
def
stepCheckComputerPartitionInstanceCleanupSalePackingListDoesNotExists
(
self
,
def
stepCheckComputerPartitionInstanceCleanupSalePackingListDoesNotExists
(
self
,
sequence
,
**
kw
):
sequence
,
**
kw
):
self
.
_checkComputerPartitionSalePackingListDoesNotExists
(
self
.
_checkComputerPartitionSalePackingListDoesNotExists
(
...
@@ -287,6 +296,12 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -287,6 +296,12 @@ class TestVifibSlapWebService(testVifibMixin):
self
.
portal
.
portal_preferences
.
getPreferredInstanceHostingResource
(),
self
.
portal
.
portal_preferences
.
getPreferredInstanceHostingResource
(),
sequence
)
sequence
)
def
stepCheckComputerPartitionNoInstanceHostingSalePackingList
(
self
,
sequence
,
**
kw
):
self
.
_checkComputerPartitionNoSalePackingList
(
self
.
portal
.
portal_preferences
.
getPreferredInstanceHostingResource
(),
sequence
)
def
stepCheckComputerPartitionAccoutingResourceSalePackingListCancelled
(
self
,
def
stepCheckComputerPartitionAccoutingResourceSalePackingListCancelled
(
self
,
sequence
,
**
kw
):
sequence
,
**
kw
):
self
.
_checkComputerPartitionSalePackingListState
(
'cancelled'
,
self
.
_checkComputerPartitionSalePackingListState
(
'cancelled'
,
...
@@ -1329,7 +1344,8 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1329,7 +1344,8 @@ class TestVifibSlapWebService(testVifibMixin):
partition_reference
=
sequence
.
get
(
'requested_reference'
,
partition_reference
=
sequence
.
get
(
'requested_reference'
,
'requested_reference'
),
'requested_reference'
),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}))
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}),
state
=
sequence
.
get
(
'instance_state'
))
sequence
.
edit
(
sequence
.
edit
(
requested_slap_computer_partition
=
requested_slap_computer_partition
,
requested_slap_computer_partition
=
requested_slap_computer_partition
,
...
@@ -1348,7 +1364,8 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1348,7 +1364,8 @@ class TestVifibSlapWebService(testVifibMixin):
partition_reference
=
sequence
.
get
(
'requested_reference'
,
partition_reference
=
sequence
.
get
(
'requested_reference'
,
'requested_reference'
),
'requested_reference'
),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}))
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}),
state
=
sequence
.
get
(
'instance_state'
))
def
stepRequestComputerPartitionNotFoundResponse
(
self
,
sequence
,
**
kw
):
def
stepRequestComputerPartitionNotFoundResponse
(
self
,
sequence
,
**
kw
):
self
.
slap
=
slap
.
slap
()
self
.
slap
=
slap
.
slap
()
...
@@ -1362,7 +1379,8 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -1362,7 +1379,8 @@ class TestVifibSlapWebService(testVifibMixin):
partition_reference
=
sequence
.
get
(
'requested_reference'
,
partition_reference
=
sequence
.
get
(
'requested_reference'
,
'requested_reference'
),
'requested_reference'
),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}))
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}),
state
=
sequence
.
get
(
'instance_state'
))
def
stepSetSoftwareInstanceChildrenA
(
self
,
sequence
,
**
kw
):
def
stepSetSoftwareInstanceChildrenA
(
self
,
sequence
,
**
kw
):
software_instance_uid
=
sequence
[
'root_software_instance_uid'
]
software_instance_uid
=
sequence
[
'root_software_instance_uid'
]
...
@@ -3636,6 +3654,73 @@ class TestVifibSlapWebService(testVifibMixin):
...
@@ -3636,6 +3654,73 @@ class TestVifibSlapWebService(testVifibMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
stepSetInstanceStateStopped
(
self
,
sequence
=
None
,
**
kw
):
sequence
[
'instance_state'
]
=
'stopped'
def
test_ComputerPartition_request_instantiate_state_stopped
(
self
):
"""
Check that after computer partition is requested it is possible to
instantiate it and it is started correctly.
"""
self
.
computer_partition_amount
=
2
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_install_requested_computer_partition_sequence_string
+
'
\
SetInstanceStateStopped
\
SlapLoginCurrentSoftwareInstance
\
RequestComputerPartitionNotReadyResponse
\
Tic
\
SlapLogout
\
\
SlapLoginCurrentSoftwareInstance
\
RequestComputerPartition
\
Tic
\
SlapLogout
\
\
LoginDefaultUser
\
CheckSoftwareInstanceAndRelatedComputerPartition
\
CheckRequestedSoftwareInstanceAndRelatedComputerPartition
\
Logout
\
\
SlapLoginCurrentSoftwareInstance
\
CheckRequestedComputerPartitionCleanParameterList
\
Logout
\
\
LoginDefaultUser
\
SetCurrentSoftwareInstanceRequested
\
SetSelectedComputerPartition
\
SelectCurrentlyUsedSalePackingListUid
\
Logout
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
Tic
\
SlapLogout
\
\
LoginDefaultUser
\
CheckComputerPartitionInstanceSetupSalePackingListStarted
\
Logout
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginDefaultUser
\
CheckComputerPartitionInstanceSetupSalePackingListStopped
\
Logout
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceStopped
\
Tic
\
SlapLogout
\
\
LoginDefaultUser
\
stepCheckComputerPartitionNoInstanceHostingSalePackingList
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
# XXX: This test fails because test_vifib_customer security is cached
# XXX: This test fails because test_vifib_customer security is cached
# and this user is not in SOFTINST-x group. We do not want to clear
# and this user is not in SOFTINST-x group. We do not want to clear
# cache in tests.
# cache in tests.
...
...
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