Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
880bf167
Commit
880bf167
authored
Aug 13, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: Add getting Slapos Master Url (for scalability)
parent
ba7a3d65
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+15
-0
erp5/util/taskdistribution/__init__.py
erp5/util/taskdistribution/__init__.py
+7
-0
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+10
-1
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+2
-2
No files found.
erp5/tests/testERP5TestNode.py
View file @
880bf167
...
...
@@ -494,6 +494,8 @@ revision = %(revision2)s
return
"key"
def
patch_getSlaposAccountCertificate
(
self
,
*
args
,
**
kw
):
return
"Certificate"
def
patch_getSlaposUrl
(
self
,
*
args
,
**
kw
):
return
"http://Foo"
def
patch_generateConfiguration
(
self
,
*
args
,
**
kw
):
return
json
.
dumps
({
"configuration_list"
:
[],
"involved_nodes_computer_guid"
\
:
[],
"error_message"
:
"No error."
,
"launcher_nodes_computer_guid"
:
[],
\
...
...
@@ -566,6 +568,7 @@ revision = %(revision2)s
if
my_test_type
==
"ScalabilityTest"
:
original_getSlaposAccountKey
=
TaskDistributor
.
getSlaposAccountKey
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_getSlaposUrl
=
TaskDistributor
.
getSlaposUrl
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_isMasterTestnode
=
TaskDistributor
.
isMasterTestnode
original_updateInstanceXML
=
RunnerClass
.
_updateInstanceXML
...
...
@@ -574,6 +577,7 @@ revision = %(revision2)s
original_SlapOSMasterCommunicator__init__
=
SlapOSMasterCommunicator
.
__init__
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
getSlaposUrl
=
patch_getSlaposUrl
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
patch_isMasterTestnode
RunnerClass
.
_updateInstanceXML
=
doNothing
...
...
@@ -605,6 +609,7 @@ revision = %(revision2)s
if
my_test_type
==
"ScalabilityTest"
:
TaskDistributor
.
getSlaposAccountKey
=
original_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
getSlaposUrl
=
original_getSlaposUrl
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
original_isMasterTestnode
RunnerClass
.
_updateInstanceXML
=
original_updateInstanceXML
...
...
@@ -665,6 +670,8 @@ revision = %(revision2)s
return
"key"
def
patch_getSlaposAccountCertificate
(
self
,
*
args
,
**
kw
):
return
"Certificate"
def
patch_getSlaposUrl
(
self
,
*
args
,
**
kw
):
return
"http://Foo"
def
patch_generateConfiguration
(
self
,
*
args
,
**
kw
):
return
json
.
dumps
({
"configuration_list"
:
[],
"involved_nodes_computer_guid"
\
:
[],
"error_message"
:
"No error."
,
"launcher_nodes_computer_guid"
:
[],
\
...
...
@@ -723,6 +730,7 @@ revision = %(revision2)s
if
my_test_type
==
"ScalabilityTest"
:
original_getSlaposAccountKey
=
TaskDistributor
.
getSlaposAccountKey
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_getSlaposUrl
=
TaskDistributor
.
getSlaposUrl
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_isMasterTestnode
=
TaskDistributor
.
isMasterTestnode
original_supply
=
SlapOSControler
.
supply
...
...
@@ -733,6 +741,7 @@ revision = %(revision2)s
original_SlapOSMasterCommunicator__init__
=
SlapOSMasterCommunicator
.
__init__
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
getSlaposUrl
=
patch_getSlaposUrl
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
patch_isMasterTestnode
SlapOSControler
.
supply
=
doNothing
...
...
@@ -764,6 +773,7 @@ revision = %(revision2)s
if
my_test_type
==
"ScalabilityTest"
:
TaskDistributor
.
getSlaposAccountKey
=
original_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
getSlaposUrl
=
original_getSlaposUrl
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
original_isMasterTestnode
SlapOSControler
.
supply
=
original_supply
...
...
@@ -944,6 +954,8 @@ revision = %(revision2)s
return
"key"
def
patch_getSlaposAccountCertificate
(
self
,
*
args
,
**
kw
):
return
"Certificate"
def
patch_getSlaposUrl
(
self
,
*
args
,
**
kw
):
return
"http://Foo"
def
patch_getTestType
(
self
,
*
args
,
**
kw
):
return
"ScalabilityTest"
def
patch_isHostingSubscriptionReady
(
self
,
*
args
,
**
kw
):
...
...
@@ -960,6 +972,7 @@ revision = %(revision2)s
original_sleep
=
time
.
sleep
original_getSlaposAccountKey
=
TaskDistributor
.
getSlaposAccountKey
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_getSlaposUrl
=
TaskDistributor
.
getSlaposUrl
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_isMasterTestnode
=
TaskDistributor
.
isMasterTestnode
original_startTestSuite
=
TaskDistributor
.
startTestSuite
...
...
@@ -979,6 +992,7 @@ revision = %(revision2)s
time
.
sleep
=
doNothing
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
getSlaposUrl
=
patch_getSlaposUrl
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
patch_isMasterTestnode
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
...
...
@@ -999,6 +1013,7 @@ revision = %(revision2)s
# Restore methods
TaskDistributor
.
getSlaposAccountKey
=
original_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
getSlaposUrl
=
original_getSlaposUrl
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
original_isMasterTestnode
TaskDistributor
.
startTestSuite
=
original_startTestSuite
...
...
erp5/util/taskdistribution/__init__.py
View file @
880bf167
...
...
@@ -570,6 +570,13 @@ class TaskDistributor(RPCRetry):
"""
return
self
.
_retryRPC
(
'getSlaposAccountCertificate'
)
def
getSlaposUrl
(
self
):
"""
Returns the url of slapos master related to the distributor
"""
return
self
.
_retryRPC
(
'getSlaposUrl'
)
class
DummyTaskDistributionTool
(
object
):
"""
Fake remote server.
...
...
erp5/util/testnode/ScalabilityTestRunner.py
View file @
880bf167
...
...
@@ -63,8 +63,17 @@ class ScalabilityTestRunner():
# Create the slapos account configuration file and dir
key
=
self
.
testnode
.
test_suite_portal
.
getSlaposAccountKey
()
certificate
=
self
.
testnode
.
test_suite_portal
.
getSlaposAccountCertificate
()
# Get Slapos Master Url
slapos_url
=
''
try
:
slapos_url
=
self
.
testnode
.
test_suite_portal
.
getSlaposUrl
()
if
not
slapos_url
:
slapos_url
=
self
.
testnode
.
config
[
'server_url'
]
except
:
slapos_url
=
self
.
testnode
.
config
[
'server_url'
]
self
.
key_path
,
self
.
cert_path
,
config_path
=
self
.
slapos_controler
.
createSlaposConfigurationFileAccount
(
key
,
certificate
,
self
.
testnode
.
config
)
key
,
certificate
,
s
lapos_url
,
s
elf
.
testnode
.
config
)
self
.
slapos_communicator
=
None
self
.
remaining_software_installation_dict
=
{}
...
...
erp5/util/testnode/SlapOSControler.py
View file @
880bf167
...
...
@@ -77,7 +77,7 @@ class SlapOSControler(object):
#TODO: implement a method to get all instance related the slapOS account
# and deleting all old instances (based on creation date or name etc...)
def
createSlaposConfigurationFileAccount
(
self
,
key
,
certificate
,
config
):
def
createSlaposConfigurationFileAccount
(
self
,
key
,
certificate
,
slapos_url
,
config
):
# Create "slapos_account" directory in the "slapos_directory"
slapos_account_directory
=
os
.
path
.
join
(
config
[
'slapos_directory'
],
"slapos_account"
)
createFolder
(
slapos_account_directory
)
...
...
@@ -87,7 +87,7 @@ class SlapOSControler(object):
configuration_file_path
=
os
.
path
.
join
(
slapos_account_directory
,
"slapos.cfg"
)
configuration_file_value
=
"[slapos]
\
n
master_url = %s
\
n
\
[slapconsole]
\
n
cert_file = %s
\
n
key_file = %s"
%
(
config
[
'server_url'
]
,
slapos_url
,
slapos_account_certificate_path
,
slapos_account_key_path
)
createFile
(
slapos_account_key_path
,
"w"
,
key
)
...
...
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