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
Carlos Ramos Carreño
slapos.core
Commits
3b4454e2
Commit
3b4454e2
authored
Nov 09, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checkpoint: allocation of instance on friend computer.
parent
fda45c50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
35 deletions
+59
-35
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSDefaultScenario.py
...slapos_erp5/TestTemplateItem/testSlapOSDefaultScenario.py
+58
-34
master/bt5/slapos_erp5/bt/revision
master/bt5/slapos_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSDefaultScenario.py
View file @
3b4454e2
...
...
@@ -200,6 +200,46 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
assertEqual
(
'SoftwareInstance'
,
software_instance
.
__class__
.
__name__
)
return
software_instance
def
checkInstanceAllocation
(
self
,
person_reference
,
instance_title
,
software_release
,
software_type
,
server
):
self
.
login
(
person_reference
)
self
.
personRequestInstanceNotReady
(
software_release
=
software_release
,
software_type
=
software_type
,
partition_reference
=
instance_title
,
)
self
.
stepCallSlaposAllocateInstanceAlarm
()
self
.
tic
()
self
.
personRequestInstance
(
software_release
=
software_release
,
software_type
=
software_type
,
partition_reference
=
instance_title
,
)
# now instantiate it on computer and set some nice connection dict
self
.
simulateSlapgridCP
(
server
)
# let's find instances of user and check connection strings
hosting_subscription_list
=
self
.
\
WebSection_getCurrentHostingSubscriptionList
()
self
.
assertEqual
(
1
,
len
(
hosting_subscription_list
))
hosting_subscription
=
hosting_subscription_list
[
0
].
getObject
()
software_instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
assertEqual
(
software_instance
.
getTitle
(),
hosting_subscription
.
getTitle
())
connection_dict
=
software_instance
.
getConnectionXmlAsDict
()
self
.
assertSameSet
((
'url_1'
,
'url_2'
),
connection_dict
.
keys
())
self
.
login
()
partition
=
software_instance
.
getAggregateValue
()
self
.
assertSameSet
(
[
'http://%s/'
%
q
.
getIpAddress
()
for
q
in
partition
.
contentValues
(
portal_type
=
'Internet Protocol Address'
)],
connection_dict
.
values
())
def
test
(
self
):
# some preparation
self
.
logout
()
...
...
@@ -248,49 +288,33 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
formatComputer
(
personal_server
)
self
.
formatComputer
(
friend_server
)
#
now join as the another visitor and request software instance
#
on public
computer
#
join as the another visitor and request software instance on public
# computer
self
.
logout
()
public_reference
=
'public-%s'
%
self
.
generateNewId
()
self
.
joinSlapOS
(
self
.
web_site
,
public_reference
)
self
.
login
(
public_reference
)
public_instance_title
=
'Public title %s'
%
self
.
generateNewId
()
self
.
personRequestInstanceNotReady
(
software_release
=
public_server_software
,
software_type
=
'public type'
,
partition_reference
=
public_instance_title
,
)
self
.
checkInstanceAllocation
(
public_reference
,
public_instance_title
,
public_server_software
,
'public type'
,
public_server
)
self
.
stepCallSlaposAllocateInstanceAlarm
()
self
.
tic
()
self
.
personRequestInstance
(
software_release
=
public_server_software
,
software_type
=
'public type'
,
partition_reference
=
public_instance_title
,
)
# join as owner friend and request a software instance on computer
# configured by owner
# now instantiate it on computer and set some nice connection dict
self
.
simulateSlapgridCP
(
public_server
)
self
.
logout
()
friend_reference
=
'friend-%s'
%
self
.
generateNewId
()
self
.
joinSlapOS
(
self
.
web_site
,
friend_reference
)
self
.
login
()
friend_email
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
reference
=
friend_reference
).
getDefaultEmailText
()
# let's find instances of user and check connection strings
hosting_subscription_list
=
self
.
\
WebSection_getCurrentHostingSubscriptionList
()
self
.
assertEqual
(
1
,
len
(
hosting_subscription_list
))
hosting_subscription
=
hosting_subscription_list
[
0
].
getObject
()
# allow friend to alloce on friendly computer
self
.
login
(
owner_reference
)
self
.
setServerOpenFriend
(
friend_server
,
[
friend_email
])
software_instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
assertEqual
(
software_instance
.
getTitle
(),
hosting_subscription
.
getTitle
())
connection_dict
=
software_instance
.
getConnectionXmlAsDict
()
self
.
assertSameSet
((
'url_1'
,
'url_2'
),
connection_dict
.
keys
())
self
.
login
()
partition
=
software_instance
.
getAggregateValue
()
self
.
assertSameSet
(
[
'http://%s/'
%
q
.
getIpAddress
()
for
q
in
partition
.
contentValues
(
portal_type
=
'Internet Protocol Address'
)],
connection_dict
.
values
())
friend_instance_title
=
'Friend title %s'
%
self
.
generateNewId
()
self
.
checkInstanceAllocation
(
friend_reference
,
friend_instance_title
,
friend_server_software
,
'friend_type'
,
friend_server
)
# remove the assertion after test is finished
self
.
assertTrue
(
False
,
'Test not finished'
)
master/bt5/slapos_erp5/bt/revision
View file @
3b4454e2
71
\ No newline at end of file
72
\ 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