Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Eric Zheng
slapos
Commits
53271a5a
Commit
53271a5a
authored
Apr 07, 2020
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
117944de
37fc43c3
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
520 additions
and
38 deletions
+520
-38
component/apache/buildout.cfg
component/apache/buildout.cfg
+2
-2
component/glib/2a9ddc630341789c629c17c17565f5a7a7db8a8e.diff
component/glib/2a9ddc630341789c629c17c17565f5a7a7db8a8e.diff
+63
-0
component/glib/buildout.cfg
component/glib/buildout.cfg
+3
-0
component/libevent/buildout.cfg
component/libevent/buildout.cfg
+1
-1
component/mariadb/buildout.cfg
component/mariadb/buildout.cfg
+1
-0
component/screen/buildout.cfg
component/screen/buildout.cfg
+2
-2
slapos/recipe/generic_mysql/mysql.py
slapos/recipe/generic_mysql/mysql.py
+2
-1
software/erp5/software-shared.cfg
software/erp5/software-shared.cfg
+0
-5
software/erp5/test/setup.py
software/erp5/test/setup.py
+1
-0
software/erp5/test/test/test_mariadb.py
software/erp5/test/test/test_mariadb.py
+217
-0
software/slapos-master/test/test/test_erp5.py
software/slapos-master/test/test/test_erp5.py
+206
-4
software/slapos-sr-testing/software.cfg
software/slapos-sr-testing/software.cfg
+3
-0
software/wendelin/software.cfg
software/wendelin/software.cfg
+4
-10
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+1
-0
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+3
-3
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+2
-1
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+1
-0
stack/erp5/mariadb_initial_setup.sql.in
stack/erp5/mariadb_initial_setup.sql.in
+3
-6
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+1
-0
stack/lamp/buildout.hash.cfg
stack/lamp/buildout.hash.cfg
+1
-1
stack/lamp/instance.cfg.in
stack/lamp/instance.cfg.in
+1
-0
stack/slapos.cfg
stack/slapos.cfg
+2
-2
No files found.
component/apache/buildout.cfg
View file @
53271a5a
...
...
@@ -38,9 +38,9 @@ md5sum = 2202b18f269ad606d70e1864857ed93c
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = slapos.recipe.cmmi
shared = false
version = 2.4.4
1
version = 2.4.4
3
url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum =
dfc674f8f454e3bc2d4ccd73ad3b5f1e
md5sum =
791c986b1e70fe61eb44060aacc89a64
pre-configure =
cp -ar ${apr:location}/apr-${apr:version} srclib/apr/ &&
cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util
...
...
component/glib/2a9ddc630341789c629c17c17565f5a7a7db8a8e.diff
0 → 100644
View file @
53271a5a
In Ubuntu 19.10, we use GCC 9.2.1 and glib was failing to compile with
the following message:
CC libgio_2_0_la-gdbusauth.lo
gdbusauth.c: In function '_g_dbus_auth_run_server':
gdbusauth.c:1302:11: error: '%s' directive argument is null [-Werror=format-overflow=]
1302 | debug_print ("SERVER: WaitingForBegin, read '%s'", line);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
So we apply this MR:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/626
corresponding to this commit:
https://gitlab.gnome.org/GNOME/glib/-/commit/2a9ddc630341789c629c17c17565f5a7a7db8a8e
"gdbus: Avoid printing null strings"
This patch should then be removed when we upgrade glib version.
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index 1f8ea80570cf910a45f3c7f4bb678789145b5d33..752ec23fccaec4b67ec470a9f04c1f2ce99e9809 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -1272,9 +1272,9 @@
_g_dbus_auth_run_server (GDBusAuth *auth,
&line_length,
cancellable,
error);
- debug_print ("SERVER: WaitingForBegin, read '%s'", line);
if (line == NULL)
goto out;
+ debug_print ("SERVER: WaitingForBegin, read '%s'", line);
if (g_strcmp0 (line, "BEGIN") == 0)
{
/* YAY, done! */
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index 3221b925d3ef4eff0b063f5f56cc0629131faf42..3a1a1f9e9101a3773620403d2cb6faf6209a1b64 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -2731,7 +2731,6 @@
g_dbus_message_to_blob (GDBusMessage *message,
if (message->body != NULL)
{
gchar *tupled_signature_str;
- tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
if (signature == NULL)
{
g_set_error (error,
@@ -2739,10 +2738,10 @@
g_dbus_message_to_blob (GDBusMessage *message,
G_IO_ERROR_INVALID_ARGUMENT,
_("Message body has signature “%s” but there is no signature header"),
signature_str);
- g_free (tupled_signature_str);
goto out;
}
- else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
+ tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+ if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
{
g_set_error (error,
G_IO_ERROR,
component/glib/buildout.cfg
View file @
53271a5a
...
...
@@ -20,6 +20,9 @@ commands =
[glib]
recipe = slapos.recipe.cmmi
patches =
${:_profile_base_location_}/2a9ddc630341789c629c17c17565f5a7a7db8a8e.diff
patch-options = -p1
shared = true
url = https://ftp.gnome.org/pub/gnome/sources/glib/2.56/glib-2.56.4.tar.xz
md5sum = 17c3dca43d99a4882384f1a7b530b80b
...
...
component/libevent/buildout.cfg
View file @
53271a5a
...
...
@@ -16,4 +16,4 @@ url = https://github.com/libevent/libevent/releases/download/release-2.1.11-stab
md5sum = 7f35cfe69b82d879111ec0d7b7b1c531
environment =
CPPFLAGS=-I${openssl:location}/include
LDFLAGS=-L${openssl:location}/lib
\ No newline at end of file
LDFLAGS=-L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib
component/mariadb/buildout.cfg
View file @
53271a5a
...
...
@@ -104,6 +104,7 @@ configure-options =
--with-mysql-config=${mariadb:location}/bin/mysql_config
--disable-static
--disable-document
install-sql = @@LOCATION@@/share/mroonga/install.sql
patch-options = -p1
patches =
${:_profile_base_location_}/mroonga_boolean.patch#c818568fe35ca6a4298f18e575d962a0
...
...
component/screen/buildout.cfg
View file @
53271a5a
...
...
@@ -9,8 +9,8 @@ extends =
recipe = slapos.recipe.cmmi
shared = true
url = http://ftp.gnu.org/gnu/screen/screen-${:version}.tar.gz
version = 4.
5.1
md5sum =
a8c5da2f42f8a18fa4dada2419d1549b
version = 4.
8.0
md5sum =
d276213d3acd10339cd37848b8c4ab1e
environment =
CFLAGS=-I${ncurses:location}/include
LDFLAGS=-L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
...
...
slapos/recipe/generic_mysql/mysql.py
View file @
53271a5a
...
...
@@ -5,7 +5,7 @@ import sys
import
pytz
def
updateMysql
(
mysql_upgrade_binary
,
mysql_binary
,
mysql_script_file
):
sleep
=
3
0
sleep
=
0
with
open
(
mysql_script_file
)
as
script_file
:
mysql_script
=
script_file
.
read
()
mysql_list
=
mysql_binary
,
'-B'
...
...
@@ -43,6 +43,7 @@ def updateMysql(mysql_upgrade_binary, mysql_binary, mysql_script_file):
break
print
'SlapOS initialisation script succesfully applied on database.'
return
sleep
=
max
(
sleep
+
1
,
30
)
print
'Sleeping for %ss and retrying'
%
sleep
sys
.
stdout
.
flush
()
sys
.
stderr
.
flush
()
...
...
software/erp5/software-shared.cfg
deleted
100644 → 0
View file @
117944de
[buildout]
extends = software.cfg
shared-parts = /opt/slapgrid/shared-parts
eggs-directory = /opt/slapgrid/shared-eggs
abi-tag-eggs = true
software/erp5/test/setup.py
View file @
53271a5a
...
...
@@ -47,6 +47,7 @@ setup(name=name,
'erp5.util'
,
'psutil'
,
'requests'
,
'mysqlclient'
,
],
zip_safe
=
True
,
test_suite
=
'test'
,
...
...
software/erp5/test/test/test_mariadb.py
0 → 100644
View file @
53271a5a
##############################################################################
# coding: utf-8
#
# Copyright (c) 2018 Nexedi SA 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
os
import
json
import
glob
import
urlparse
import
socket
import
time
import
contextlib
import
datetime
import
MySQLdb
from
.
import
ERP5InstanceTestCase
from
.
import
setUpModule
setUpModule
# pyflakes
class
MariaDBTestCase
(
ERP5InstanceTestCase
):
"""Base test case for mariadb tests.
"""
__partition_reference__
=
'm'
# XXX mariadb_update service sleeps for 30 seconds before retrying,
# so this takes a lot of time to instance
instance_max_retry
=
60
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
"mariadb"
@
classmethod
def
_getInstanceParameterDict
(
cls
):
return
{
'tcpv4-port'
:
3306
,
'max-connection-count'
:
5
,
'max-slowqueries-threshold'
:
5
,
'slowest-query-threshold'
:
10
,
# XXX what is this ? should probably not be needed here
'name'
:
cls
.
__name__
,
'monitor-passwd'
:
'secret'
,
# XXX should probably not be needed here
'computer-memory-percent-threshold'
:
100
,
}
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
(
cls
.
_getInstanceParameterDict
())}
def
getDatabaseConnection
(
self
):
connection_parameter_dict
=
json
.
loads
(
self
.
computer_partition
.
getConnectionParameterDict
()[
'_'
])
db_url
=
urlparse
.
urlparse
(
connection_parameter_dict
[
'database-list'
][
0
])
self
.
assertEqual
(
'mysql'
,
db_url
.
scheme
)
self
.
assertTrue
(
db_url
.
path
.
startswith
(
'/'
))
database_name
=
db_url
.
path
[
1
:]
return
MySQLdb
.
connect
(
user
=
db_url
.
username
,
passwd
=
db_url
.
password
,
host
=
db_url
.
hostname
,
port
=
db_url
.
port
,
db
=
database_name
,
)
class
TestMariaDB
(
MariaDBTestCase
):
def
test_utf8_collation
(
self
):
cnx
=
self
.
getDatabaseConnection
()
with
contextlib
.
closing
(
cnx
):
cnx
.
query
(
"""
CREATE TABLE test_utf8_collation (
col1 CHAR(10)
)
"""
)
cnx
.
store_result
()
cnx
.
query
(
"""
insert into test_utf8_collation values ("à"), ("あ")
"""
)
cnx
.
store_result
()
cnx
.
query
(
"""
select * from test_utf8_collation where col1 = "a"
"""
)
self
.
assertEqual
(((
'à'
,),),
cnx
.
store_result
().
fetch_row
(
maxrows
=
2
))
class
TestMroonga
(
MariaDBTestCase
):
def
test_mroonga_plugin_loaded
(
self
):
cnx
=
self
.
getDatabaseConnection
()
with
contextlib
.
closing
(
cnx
):
cnx
.
query
(
"show plugins"
)
plugins
=
cnx
.
store_result
().
fetch_row
(
maxrows
=
1000
)
self
.
assertIn
(
(
'Mroonga'
,
'ACTIVE'
,
'STORAGE ENGINE'
,
'ha_mroonga.so'
,
'GPL'
),
plugins
)
def
test_mroonga_normalize_udf
(
self
):
# example from https://mroonga.org/docs/reference/udf/mroonga_normalize.html#usage
cnx
=
self
.
getDatabaseConnection
()
with
contextlib
.
closing
(
cnx
):
cnx
.
query
(
"""
SELECT mroonga_normalize("ABCDあぃうぇ㍑")
"""
)
self
.
assertEqual
(((
'abcdあぃうぇリットル'
,),),
cnx
.
store_result
().
fetch_row
(
maxrows
=
2
))
if
0
:
# this example fail with:
# OperationalError: (1123, "Can't initialize function 'mroonga_normalize'; mroonga_normalize(): nonexistent normalizer NormalizerMySQLUnicodeCIExceptKanaCI")
# same error on mroonga "official" docker images using mysql
# https://hub.docker.com/layers/groonga/mroonga/latest/images/sha256-e5a979801c95544ca3a1228d2c4d819820850e0162649553f2e94850e5e1c988?context=explore
# so it's probably OK to ignore
cnx
.
query
(
"""
SELECT mroonga_normalize("aBcDあぃウェ㍑", "NormalizerMySQLUnicodeCIExceptKanaCIKanaWithVoicedSoundMark")
"""
)
self
.
assertEqual
(((
'ABCDあぃうぇ㍑'
,),),
cnx
.
store_result
().
fetch_row
(
maxrows
=
2
))
def
test_mroonga_full_text_normalizer
(
self
):
# example from https://mroonga.org//docs/tutorial/storage.html#how-to-specify-the-normalizer
cnx
=
self
.
getDatabaseConnection
()
with
contextlib
.
closing
(
cnx
):
cnx
.
query
(
"SET NAMES utf8"
)
cnx
.
store_result
()
cnx
.
query
(
"""
CREATE TABLE diaries (
day DATE PRIMARY KEY,
content VARCHAR(64) NOT NULL,
FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto"'
) Engine=Mroonga DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
"""
)
cnx
.
store_result
()
cnx
.
query
(
"""INSERT INTO diaries VALUES ("2013-04-23", "ブラックコーヒーを飲んだ。")"""
)
cnx
.
store_result
()
cnx
.
query
(
"""
SELECT *
FROM diaries
WHERE MATCH (content) AGAINST ("+ふらつく" IN BOOLEAN MODE)
"""
)
self
.
assertEqual
((),
cnx
.
store_result
().
fetch_row
(
maxrows
=
2
))
cnx
.
query
(
"""
SELECT *
FROM diaries
WHERE MATCH (content) AGAINST ("+ブラック" IN BOOLEAN MODE)
"""
)
self
.
assertEqual
(
((
datetime
.
date
(
2013
,
4
,
23
),
'ブラックコーヒーを飲んだ。'
),),
cnx
.
store_result
().
fetch_row
(
maxrows
=
2
),
)
def
test_mroonga_full_text_stem
(
self
):
# example from https://mroonga.org//docs/tutorial/storage.html#how-to-specify-the-token-filters
cnx
=
self
.
getDatabaseConnection
()
with
contextlib
.
closing
(
cnx
):
cnx
.
query
(
"SELECT mroonga_command('register token_filters/stem')"
)
self
.
assertEqual
(((
'true'
,),),
cnx
.
store_result
().
fetch_row
(
maxrows
=
2
))
cnx
.
query
(
"""
CREATE TABLE memos (
id INT NOT NULL PRIMARY KEY,
content TEXT NOT NULL,
FULLTEXT INDEX (content) COMMENT 'normalizer "NormalizerAuto", token_filters "TokenFilterStem"'
) Engine=Mroonga DEFAULT CHARSET=utf8
"""
)
cnx
.
store_result
()
cnx
.
query
(
"""INSERT INTO memos VALUES (1, "I develop Groonga"), (2, "I'm developing Groonga"), (3, "I developed Groonga")"""
)
cnx
.
store_result
()
cnx
.
query
(
"""
SELECT *
FROM memos
WHERE MATCH (content) AGAINST ("+develops" IN BOOLEAN MODE)
"""
)
self
.
assertEqual
([
(
1
,
"I develop Groonga"
),
(
2
,
"I'm developing Groonga"
),
(
3
,
"I developed Groonga"
),
],
list
(
sorted
(
cnx
.
store_result
().
fetch_row
(
maxrows
=
4
))))
software/slapos-master/test/test/test_erp5.py
View file @
53271a5a
...
...
@@ -47,11 +47,12 @@ class TestPublishedURLIsReachableMixin(object):
# What happens is that instanciation just create the services, but does not
# wait for ERP5 to be initialized. When this test run ERP5 instance is
# instanciated, but zope is still busy creating the site and haproxy replies
# with 503 Service Unavailable.
# with 503 Service Unavailable, sometimes the first request is 404, so we
# retry in a loop.
# If we can move the "create site" in slapos node instance, then this retry loop
# would not be necessary.
for
i
in
range
(
1
,
60
):
r
=
requests
.
get
(
url
,
verify
=
False
)
# XXX can we get CA from caucase already ?
r
=
requests
.
get
(
url
,
verify
=
False
)
# XXX can we get CA from caucase already ?
if
r
.
status_code
in
(
requests
.
codes
.
service_unavailable
,
requests
.
codes
.
not_found
):
delay
=
i
*
2
...
...
@@ -85,6 +86,102 @@ class TestDefaultParameters(ERP5InstanceTestCase, TestPublishedURLIsReachableMix
__partition_reference__
=
'defp'
class
TestMedusa
(
ERP5InstanceTestCase
,
TestPublishedURLIsReachableMixin
):
"""Test ERP5 Medusa server
"""
__partition_reference__
=
'medusa'
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'wsgi'
:
False
})}
class
TestApacheBalancerPorts
(
ERP5InstanceTestCase
):
"""Instanciate with two zope families, this should create for each family:
- a balancer entry point with corresponding haproxy
- a balancer entry point for test runner
"""
__partition_reference__
=
'ap'
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
"zope-partition-dict"
:
{
"family1"
:
{
"instance-count"
:
3
,
"family"
:
"family1"
},
"family2"
:
{
"instance-count"
:
5
,
"family"
:
"family2"
},
},
})
}
def
checkValidHTTPSURL
(
self
,
url
):
parsed
=
urlparse
.
urlparse
(
url
)
self
.
assertEqual
(
parsed
.
scheme
,
'https'
)
self
.
assertTrue
(
parsed
.
hostname
)
self
.
assertTrue
(
parsed
.
port
)
def
test_published_family_parameters
(
self
):
# when we request two families, we have two published family-{family_name} URLs
param_dict
=
self
.
getRootPartitionConnectionParameterDict
()
for
family_name
in
(
'family1'
,
'family2'
):
self
.
checkValidHTTPSURL
(
param_dict
[
'family-{family_name}'
.
format
(
family_name
=
family_name
)])
self
.
checkValidHTTPSURL
(
param_dict
[
'family-{family_name}-v6'
.
format
(
family_name
=
family_name
)])
def
test_published_test_runner_url
(
self
):
# each family's also a list of test test runner URLs, by default 3 per family
param_dict
=
self
.
getRootPartitionConnectionParameterDict
()
for
family_name
in
(
'family1'
,
'family2'
):
family_test_runner_url_list
=
param_dict
[
'{family_name}-test-runner-url-list'
.
format
(
family_name
=
family_name
)]
self
.
assertEqual
(
3
,
len
(
family_test_runner_url_list
))
for
url
in
family_test_runner_url_list
:
self
.
checkValidHTTPSURL
(
url
)
def
test_zope_listen
(
self
):
# we requested 3 zope in family1 and 5 zopes in family2, we should have 8 zope running.
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
all_process_info
=
supervisor
.
getAllProcessInfo
()
self
.
assertEqual
(
3
+
5
,
len
([
p
for
p
in
all_process_info
if
p
[
'name'
].
startswith
(
'zope-'
)]))
def
test_apache_listen
(
self
):
# We have 2 families, apache should listen to a total of 3 ports per family
# normal access on ipv4 and ipv6 and test runner access on ipv4 only
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
all_process_info
=
supervisor
.
getAllProcessInfo
()
process_info
,
=
[
p
for
p
in
all_process_info
if
p
[
'name'
]
==
'apache'
]
apache_process
=
psutil
.
Process
(
process_info
[
'pid'
])
self
.
assertEqual
(
sorted
([
socket
.
AF_INET
]
*
4
+
[
socket
.
AF_INET6
]
*
2
),
sorted
([
c
.
family
for
c
in
apache_process
.
connections
()
if
c
.
status
==
'LISTEN'
]))
def
test_haproxy_listen
(
self
):
# There is one haproxy per family
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
all_process_info
=
supervisor
.
getAllProcessInfo
()
process_info
,
=
[
p
for
p
in
all_process_info
if
p
[
'name'
].
startswith
(
'haproxy-'
)
]
haproxy_process
=
psutil
.
Process
(
process_info
[
'pid'
])
self
.
assertEqual
([
socket
.
AF_INET
,
socket
.
AF_INET
],
[
c
.
family
for
c
in
haproxy_process
.
connections
()
if
c
.
status
==
'LISTEN'
])
class
TestDisableTestRunner
(
ERP5InstanceTestCase
,
TestPublishedURLIsReachableMixin
):
"""Test ERP5 can be instanciated without test runner.
"""
...
...
@@ -98,9 +195,114 @@ class TestDisableTestRunner(ERP5InstanceTestCase, TestPublishedURLIsReachableMix
"""
# self.computer_partition_root_path is the path of root partition.
# we want to assert that no scripts exist in any partition.
bin_programs
=
[
os
.
path
.
basename
(
path
)
for
path
in
glob
.
glob
(
"{}/../*/bin/*"
.
format
(
self
.
computer_partition_root_path
))]
bin_programs
=
map
(
os
.
path
.
basename
,
glob
.
glob
(
self
.
computer_partition_root_path
+
"/../*/bin/*"
))
self
.
assertTrue
(
bin_programs
)
# just to check the glob was correct.
self
.
assertNotIn
(
'runUnitTest'
,
bin_programs
)
self
.
assertNotIn
(
'runTestSuite'
,
bin_programs
)
def
test_no_apache_testrunner_port
(
self
):
# Apache only listen on two ports, there is no apache ports allocated for test runner
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
all_process_info
=
supervisor
.
getAllProcessInfo
()
process_info
,
=
[
p
for
p
in
all_process_info
if
p
[
'name'
]
==
'apache'
]
apache_process
=
psutil
.
Process
(
process_info
[
'pid'
])
self
.
assertEqual
(
sorted
([
socket
.
AF_INET
,
socket
.
AF_INET6
]),
sorted
(
c
.
family
for
c
in
apache_process
.
connections
()
if
c
.
status
==
'LISTEN'
))
class
TestZopeNodeParameterOverride
(
ERP5InstanceTestCase
,
TestPublishedURLIsReachableMixin
):
"""Test override zope node parameters
"""
__partition_reference__
=
'override'
@
classmethod
def
getInstanceParameterDict
(
cls
):
# The following example includes the most commonly used options,
# but not necessarily in a meaningful way.
return
{
'_'
:
json
.
dumps
({
"zodb"
:
[{
"type"
:
"zeo"
,
"server"
:
{},
"cache-size-bytes"
:
"20MB"
,
"cache-size-bytes!"
:
[
(
"bb-0"
,
1
<<
20
),
(
"bb-.*"
,
"500MB"
),
],
"pool-timeout"
:
"10m"
,
"storage-dict"
:
{
"cache-size!"
:
[
(
"a-.*"
,
"50MB"
),
],
},
}],
"zope-partition-dict"
:
{
"a"
:
{
"instance-count"
:
3
,
},
"bb"
:
{
"instance-count"
:
5
,
"port-base"
:
2300
,
},
},
})}
def
test_zope_conf
(
self
):
zeo_addr
=
json
.
loads
(
self
.
getComputerPartition
(
'zodb'
).
getConnectionParameter
(
'_'
)
)[
"storage-dict"
][
"root"
][
"server"
]
def
checkParameter
(
line
,
kw
):
k
,
v
=
line
.
split
()
self
.
assertFalse
(
k
.
endswith
(
'!'
),
k
)
try
:
expected
=
kw
.
pop
(
k
)
except
KeyError
:
if
k
==
'server'
:
return
self
.
assertIsNotNone
(
expected
)
self
.
assertEqual
(
str
(
expected
),
v
)
def
checkConf
(
zodb
,
storage
):
zodb
[
"mount-point"
]
=
"/"
zodb
[
"pool-size"
]
=
4
zodb
[
"pool-timeout"
]
=
"10m"
storage
[
"storage"
]
=
"root"
storage
[
"server"
]
=
zeo_addr
with
open
(
'%s/etc/zope-%s.conf'
%
(
partition
,
zope
))
as
f
:
conf
=
map
(
str
.
strip
,
f
.
readlines
())
i
=
conf
.
index
(
"<zodb_db root>"
)
+
1
conf
=
iter
(
conf
[
i
:
conf
.
index
(
"</zodb_db>"
,
i
)])
for
line
in
conf
:
if
line
==
'<zeoclient>'
:
for
line
in
conf
:
if
line
==
'</zeoclient>'
:
break
checkParameter
(
line
,
storage
)
for
k
,
v
in
storage
.
iteritems
():
self
.
assertIsNone
(
v
,
k
)
del
storage
else
:
checkParameter
(
line
,
zodb
)
for
k
,
v
in
zodb
.
iteritems
():
self
.
assertIsNone
(
v
,
k
)
partition
=
self
.
getComputerPartitionPath
(
'zope-a'
)
for
zope
in
xrange
(
3
):
checkConf
({
"cache-size-bytes"
:
"20MB"
,
},
{
"cache-size"
:
"50MB"
,
})
partition
=
self
.
getComputerPartitionPath
(
'zope-bb'
)
for
zope
in
xrange
(
5
):
checkConf
({
"cache-size-bytes"
:
"500MB"
if
zope
else
1
<<
20
,
},
{
"cache-size"
:
None
,
})
software/slapos-sr-testing/software.cfg
View file @
53271a5a
...
...
@@ -6,6 +6,7 @@ extends =
../../component/git/buildout.cfg
../../component/pillow/buildout.cfg
../../component/python-cryptography/buildout.cfg
../../component/python-mysqlclient/buildout.cfg
../../component/python-pynacl/buildout.cfg
../../component/quic_client-bin/buildout.cfg
../../component/python-backports-lzma/buildout.cfg
...
...
@@ -156,6 +157,7 @@ eggs =
erp5.util
${python-pynacl:egg}
${python-cryptography:egg}
${python-mysqlclient:egg}
${bcrypt:egg}
slapos.libnetworkcache
supervisor
...
...
@@ -282,3 +284,4 @@ mock = 2.0.0
testfixtures = 6.11
funcsigs = 1.0.2
PyPDF2 = 1.26.0
mysqlclient = 1.3.12
\ No newline at end of file
software/wendelin/software.cfg
View file @
53271a5a
...
...
@@ -15,8 +15,6 @@ parts +=
wendelin.core
jupyter
jupyter-notebook-initialized-scripts
wendelin_test_suite_runner
wendelin_testrunner
[eggs]
initialization =
...
...
@@ -43,21 +41,17 @@ initialization =
if rerun: os.environ['LD_PRELOAD'] = '''${gcc:location}/lib%s/libstdc++.so''' % arch
if rerun: os.execve(os.path.realpath(__file__), sys.argv, os.environ)
[wendelin_test_suite_runner]
<= test_suite_runner
[test_suite_runner]
# we need to override the test suite runner to add our custom libstdc++ dynamic
# library to the path
initialization =
initialization
+
=
${generic_testrunner_init:initialization}
${test_suite_runner:initialization}
[wendelin_testrunner]
<= testrunner
[testrunner]
# we need to override the test suite runner to add our custom libstdc++ dynamic
# library to the path
initialization =
initialization
+
=
${generic_testrunner_init:initialization}
${testrunner:initialization}
[erp5_repository_list]
repository_id_list += wendelin
...
...
stack/erp5/buildout.cfg
View file @
53271a5a
...
...
@@ -203,6 +203,7 @@ context =
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target
key mroonga_mariadb_install_sql mroonga-mariadb:install-sql
key matplotlibrc_location matplotlibrc:location
key parts_directory buildout:parts-directory
key openssl_location openssl:location
...
...
stack/erp5/buildout.hash.cfg
View file @
53271a5a
...
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum =
1c332e1a3388258572fcc6528aca5725
md5sum =
63bac9fc58537e55a6c8c42d0be54fbe
[template-kumofs]
filename = instance-kumofs.cfg.in
...
...
@@ -46,7 +46,7 @@ md5sum = 771bfd921aa5e59e1b4712ba113fa84b
[template-mariadb-initial-setup]
filename = mariadb_initial_setup.sql.in
md5sum =
dec33a617fa1b307c8ddb883efcfe3ce
md5sum =
1102c3e37a5a2e8aa2d8a2607ab633c8
[template-postfix]
filename = instance-postfix.cfg.in
...
...
@@ -70,7 +70,7 @@ md5sum = cc19560b9400cecbd23064d55c501eec
[template]
filename = instance.cfg.in
md5sum =
520b6bf3461dddc9c8b862e50b14465d
md5sum =
1a218a5676208dda092e6045f25bf77f
[monitor-template-dummy]
filename = dummy.cfg
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
53271a5a
...
...
@@ -160,6 +160,7 @@ context = section parameter_dict my-cnf-parameters
[init-script-parameters]
database-list = {{ dumps(database_list + test_database_list) }}
mroonga-mariadb-install-sql = {{ dumps(parameter_dict['mroonga-mariadb-install-sql']) }}
[init-script]
< = jinja2-template-executable
...
...
@@ -344,7 +345,7 @@ config-command = "{{ parameter_dict["check-computer-memory-binary"] }}" -db ${mo
<= monitor-promise-base
module = check_command_execute
name = mariadb.py
config-command = "
{{ parameter_dict['bin-directory'] }}/is-local-tcp-port-opened" "${my-cnf-parameters:ip}" "${my-cnf-parameters:port}"
config-command = "
${binary-wrap-mysql:wrapper-path}" --execute ';' {% if database_list and database_list[0].get('user') %} --host="${my-cnf-parameters:ip}" --port="${my-cnf-parameters:port}" --user="{{ database_list[0]['user'] }}" --password="{{ database_list[0]['password'] }}" {% endif %}
[monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
...
...
stack/erp5/instance.cfg.in
View file @
53271a5a
...
...
@@ -151,6 +151,7 @@ mariadb-start-clone-from-backup = {{ mariadb_start_clone_from_backup }}
promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-queries-digest-result
percona-tools-location = {{ percona_toolkit_location }}
unixodbc-location = {{ unixodbc_location }}
mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }}
[dynamic-template-mariadb]
<= jinja2-template-base
...
...
stack/erp5/mariadb_initial_setup.sql.in
View file @
53271a5a
USE mysql;
DROP FUNCTION IF EXISTS last_insert_grn_id;
DROP FUNCTION IF EXISTS mroonga_snippet;
DROP FUNCTION IF EXISTS mroonga_command;
{% set mroonga = parameter_dict.get('mroonga', 'ha_mroonga.so') -%}
{% if mroonga %}
CREATE FUNCTION last_insert_grn_id RETURNS INTEGER SONAME '{{ mroonga }}';
CREATE FUNCTION mroonga_snippet RETURNS STRING SONAME '{{ mroonga }}'
;
CREATE FUNCTION mroonga_command RETURNS STRING SONAME '{{ mroonga }}';
{% endif %}
{% if mroonga %}
SOURCE {{ parameter_dict['mroonga-mariadb-install-sql'] }}
;
{% endif %}
DROP FUNCTION IF EXISTS sphinx_snippets;
#CREATE FUNCTION sphinx_snippets RETURNS STRING SONAME 'ha_sphinx.so';
...
...
stack/lamp/buildout.cfg
View file @
53271a5a
...
...
@@ -103,6 +103,7 @@ context =
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target
key mroonga_mariadb_install_sql mroonga-mariadb:install-sql
key percona_toolkit_location percona-toolkit:location
key template_php_ini template-php.ini:output
key template_apache_conf template-apache.conf:output
...
...
stack/lamp/buildout.hash.cfg
View file @
53271a5a
...
...
@@ -14,7 +14,7 @@
# not need these here).
[instance]
filename = instance.cfg.in
md5sum =
b4fbd7dc8d7fda7dbd1b80f3de273ecf
md5sum =
92a93bb3b9f6663d967b0fb57244a1fa
[instance-apache-php]
filename = instance-apache-php.cfg.in
...
...
stack/lamp/instance.cfg.in
View file @
53271a5a
...
...
@@ -89,6 +89,7 @@ mariadb-start-clone-from-backup = {{ mariadb_start_clone_from_backup }}
promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-queries-digest-result
percona-tools-location = {{ percona_toolkit_location }}
unixodbc-location = {{ unixodbc_location }}
mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }}
check-computer-memory-binary = {{ bin_directory }}/check-computer-memory
bin-directory = {{ bin_directory }}
...
...
stack/slapos.cfg
View file @
53271a5a
...
...
@@ -102,7 +102,7 @@ eggs =
[versions]
setuptools = 44.0.0
# Use SlapOS patched zc.buildout
zc.buildout = 2.7.1+slapos00
1
zc.buildout = 2.7.1+slapos00
3
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 2.0.3+slapos003
# Use own version of h.r.download to be able to open .xz and .lz archives
...
...
@@ -138,7 +138,7 @@ pytz = 2016.10
requests = 2.13.0
six = 1.12.0
slapos.cookbook = 1.0.143
slapos.core = 1.5.
9
slapos.core = 1.5.
12
slapos.extension.strip = 0.4
slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.20
...
...
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