Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.toolbox
Commits
e2ed2d26
Commit
e2ed2d26
authored
Feb 18, 2015
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add erp5-cluster resiliency test.
parent
c15487ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
0 deletions
+102
-0
slapos/resiliencytest/suites/erp5cluster.py
slapos/resiliencytest/suites/erp5cluster.py
+102
-0
No files found.
slapos/resiliencytest/suites/erp5cluster.py
0 → 100644
View file @
e2ed2d26
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2014 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
json
import
urllib
import
time
from
.erp5
import
ERP5TestSuite
class
ERP5ClusterTestSuite
(
ERP5TestSuite
):
"""
Run ERP5 (erp5-cluster flavor) inside Slaprunner Resiliency Test.
Note: requires specific kernel allowing long shebang paths.
"""
def
_setERP5InstanceParameter
(
self
):
"""
Set inside of slaprunner the instance parameter to use to deploy erp5 instance.
"""
self
.
_connectToSlaprunner
(
resource
=
'saveParameterXml'
,
data
=
'software_type=create-erp5-site¶meter=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0A%3Cinstance%3E%0A%3Cparameter+id%3D%22_%22%3E%7B%22zodb-zeo%22%3A+%7B%22backup-periodicity%22%3A+%22hourly%22%7D%2C+%22mariadb%22%3A+%7B%22backup-periodicity%22%3A+%22hourly%22%7D%7D%3C%2Fparameter%3E%0A%3C%2Finstance%3E%0A'
)
def
_getERP5Url
(
self
):
"""
Return the backend url of erp5 instance.
Note: it is not connection parameter of slaprunner,
but connection parameter of what is inside of webrunner.
"""
data
=
self
.
_connectToSlaprunner
(
resource
=
'getConnectionParameter/slappart7'
)
url
=
json
.
loads
(
data
)[
'_'
][
'default'
]
self
.
logger
.
info
(
'Retrieved erp5 url is:
\
n
%s'
%
url
)
return
url
def
_editHAProxyconfiguration
(
self
):
"""
XXX pure hack.
haproxy processes don't support long path for sockets.
Edit haproxy configuration file of erp5 to make it compatible with long paths
Then restart haproxy.
"""
self
.
logger
.
info
(
'Editing HAProxy configuration...'
)
result
=
self
.
_connectToSlaprunner
(
resource
=
'/getFileContent'
,
data
=
'file=runner_workdir%2Finstance%2Fslappart7%2Fetc%2Fhaproxy.cfg'
)
file_content
=
json
.
loads
(
result
)[
'result'
]
file_content
=
file_content
.
replace
(
'var/run/haproxy.sock'
,
'ha.sock'
)
self
.
_connectToSlaprunner
(
resource
=
'/saveFileContent'
,
data
=
'file=runner_workdir%%2Finstance%%2Fslappart7%%2Fetc%%2Fhaproxy.cfg&content=%s'
%
urllib
.
quote
(
file_content
)
)
# Restart HAProxy
self
.
_connectToSlaprunner
(
resource
=
'/startStopProccess/name/slappart7:haproxy/cmd/STOPPED'
)
time
.
sleep
(
15
)
def
_gitClone
(
self
):
ERP5TestSuite
.
_gitClone
(
self
)
self
.
_connectToSlaprunner
(
resource
=
'/newBranch'
,
data
=
'project=workspace%2Fslapos&name=erp5-cluster&create=0'
)
def
runTestSuite
(
*
args
,
**
kwargs
):
"""
Run ERP5 erp5-cluster Resiliency Test.
"""
return
ERP5ClusterTestSuite
(
*
args
,
**
kwargs
).
runTestSuite
()
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