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
Léo-Paul Géneau
slapos.core
Commits
87912a12
Commit
87912a12
authored
Nov 08, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checkpoint: servers with installed software.
parent
cedc1dc7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSDefaultScenario.py
...slapos_erp5/TestTemplateItem/testSlapOSDefaultScenario.py
+31
-5
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 @
87912a12
...
...
@@ -66,15 +66,31 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
welcome_message
=
findMessage
(
email
,
"de votre nouveau compte ERP5"
)
self
.
assertNotEqual
(
None
,
welcome_message
)
def
addServerViaSlapTool
(
self
,
title
):
def
requestComputer
(
self
,
title
):
requestXml
=
self
.
portal
.
portal_slap
.
requestComputer
(
title
)
self
.
tic
()
self
.
assertTrue
(
'marshal'
in
requestXml
)
computer
=
xml_marshaller
.
loads
(
requestXml
)
computer_id
=
getattr
(
computer
,
'_computer_id'
,
None
)
self
.
assertNotEqual
(
None
,
computer_id
)
self
.
tic
()
return
computer_id
def
supplySoftware
(
self
,
server
,
url
,
state
=
'available'
):
self
.
portal
.
portal_slap
.
supplySupply
(
url
,
server
.
getReference
(),
state
)
self
.
tic
()
software_installation
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Software Installation'
,
url_string
=
url
,
default_aggregate_uid
=
server
.
getUid
())
self
.
assertNotEqual
(
None
,
software_installation
)
if
state
==
'available'
:
self
.
assertEqual
(
'start_requested'
,
software_installation
.
getSlapState
())
else
:
self
.
assertEqual
(
'destroy_requested'
,
software_installation
.
getSlapState
())
@
changeSkin
(
'Hosting'
)
def
setServerOpenPublic
(
self
,
server
):
server
.
Computer_updateAllocationScope
(
...
...
@@ -112,25 +128,35 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
login
(
owner_reference
)
public_server_title
=
'Public Server for %s'
%
owner_reference
public_server_id
=
self
.
addServerViaSlapTool
(
public_server_title
)
public_server_id
=
self
.
requestComputer
(
public_server_title
)
public_server
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Computer'
,
reference
=
public_server_id
)
self
.
assertNotEqual
(
None
,
public_server
)
self
.
setServerOpenPublic
(
public_server
)
personal_server_title
=
'Personal Server for %s'
%
owner_reference
personal_server_id
=
self
.
addServerViaSlapTool
(
personal_server_title
)
personal_server_id
=
self
.
requestComputer
(
personal_server_title
)
personal_server
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Computer'
,
reference
=
personal_server_id
)
self
.
assertNotEqual
(
None
,
personal_server
)
self
.
setServerOpenPersonal
(
personal_server
)
friend_server_title
=
'Friend Server for %s'
%
owner_reference
friend_server_id
=
self
.
addServerViaSlapTool
(
friend_server_title
)
friend_server_id
=
self
.
requestComputer
(
friend_server_title
)
friend_server
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Computer'
,
reference
=
friend_server_id
)
self
.
assertNotEqual
(
None
,
friend_server
)
self
.
setServerOpenFriend
(
friend_server
)
# and install some software on them
public_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
supplySoftware
(
public_server
,
public_server_software
)
personal_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
supplySoftware
(
personal_server
,
personal_server_software
)
friend_server_software
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
supplySoftware
(
friend_server
,
friend_server_software
)
# remove the assertion after test is finished
self
.
assertTrue
(
False
,
'Test not finished'
)
master/bt5/slapos_erp5/bt/revision
View file @
87912a12
68
\ No newline at end of file
69
\ 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