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
Gabriel Monnerat
slapos.core
Commits
fcd9bd97
Commit
fcd9bd97
authored
Nov 08, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check bang on computer which shares trees with other.
parent
2f5fd160
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
231 additions
and
11 deletions
+231
-11
master/product/Vifib/tests/testVifibSlapAllocationScope.py
master/product/Vifib/tests/testVifibSlapAllocationScope.py
+0
-10
master/product/Vifib/tests/testVifibSlapBang.py
master/product/Vifib/tests/testVifibSlapBang.py
+221
-1
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+10
-0
No files found.
master/product/Vifib/tests/testVifibSlapAllocationScope.py
View file @
fcd9bd97
...
...
@@ -29,16 +29,6 @@ class TestVifibSlapAllocationScope(TestVifibSlapWebServiceMixin):
uid
=
sequence
[
'computer_uid'
])
self
.
assertEqual
(
computer
.
getAllocationScope
(),
'open/public'
)
def
stepCheckComputerTradeConditionDestinationSectionTestVifibCustomer
(
self
,
sequence
,
**
kw
):
computer
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'computer_uid'
])
trade_condition
=
computer
.
getAggregateRelatedValue
(
portal_type
=
'Sale Supply Line'
).
getParentValue
()
person_url
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
default_email_text
=
'test_customer@example.org'
).
getRelativeUrl
()
self
.
assertEqual
(
trade_condition
.
getDestinationSectionList
(),
[
person_url
])
def
stepCheckComputerTradeConditionDestinationSectionVifibAdminTestVifibCustomer
(
self
,
sequence
,
**
kw
):
computer
=
self
.
portal
.
portal_catalog
.
getResultValue
(
...
...
master/product/Vifib/tests/testVifibSlapBang.py
View file @
fcd9bd97
...
...
@@ -314,6 +314,113 @@ class TestVifibSlapBang(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
stepStoreComputerCoordinatesAsC1
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
computer_uid_c1
=
sequence
[
'computer_uid'
],
computer_reference_c1
=
sequence
[
'computer_reference'
],
)
def
stepRestoreComputerC1Coordinates
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
computer_uid
=
sequence
[
'computer_uid_c1'
],
computer_reference
=
sequence
[
'computer_reference_c1'
],
)
def
stepStoreComputerCoordinatesAsC0
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
computer_uid_c0
=
sequence
[
'computer_uid'
],
computer_reference_c0
=
sequence
[
'computer_reference'
],
)
def
stepFinishSoftwareInstanceSpannedTree
(
self
,
sequence
,
**
kw
):
self
.
stepLoginDefaultUser
()
rand
=
str
(
random
())
S1
=
'S1'
+
rand
S2
=
'S2'
+
rand
S3
=
'S3'
+
rand
root_software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'software_instance_uid'
])
common_kw
=
dict
(
software_release
=
sequence
[
'software_release_uri'
],
software_type
=
'any'
,
instance_xml
=
self
.
minimal_correct_xml
,
state
=
'stopped'
)
self
.
logout
()
self
.
login
(
sequence
[
'software_instance_reference'
])
root_software_instance
.
requestSoftwareInstance
(
partition_reference
=
S1
,
sla_xml
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="computer_guid">%s</parameter>
</instance>"""
%
sequence
[
'computer_reference_c1'
],
**
common_kw
)
self
.
stepTic
()
self
.
logout
()
self
.
stepLoginDefaultUser
()
S1_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Instance'
,
title
=
S1
)
S1_reference
=
S1_instance
.
getReference
()
self
.
logout
()
self
.
login
(
S1_reference
)
S1_instance
.
requestSoftwareInstance
(
partition_reference
=
S2
,
sla_xml
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="computer_guid">%s</parameter>
</instance>"""
%
sequence
[
'computer_reference_c0'
],
**
common_kw
)
self
.
stepTic
()
self
.
logout
()
self
.
stepLoginDefaultUser
()
S2_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Instance'
,
title
=
S2
)
S2_reference
=
S2_instance
.
getReference
()
self
.
logout
()
self
.
login
(
S2_reference
)
S2_instance
.
requestSoftwareInstance
(
partition_reference
=
S3
,
sla_xml
=
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="computer_guid">%s</parameter>
</instance>"""
%
sequence
[
'computer_reference_c1'
],
**
common_kw
)
self
.
stepTic
()
self
.
logout
()
self
.
stepLoginDefaultUser
()
S3_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Instance'
,
title
=
S3
)
S3_reference
=
S3_instance
.
getReference
()
self
.
logout
()
self
.
login
(
S1_reference
)
S1_instance
.
stopComputerPartitionInstallation
()
self
.
stepTic
()
self
.
logout
()
self
.
login
(
S2_reference
)
S2_instance
.
stopComputerPartitionInstallation
()
self
.
stepTic
()
self
.
logout
()
self
.
login
(
S3_reference
)
S3_instance
.
stopComputerPartitionInstallation
()
self
.
stepTic
()
self
.
logout
()
self
.
stepLoginDefaultUser
()
sequence
.
edit
(
S0_uid
=
sequence
[
'software_instance_uid'
],
S1_uid
=
S1_instance
.
getUid
(),
S2_uid
=
S2_instance
.
getUid
(),
S3_uid
=
S3_instance
.
getUid
(),
)
self
.
logout
()
def
test_computer_bang_tree_with_other_computer
(
self
):
"""Check that bang works on complex tree spanned on many computers
...
...
@@ -328,7 +435,120 @@ class TestVifibSlapBang(TestVifibSlapWebServiceMixin):
Where S0 and S2 are on C0 and S1 is on C1 and both are non public it shall
work.
"""
raise
NotImplementedError
self
.
computer_partition_amount
=
2
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_published_software_release
+
\
"""
# prepare first computer
LoginTestVifibCustomer
CustomerRegisterNewComputer
Tic
SetComputerCoordinatesFromComputerTitle
StoreComputerCoordinatesAsC1
ComputerSetAllocationScopeOpenPersonal
Tic
CheckComputerTradeConditionDestinationSectionTestVifibCustomer
Logout
SlapLoginCurrentComputer
FormatComputer
Tic
SlapLogout
LoginTestVifibCustomer
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
# prepare second computer
LoginTestVifibCustomer
CustomerRegisterNewComputer
Tic
SetComputerCoordinatesFromComputerTitle
StoreComputerCoordinatesAsC0
ComputerSetAllocationScopeOpenPersonal
Tic
CheckComputerTradeConditionDestinationSectionTestVifibCustomer
Logout
SlapLoginCurrentComputer
FormatComputer
Tic
SlapLogout
LoginTestVifibCustomer
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
# Request S0
LoginTestVifibCustomer
PersonRequestSoftwareInstance
Tic
Logout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SetSelectedComputerPartition
SelectCurrentlyUsedSalePackingListUid
Logout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListConfirmed
Logout
SlapLoginCurrentComputer
SoftwareInstanceBuilding
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListStarted
Logout
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
SlapLogout
LoginDefaultUser
SetSelectedComputerPartition
CheckComputerPartitionInstanceSetupSalePackingListStopped
CheckComputerPartitionInstanceHostingSalePackingListConfirmed
Logout
LoginTestVifibCustomer
RequestSoftwareInstanceStart
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceHostingSalePackingListConfirmed
Logout
SlapLoginCurrentComputer
SoftwareInstanceStarted
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceHostingSalePackingListStarted
Logout
FinishSoftwareInstanceSpannedTree
SlapLoginCurrentComputer
CheckEmptyComputerGetComputerPartitionCall
ComputerBang
Tic
SlapLogout
SlapLoginCurrentComputer
CheckSuccessComputerGetComputerPartitionCall
SlapLogout
RestoreComputerC1Coordinates
SlapLoginCurrentComputer
CheckSuccessComputerGetComputerPartitionCall
SlapLogout
"""
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_computer_bang_not_called_on_destroyed_ones
(
self
):
"""Check that bang is ignoring destroyed computer partitions"""
...
...
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
fcd9bd97
...
...
@@ -178,6 +178,16 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
########################################
# Steps -- scenarios
########################################
def
stepCheckComputerTradeConditionDestinationSectionTestVifibCustomer
(
self
,
sequence
,
**
kw
):
computer
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'computer_uid'
])
trade_condition
=
computer
.
getAggregateRelatedValue
(
portal_type
=
'Sale Supply Line'
).
getParentValue
()
person_url
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
default_email_text
=
'test_customer@example.org'
).
getRelativeUrl
()
self
.
assertEqual
(
trade_condition
.
getDestinationSectionList
(),
[
person_url
])
def
stepPersonRequestSlapSoftwareInstancePrepare
(
self
,
sequence
,
**
kw
):
software_release
=
sequence
[
'software_release_uri'
]
...
...
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