Commit 9732499c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Merge remote-tracking branch 'origin/zope4py2' into zope4py3

parents d0a13e24 3d644993
[buildout]
extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
parts =
brctl
[brctl]
recipe = slapos.recipe.cmmi
url = https://mirrors.edge.kernel.org/pub/linux/utils/net/bridge-utils/bridge-utils-1.7.1.tar.xz
md5sum = 3e1fee4dc22cac5457c2f6ffb990a518
environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:%(PATH)s
pre-configure =
aclocal &&
autoconf
From d3885eadb919abfcc86a82431deb9b9916127602 Mon Sep 17 00:00:00 2001
From: dieter <dieter@handshake.de>
Date: Wed, 2 Mar 2022 08:31:58 +0100
Subject: [PATCH] fix `OFS.Image.File.PUT` -- Issue 1015
work around `cgi` bug
make `flake8` happy
---
src/OFS/Image.py | 47 ++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 44 insertions(+), 3 deletions(-)
diff --git a/src/OFS/Image.py b/src/OFS/Image.py
index c7b012a5e..fde006deb 100644
--- a/src/OFS/Image.py
+++ b/src/OFS/Image.py
@@ -16,6 +16,8 @@
import struct
from email.generator import _make_boundary
from io import BytesIO
+from io import TextIOBase
+from tempfile import TemporaryFile
from warnings import warn
from six import PY2
@@ -568,6 +570,16 @@ class File(
self, REQUEST, manage_tabs_message=msg)
def _get_content_type(self, file, body, id, content_type=None):
+ """return content type or ``None``.
+
+ *file* usually is a ``FileUpload`` (like) instance; if this
+ specifies a content type, it is used. If *file*
+ is not ``FileUpload`` like, it is ignored and the
+ content type is guessed from the other parameters.
+
+ *body* is either a ``bytes`` or a ``Pdata`` instance
+ and assumed to be the *file* data.
+ """
headers = getattr(file, 'headers', None)
if headers and 'content-type' in headers:
content_type = headers['content-type']
@@ -579,6 +591,13 @@ class File(
return content_type
def _read_data(self, file):
+ """return the data and size of *file* as tuple *data*, *size*.
+
+ *file* can be a ``bytes``, ``Pdata``, ``FileUpload`` or
+ (binary) file like instance.
+
+ For large files, *data* is a ``Pdata``, otherwise a ``bytes`` instance.
+ """
import transaction
n = 1 << 16
@@ -656,13 +675,35 @@ class File(
"""Handle HTTP PUT requests"""
self.dav__init(REQUEST, RESPONSE)
self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
- type = REQUEST.get_header('content-type', None)
+ type = REQUEST.get_header('content-type', None)
file = REQUEST['BODYFILE']
+ # Work around ``cgi`` bug
+ # ``cgi`` can turn the request body into a text file using
+ # the default encoding. ``File``, however, insists to work
+ # with bytes and binary files and forbids text.
+ # Convert back.
+ tfile = None
+ if isinstance(file, TextIOBase): # ``cgi`` bug
+ if hasattr(file, "buffer"):
+ file = file.buffer # underlying binary buffer
+ else:
+ from ZPublisher.HTTPRequest import default_encoding
+ tfile = TemporaryFile("wb+")
+ bufsize = 1 << 16
+ while True:
+ data = file.read(bufsize)
+ if not data:
+ break
+ tfile.write(data.encode(default_encoding))
+ file.seek(0, 0)
+ tfile.seek(0, 0)
+ file = tfile
+
data, size = self._read_data(file)
- if isinstance(data, str):
- data = data.encode('UTF-8')
+ if tfile is not None:
+ tfile.close()
content_type = self._get_content_type(file, data, self.__name__,
type or self.content_type)
self.update_data(data, content_type, size)
--
2.35.1
......@@ -25,7 +25,7 @@ configure-options =
--disable-fam
--disable-xattr
--disable-man
--with-python=${buildout:executable}
--with-python=$PYTHON
environment =
PATH=${gettext:location}/bin:${patch:location}/bin:${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s
CPPFLAGS=-I${gettext:location}/include -I${zlib:location}/include
......@@ -34,3 +34,4 @@ environment =
LIBFFI_LIBS= -L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi
PCRE_CFLAGS=-I${pcre:location}/include
PCRE_LIBS=-L${pcre:location}/lib -Wl,-rpath=${pcre:location}/lib -lpcre
post-install = rm %(location)s/bin/gtester-report
......@@ -13,8 +13,8 @@ parts = haproxy
[haproxy]
recipe = slapos.recipe.cmmi
shared = true
url = http://www.haproxy.org/download/2.0/src/haproxy-2.0.25.tar.gz
md5sum = 44687c901910da46711441ae1611b8ce
url = http://www.haproxy.org/download/2.0/src/haproxy-2.0.29.tar.gz
md5sum = a4c4983c7ed51946bdde1d0eceedd527
configure-command = true
# for Linux kernel 2.6.28 and above, we use "linux-glibc" as the TARGET,
# otherwise use "generic".
......
[buildout]
extends =
../nftables/buildout.cfg
../util-linux/buildout.cfg
../pkgconfig/buildout.cfg
../openssl/buildout.cfg
../zlib/buildout.cfg
parts =
miniupnpd
[miniupnp-repository]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/miniupnp/miniupnp.git
revision = miniupnpd_2_3_0
git-executable = ${git:location}/bin/git
[miniupnpd]
recipe = slapos.recipe.cmmi
shared = true
path = ${miniupnp-repository:location}/miniupnpd
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${iptables:location}/lib/pkgconfig:${libuuid:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig
LDFLAGS=-L${libuuid:location}/lib -L${openssl:location}/lib -L${zlib:location}/lib
# because these configure not support prefix syntax
configure-command = ./configure
configure-options =
--firewall=iptables
make-options =
-f Makefile.linux
make-targets =
install PREFIX=%(location)s
......@@ -16,6 +16,9 @@ parts =
#<= nodejs-X.Y.Z
# nodejs 16 needs gcc > 8.3
[gcc]
min_version = 8.3
[nodejs-16.13.2]
<= nodejs-base
openssl_location = ${openssl:location}
......
......@@ -14,8 +14,8 @@ extends =
[postfix]
recipe = slapos.recipe.cmmi
shared = true
url = http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-3.7.2.tar.gz
md5sum = 92ff3863194004f7d8a0893421ba4248
url = http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-3.7.3.tar.gz
md5sum = bbb2168f85530fe4eaa65408a48e731b
location = @@LOCATION@@
patch-options = -p1
patches =
......
#!/usr/bin/env python
#!/usr/bin/env python3
r"""Command-line tool to format software release JSON for slapos.
Inspired by json.tool from python, but enforcing 2 spaces and non-sorted keys.
......
......@@ -15,7 +15,7 @@
[instance]
filename = instance.cfg.in
md5sum = fd556a0cb44610f0b0898b7126bd77b2
md5sum = db7fe97f4c6b84cfadb7b5c68eab517a
[template-instance-beremiz]
filename = instance-beremiz.cfg.jinja2.in
......@@ -23,7 +23,7 @@ md5sum = c92317d0d754f62d3259136d1a0df1ac
[template-instance-beremiz-test]
filename = instance-beremiz-test.cfg.jinja2.in
md5sum = ff7cf06927041f6aec5ad559950b69cb
md5sum = a2fa2b9d3a225a1dd71db67bd4fea769
[template-fluxbox-menu.in]
filename = fluxbox-menu.in
......
......@@ -21,6 +21,13 @@ environment =
XORG_LOCK_DIR=${xserver:lock-dir}
DISPLAY=${xserver:display}
[beremiz-env.sh]
# Add openssl needed to build matiec during tests
inline +=
#export OPENSSL_CRYPTO_LIBRARY={{ openssl_location }}/lib
#export OPENSSL_INCLUDE_DIR={{ openssl_location }}/include
export OPENSSL_ROOT_DIR={{ openssl_location }}
[runTestSuite]
env.sh = ${beremiz-env.sh:output}
workdir = {{ nxdtest_dir }}
......
......@@ -82,4 +82,5 @@ extra-context =
raw instance_nxdtest {{ nxdtest_template }}
raw xdotool_bin {{ xdotool_location }}/bin/xdotool
raw opencv_location {{ opencv_location }}
raw openssl_location {{ openssl_location }}
raw nxdtest_dir {{ buildout_directory }}
......@@ -54,6 +54,7 @@ configure-options =
-DUA_ENABLE_PUBSUB=ON
-DUA_ENABLE_SUBSCRIPTIONS=ON
-DUA_NAMESPACE_ZERO=REDUCED
-DUA_ENABLE_ENCRYPTION=OPENSSL
shared = false
post-install =
mkdir -p @@LOCATION@@/build/bin
......@@ -95,8 +96,8 @@ eggs +=
[beremiz]
recipe = slapos.recipe.build:download-unpacked
# download beremiz at revision c9b7db300a25806ccaa9d5a844d1e0fd281acb4b
url = https://github.com/beremiz/beremiz/archive/c9b7db300a25806ccaa9d5a844d1e0fd281acb4b.tar.gz
md5sum = ed28b53deaaa9a10e6160b10e9dad1a8
url = https://github.com/beremiz/beremiz/archive/5cd7885043d4801279842d0c0632a58986b878f1.tar.gz
md5sum = bd2647114749c3c3154f2f4bc4274adb
[beremiz-setup]
recipe = zc.recipe.egg:develop
......
......@@ -176,7 +176,7 @@ Instance Parameters
Master Instance Parameters
--------------------------
The parameters for instances are described at `instance-caddy-input-schema.json <instance-caddy-input-schema.json>`_.
The parameters for instances are described at `instance-input-schema.json <instance-input-schema.json>`_.
Here some additional informations about the parameters listed, below:
......@@ -202,7 +202,7 @@ Optional parameter, defaults to 8080.
Slave Instance Parameters
-------------------------
The parameters for instances are described at `instance-slave-caddy-input-schema.json <instance-slave-caddy-input-schema.json>`_.
The parameters for instances are described at `instance-slave-input-schema.json <instance-slave-input-schema.json>`_.
Here some additional informations about the parameters listed, below:
......@@ -457,9 +457,9 @@ Instantiating caddy-frontend results with a cluster in various partitions:
* master (the controlling one)
* kedifa (contains kedifa server)
* caddy-frontend-N which contains the running processes to serve sites - this partition can be replicated by ``-frontend-quantity`` parameter
* frontend-node-N which contains the running processes to serve sites - this partition can be replicated by ``-frontend-quantity`` parameter
It means sites are served in ``caddy-frontend-N`` partition, and this partition is structured as:
It means sites are served in ``frontend-node-N`` partition, and this partition is structured as:
* Caddy serving the browser [client-facing-caddy]
* (optional) Apache Traffic Server for caching [ats]
......@@ -481,11 +481,11 @@ Kedifa implementation
`Kedifa <https://lab.nexedi.com/nexedi/kedifa>`_ server runs on kedifa partition.
Each `caddy-frontend-N` partition downloads certificates from the kedifa server.
Each `frontend-node-N` partition downloads certificates from the kedifa server.
Caucase (exposed by ``kedifa-caucase-url`` in master partition parameters) is used to handle certificates for authentication to kedifa server.
If ``automatic-internal-kedifa-caucase-csr`` is enabled (by default it is) there are scripts running on master partition to simulate human to sign certificates for each caddy-frontend-N node.
If ``automatic-internal-kedifa-caucase-csr`` is enabled (by default it is) there are scripts running on master partition to simulate human to sign certificates for each frontend-node-N node.
Support for X-Real-Ip and X-Forwarded-For
-----------------------------------------
......
......@@ -14,31 +14,31 @@
# not need these here).
[template]
filename = instance.cfg.in
md5sum = f1f04e7f27bc6e40a655dd4badb2a8af
md5sum = d408adbd12d4161c22fe9c29118fd83e
[profile-common]
filename = instance-common.cfg.in
md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-caddy-frontend]
filename = instance-apache-frontend.cfg.in
md5sum = 75db32dd9b17c923b16420784dfba581
[profile-frontend]
filename = instance-frontend.cfg.in
md5sum = 0ec59d2fb5617e82d1848c1170772d84
[profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in
md5sum = e7209d9c66fd30e1fa950d2d07957b95
[profile-master]
filename = instance-master.cfg.in
md5sum = 2c599c22f6ab9bf2bbc48da8a12ae6e0
[profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum = 421e2de58c0d5c41a00cd5d32355fc70
filename = instance-slave-list.cfg.in
md5sum = 5be5a32d5cf22e10967e59570dda2d36
[profile-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
[profile-master-publish-slave-information]
filename = instance-master-publish-slave-information.cfg.in
md5sum = b3422f3624054f57b78d0e50a0de399a
[profile-caddy-frontend-configuration]
[template-caddy-frontend-configuration]
_update_hash_filename_ = templates/Caddyfile.in
md5sum = cb627dfce9ab7bc23fd98818d55876b7
md5sum = 9600df12af5787227825ddffd715b9cf
[template-not-found-html]
_update_hash_filename_ = templates/notfound.html
......@@ -72,13 +72,13 @@ md5sum = d022455a8610bac2dd51101edb035987
_update_hash_filename_ = templates/trafficserver/logging.yaml.jinja2
md5sum = 368b271215a92594ca9e2fa3102d484f
[template-caddy-lazy-script-call]
_update_hash_filename_ = templates/apache-lazy-script-call.sh.in
[template-lazy-script-call]
_update_hash_filename_ = templates/lazy-script-call.sh.in
md5sum = 77d60840591de67b64ab3572e46273a0
[template-graceful-script]
_update_hash_filename_ = templates/graceful-script.sh.in
md5sum = 061cc244558fd3af2b6bacf17cae5555
md5sum = 905e395b67c0a2b214b9f0099c8dc939
[template-validate-script]
_update_hash_filename_ = templates/validate-script.sh.in
......@@ -92,13 +92,13 @@ md5sum = 4d2537d2698d32a7e909989f8778d144
_update_hash_filename_ = templates/rotate-script.sh.in
md5sum = 8c150e1e6c993708d31936742f3a7302
[caddyprofiledeps-setup]
[software-setup]
filename = setup.py
md5sum = f6f72d03af7d9dc29fb4d4fef1062e73
md5sum = 04bc664aa0159acaafec49a6bc36e84b
[caddyprofiledeps-dummy]
filename = caddyprofiledummy.py
md5sum = 1c866272ec0ea0c161f0c0d80cb6e584
[software-py]
filename = software.py
md5sum = e82ccdb0b26552a1c88ff523d8fae24a
[profile-kedifa]
filename = instance-kedifa.cfg.in
......@@ -106,7 +106,7 @@ md5sum = 40fe46a1fe653406b18ca46351d195b8
[template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
md5sum = 3336d554661b138dcef97b1d1866803c
md5sum = ba91b7778c3d730353d42d7804ef8050
[template-slave-introspection-httpd-nginx]
_update_hash_filename_ = templates/slave-introspection-httpd-nginx.conf.in
......
......@@ -10,8 +10,8 @@ parts =
directory
logrotate-entry-caddy
caddy-frontend
caddyprofiledeps
switch-caddy-softwaretype
software-py
switch-frontend-softwaretype
caucase-updater
caucase-updater-promise
backend-client-caucase-updater
......@@ -60,8 +60,8 @@ parts =
logrotate-entry-slave-introspection
backend-haproxy-statistic-frontend-promise
[caddyprofiledeps]
recipe = caddyprofiledeps
[software-py]
recipe = software
[frontend-node-id]
# Store id file in top of hierarchy, so it does not depend on directory creation
......@@ -166,7 +166,7 @@ expose-csr-var = ${:var}/expose-csr
# slave introspection
slave-introspection-var = ${:var}/slave-introspection
[switch-caddy-softwaretype]
[switch-frontend-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-custom-personal-profile-slave-list:output
RootSoftwareInstance = ${:default}
......@@ -347,9 +347,9 @@ stop-on-error = True
[dynamic-custom-personal-profile-slave-list]
< = jinja2-template-base
depends = ${caddyprofiledeps:recipe}
depends = ${software-py:recipe}
url = {{ software_parameter_dict['profile_slave_list'] }}
filename = custom-personal-instance-slave-list.cfg
filename = instance-slave-list.cfg
master_key_download_url = {{ dumps(slapparameter_dict['master-key-download-url']) }}
software_type = single-custom-personal
organization = {{ slapparameter_dict['cluster-identification'] }}
......@@ -415,7 +415,6 @@ extra-context =
key not_found_file caddy-configuration:not-found-file
key username monitor-instance-parameter:username
key password monitor-htpasswd:passwd
key global_disable_http2 configuration:global-disable-http2
# BBB: SlapOS Master non-zero knowledge BEGIN
key apache_certificate apache-certificate:output
# BBB: SlapOS Master non-zero knowledge END
......@@ -430,7 +429,7 @@ inline =
-conf ${dynamic-caddy-frontend-template:output} \
-log ${caddy-configuration:error-log} \
-log-roll-mb 0 \
{% if instance_parameter_dict['configuration.global-disable-http2'].lower() in TRUE_VALUES %}-http2=false \{% else %}-http2=true \{% endif %}
-http2=true \
-grace {{ instance_parameter_dict['configuration.mpm-graceful-shutdown-timeout'] }}s \
-disable-http-challenge \
-disable-tls-alpn-challenge \
......@@ -689,7 +688,7 @@ output = ${directory:etc-run}/frontend-caddy-safe-graceful
extra-context =
key graceful_reload_command caddy-configuration:frontend-graceful-command
key caddy_configuration_state frontend-caddy-configuration-state-graceful:output
key configuration_state frontend-caddy-configuration-state-graceful:output
[frontend-caddy-validate]
< = jinja2-template-base
......@@ -704,7 +703,7 @@ extra-context =
[frontend-caddy-lazy-graceful]
< = jinja2-template-base
url = {{ software_parameter_dict['template_caddy_lazy_script_call'] }}
url = {{ software_parameter_dict['template_lazy_script_call'] }}
output = ${directory:bin}/frontend-caddy-lazy-graceful
pid-file = ${directory:run}/lazy-graceful.pid
wait_time = 60
......@@ -802,7 +801,7 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[backend-haproxy-rsyslogd-lazy-graceful]
< = jinja2-template-base
url = {{ software_parameter_dict['template_caddy_lazy_script_call'] }}
url = {{ software_parameter_dict['template_lazy_script_call'] }}
output = ${directory:bin}/backend-haproxy-rsyslogd-lazy-graceful
pid-file = ${directory:run}/backend-haproxy-rsyslogd-lazy-graceful.pid
wait_time = 60
......@@ -852,7 +851,7 @@ output = ${directory:etc-run}/backend-haproxy-safe-graceful
extra-context =
key graceful_reload_command backend-haproxy-configuration:graceful-command
key caddy_configuration_state backend-haproxy-configuration-state-graceful:output
key configuration_state backend-haproxy-configuration-state-graceful:output
[backend-haproxy-validate]
<= jinja2-template-base
......@@ -887,7 +886,7 @@ log-file = ${directory:log}/backend-haproxy.log
pid-file = ${directory:run}/backend-haproxy-rsyslogd.pid
spool-directory = ${directory:backend-haproxy-rsyslogd-spool}
graceful-command = kill -HUP $(cat ${:pid-file})
caddy-log-directory = ${caddy-directory:slave-log}
log-directory = ${caddy-directory:slave-log}
[backend-haproxy-rsyslogd-configuration]
<= jinja2-template-base
......@@ -1021,7 +1020,7 @@ output = ${directory:etc-run}/slave-introspection-safe-graceful
extra-context =
key graceful_reload_command caddy-configuration:slave-introspection-graceful-command
key caddy_configuration_state slave-introspection-configuration-state-graceful:output
key configuration_state slave-introspection-configuration-state-graceful:output
[slave-introspection-validate]
<= jinja2-template-base
......
......@@ -34,16 +34,6 @@
"title": "Enable HTTP2 by Default",
"type": "string"
},
"global-disable-http2": {
"default": "false",
"description": "Disables globally HTTP2 in Caddy, thus enable-http2-by-default here and enable-http2 have no effect. Rational is that in some loaded environments it is better to run Caddy without any HTTP2 capabilities. Warning: Changing the parameter will result in restarting Caddy process.",
"enum": [
"true",
"false"
],
"title": "Globally disable HTTP2",
"type": "string"
},
"mpm-graceful-shutdown-timeout": {
"default": 5,
"description": "Value passed to -grace parameter of Caddy, see https://caddyserver.com/docs/cli .",
......
{% set aibcc_enabled = True %}
{% import "caucase" as caucase with context %}
{#- DANGER! DANGER! #}
{#- Avoid touching the NAME_BASE, as it will result with backward incompatible cluster setup #}
{%- set NAME_BASE = 'caddy-frontend' %}
{#- DANGER! DANGER! #}
{%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
{%- set GOOD_CIPHER_LIST = ['ECDHE-ECDSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-GCM-SHA384', 'ECDHE-ECDSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES128-GCM-SHA256', 'ECDHE-ECDSA-WITH-CHACHA20-POLY1305', 'ECDHE-RSA-WITH-CHACHA20-POLY1305', 'ECDHE-RSA-AES256-CBC-SHA', 'ECDHE-RSA-AES128-CBC-SHA', 'ECDHE-ECDSA-AES256-CBC-SHA', 'ECDHE-ECDSA-AES128-CBC-SHA', 'RSA-AES256-CBC-SHA', 'RSA-AES128-CBC-SHA', 'ECDHE-RSA-3DES-EDE-CBC-SHA', 'RSA-3DES-EDE-CBC-SHA'] %}
{#- Allow to pass only some parameters to frontend nodes #}
......@@ -10,7 +14,6 @@
'apache-key',
'domain',
'enable-http2-by-default',
'global-disable-http2',
'mpm-graceful-shutdown-timeout',
're6st-verification-url',
'backend-connect-timeout',
......@@ -107,11 +110,10 @@ context =
{% set frontend_list = [] %}
{% set frontend_section_list = [] %}
{% set request_dict = {} %}
{% set namebase = 'caddy-frontend' %}
# XXX Dirty hack, not possible to define default value before
{% set sla_computer_caddy_1_key = '-sla-1-computer_guid' %}
{% if not sla_computer_caddy_1_key in slapparameter_dict %}
{% do slapparameter_dict.__setitem__(sla_computer_caddy_1_key, '${slap-connection:computer-id}') %}
{% set sla_computer_1_key = '-sla-1-computer_guid' %}
{% if not sla_computer_1_key in slapparameter_dict %}
{% do slapparameter_dict.__setitem__(sla_computer_1_key, '${slap-connection:computer-id}') %}
{% endif %}
{% set sla_computer_kedifa_key = '-sla-kedifa-computer_guid' %}
{% if not sla_computer_kedifa_key in slapparameter_dict %}
......@@ -121,7 +123,7 @@ context =
# Here we request individually each frontend.
# The presence of sla parameters is checked and added if found
{% for i in range(1, frontend_quantity + 1) %}
{% set frontend_name = "%s-%s" % (namebase, i) %}
{% set frontend_name = "%s-%s" % (NAME_BASE, i) %}
{% set request_section_title = 'request-%s' % frontend_name %}
{% set sla_key = "-sla-%s-" % i %}
{% set sla_key_length = sla_key | length %}
......@@ -268,7 +270,7 @@ context =
{% for url_key in ['url-netloc-list', 'https-url-netloc-list', 'health-check-failover-url-netloc-list'] %}
{% if url_key in slave %}
{% for netloc in slave[url_key].split() %}
{% if not caddyprofiledummy.validate_netloc(netloc) %}
{% if not software.validate_netloc(netloc) %}
{% do slave_error_list.append('slave %s %r invalid' % (url_key, netloc)) %}
{% endif %}
{% endfor %}
......@@ -424,40 +426,40 @@ warning-list = {{ dumps(json_module.dumps(warning_list, sort_keys=True)) }}
warning-slave-dict = {{ dumps(json_module.dumps(warning_slave_dict, sort_keys=True)) }}
{% endif %}
{% if not aikc_enabled or not aibcc_enabled %}
{% for frontend in frontend_list %}
{% for index, frontend in enumerate(frontend_list) %}
{% set section_part = '${request-' + frontend %}
{{ frontend }}-csr-certificate = {{ section_part }}:connection-csr-certificate}
frontend-node-{{ index + 1 }}-csr-certificate = {{ section_part }}:connection-csr-certificate}
{% endfor %}
{% endif %}
{% if not aikc_enabled %}
kedifa-csr-url = ${request-kedifa:connection-kedifa-csr-url}
kedifa-csr-certificate = ${request-kedifa:connection-csr-certificate}
{% for frontend in frontend_list %}
{% for index, frontend in enumerate(frontend_list) %}
{% set section_part = '${request-' + frontend %}
{{ frontend }}-kedifa-csr-url = {{ section_part }}:connection-kedifa-csr-url}
frontend-node-{{ index + 1 }}-kedifa-csr-url = {{ section_part }}:connection-kedifa-csr-url}
{% endfor %}
{% endif %}
{% for frontend in frontend_list %}
{% for index, frontend in enumerate(frontend_list) %}
{% set section_part = '${request-' + frontend %}
{{ frontend }}-backend-haproxy-statistic-url = {{ section_part }}:connection-backend-haproxy-statistic-url}
{{ frontend }}-node-information-json = ${frontend-information:{{ frontend }}-node-information-json}
frontend-node-{{ index + 1 }}-backend-haproxy-statistic-url = {{ section_part }}:connection-backend-haproxy-statistic-url}
frontend-node-{{ index + 1 }}-node-information-json = ${frontend-information:frontend-node-{{ index + 1 }}-node-information-json}
{% endfor %}
{% if not aibcc_enabled %}
{% for frontend in frontend_list %}
{% for index, frontend in enumerate(frontend_list) %}
{% set section_part = '${request-' + frontend %}
{{ frontend }}-backend-client-csr-url = {{ section_part }}:connection-backend-client-csr-url}
frontend-node-{{ index + 1 }}-backend-client-csr-url = {{ section_part }}:connection-backend-client-csr-url}
{% endfor %}
{% endif %}
# Generate promises for requested nodes
{% for frontend in frontend_list %}
{% for index, frontend in enumerate(frontend_list) %}
{% set part_name = 'promise-backend-haproxy-statistic-url-' + frontend %}
{% do part_list.append(part_name) %}
{% set section_part = '${request-' + frontend %}
[{{ part_name }}]
<= monitor-promise-base
promise = check_url_available
name = check-backend-haproxy-statistic-url-{{ frontend }}.py
name = check-backend-haproxy-statistic-url-frontend-node-{{ index + 1 }}.py
config-url =
{{ section_part }}:connection-backend-haproxy-statistic-url}
{% endfor %}
......@@ -467,11 +469,11 @@ config-url =
#-- Publish slave information
[publish-slave-information]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-publish-slave-information:output
default = instance-publish-slave-information:output
RootSoftwareInstance = ${:default}
replicate = dynamic-publish-slave-information:output
custom-personal = dynamic-publish-slave-information:output
custom-group = dynamic-publish-slave-information:output
replicate = instance-publish-slave-information:output
custom-personal = instance-publish-slave-information:output
custom-group = instance-publish-slave-information:output
[request-kedifa]
<= slap-connection
......@@ -527,15 +529,15 @@ warning-slave-dict = {{ dumps(warning_slave_dict) }}
active-slave-instance-list = {{ json_module.dumps(active_slave_instance_list, sort_keys=True) }}
[frontend-information]
{% for frontend in frontend_list %}
{% for index, frontend in enumerate(frontend_list) %}
{% set section_part = '${request-' + frontend %}
{{ frontend }}-node-information-json = {{ section_part }}:connection-node-information-json}
frontend-node-{{ index + 1 }}-node-information-json = {{ section_part }}:connection-node-information-json}
{% endfor %}
[dynamic-publish-slave-information]
[instance-publish-slave-information]
< = jinja2-template-base
url = {{ software_parameter_dict['profile_replicate_publish_slave_information'] }}
filename = dynamic-publish-slave-information.cfg
url = {{ software_parameter_dict['profile_master_publish_slave_information'] }}
filename = instance-publish-slave-information.cfg
extensions = jinja2.ext.do
extra-context =
section slave_information slave-information
......
......@@ -58,15 +58,15 @@
"description": "Url to caucase used by KeDiFa.",
"type": "string"
},
"caddy-frontend-N-kedifa-csr-url": {
"frontend-node-N-kedifa-csr-url": {
"description": "URL on which frontend node number N publishes its Kedifa CSR sent to caucase.",
"type": "string"
},
"caddy-frontend-N-backend-client-csr-url": {
"frontend-node-N-backend-client-csr-url": {
"description": "URL on which frontend node number N publishes its Backend Client CSR sent to caucase.",
"type": "string"
},
"caddy-frontend-N-csr-certificate": {
"frontend-node-N-csr-certificate": {
"description": "Certificate used to serve data on CSRs.",
"type": "string"
},
......
{
"$schema": "http://json-schema.org/draft-04/schema",
"properties": {
"url": {
"description": "Url of the backend",
"pattern": "^(http|https|ftp)://",
"title": "Backend URL",
"type": "string"
},
"type": {
"default": "",
"description": "Type of slave. If redirect, the slave will redirect to the given url. If zope, the rewrite rules will be compatible with Virtual Host Monster.",
"enum": [
"",
"zope"
],
"title": "Backend Type",
"type": "string"
},
"custom_domain": {
"description": "Custom Domain to use for the website",
"pattern": "^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$",
"title": "Custom Domain",
"type": "string"
},
"server-alias": {
"default": "",
"description": "Server Alias List separated by space",
"title": "Server Alias",
"type": "string"
},
"default-path": {
"default": "",
"description": "Provide default path to redirect user to when user access / (the site root)",
"title": "type:zope Default Path",
"type": "string"
},
"disable-no-cache-request": {
"default": "false",
"description": "If set to true, Cache-Control and Pragma requests headers will not be sent to cache and backend servers. This prevents clients from bypassing cache when enable_cache is true",
"enum": [
"false",
"true"
],
"title": "enable_cache: Disable 'no-cache' requests",
"type": "string"
},
"disable-via-header": {
"default": "false",
"description": "If set to true, Via response headers will not be sent to client",
"enum": [
"false",
"true"
],
"title": "enable_cache: Disable 'Via' headers from cache",
"type": "string"
},
"disabled-cookie-list": {
"default": "",
"description": "List of Cookies separated by space that will not be sent to cache and backend servers. This is especially useful to discard analytics tracking cookies when using Vary: Cookie cache headers",
"title": "Disabled Cookies",
"type": "string"
},
"enable_cache": {
"default": "false",
"description": "If set to true, http caching server (Apache Traffic Server) will be used between frontend Caddy and backend",
"enum": [
"false",
"true"
],
"title": "Enable Cache",
"type": "string"
},
"https-only": {
"default": "true",
"description": "If set to true, http requests will be redirected to https",
"enum": [
"false",
"true"
],
"title": "HTTPS Only",
"type": "string"
},
"path": {
"default": "",
"description": "Path to proxy to in the backend",
"title": "type:zope Backend Path",
"type": "string"
},
"prefer-gzip-encoding-to-backend": {
"default": "false",
"description": "If set to true, frontend will rewrite Accept-Encoding request header to simply 'gzip' for all variants of Accept-Encoding containing 'gzip', in order to maximize cache hits for resources cached with Vary: Accept-Encoding when enable_cache is used",
"enum": [
"false",
"true"
],
"title": "Prefer gzip Encoding for Backend",
"type": "string"
}
},
"title": "Input Parameters",
"type": "object"
}
......@@ -41,7 +41,7 @@ context =
{#- Prepare configuration parameters #}
{%- set DEFAULT_PORT = {'http': 80, 'https': 443, '': None} %}
{%- for key in ['enable-http2-by-default', 'global-disable-http2'] %}
{%- for key in ['enable-http2-by-default'] %}
{%- do configuration.__setitem__(key, ('' ~ configuration[key]).lower() in TRUE_VALUES) %}
{%- endfor %}
{#- Loop thought slave list to set up slaves #}
......@@ -102,7 +102,7 @@ context =
{%- if slave_type == 'redirect' %}
{%- do slave_instance.__setitem__('backend-http-url', slave_instance.get('url', '').rstrip('/')) %}
{%- if slave_instance.get('https-url') %}
{%- do slave_instance.__setitem__('backend-https-url', slave_instance.get['https-url'].rstrip('/')) %}
{%- do slave_instance.__setitem__('backend-https-url', slave_instance.get('https-url', '').rstrip('/')) %}
{%- endif %}
{%- elif enable_cache %}
{%- if 'domain' in slave_instance %}
......@@ -218,7 +218,7 @@ context =
{%- endif %}
{%- endfor %}
{%- do slave_instance.__setitem__('websocket-path-list', websocket_path_list) %}
{%- do slave_instance.__setitem__('enable_h2', not configuration['global-disable-http2'] and slave_instance['enable-http2']) %}
{%- do slave_instance.__setitem__('enable_h2', slave_instance['enable-http2']) %}
{%- if slave_instance['type'] in ['notebook', 'websocket'] %}
{# websocket style needs http 1.1 max #}
{%- do slave_instance.__setitem__('enable_h2', False) %}
......
......@@ -2,11 +2,11 @@
extends = {{ software_parameter_dict['profile_common'] }}
parts =
caddyprofiledeps
software-py
switch-softwaretype
[caddyprofiledeps]
recipe = caddyprofiledeps
[software-py]
recipe = software
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
......@@ -25,12 +25,12 @@ import-list =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-profile-caddy-replicate:output
default = dynamic-profile-master:output
RootSoftwareInstance = ${:default}
custom-personal = dynamic-profile-caddy-replicate:output
single-default = dynamic-profile-caddy-frontend:output
single-custom-personal = dynamic-profile-caddy-frontend:output
replicate = dynamic-profile-caddy-replicate:output
custom-personal = dynamic-profile-master:output
single-default = dynamic-profile-frontend:output
single-custom-personal = dynamic-profile-frontend:output
replicate = dynamic-profile-master:output
kedifa = dynamic-profile-kedifa:output
[software-parameter-section]
......@@ -38,25 +38,25 @@ kedifa = dynamic-profile-kedifa:output
{{ key }} = {{ dumps(value) }}
{% endfor -%}
[dynamic-profile-caddy-frontend]
[dynamic-profile-frontend]
< = jinja2-template-base
url = {{ software_parameter_dict['profile_caddy_frontend'] }}
filename = instance-caddy-frontend.cfg
url = {{ software_parameter_dict['profile_frontend'] }}
filename = instance-frontend.cfg
extra-context =
import furl_module furl
raw software_type single-custom-personal
[dynamic-profile-caddy-replicate]
[dynamic-profile-master]
< = jinja2-template-base
depends = ${caddyprofiledeps:recipe}
url = {{ software_parameter_dict['profile_caddy_replicate'] }}
filename = instance-caddy-replicate.cfg
depends = ${software-py:recipe}
url = {{ software_parameter_dict['profile_master'] }}
filename = instance-master.cfg
extra-context =
import subprocess_module subprocess
import functools_module functools
import operator_module operator
import validators validators
import caddyprofiledummy caddyprofiledummy
import software software
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type RootSoftwareInstance-default-custom-personal-replicate
......@@ -96,7 +96,6 @@ configuration.disk-cache-size = 8G
configuration.ram-cache-size = 1G
configuration.re6st-verification-url = http://[2001:67c:1254:4::1]/index.html
configuration.enable-http2-by-default = true
configuration.global-disable-http2 = false
configuration.ciphers =
configuration.request-timeout = 600
configuration.mpm-graceful-shutdown-timeout = 5
......
# The caddyprofiledeps egg allows to set dependecies of the Caddy profiles
# which are enabled during the instance run, thanks to using caddyprofiledeps
# recipe
# * sets additional dependencies for the instance processing
# * provides instance's importable specific code
from setuptools import setup
setup(
name='caddyprofiledeps',
name='software',
install_requires=[
'validators',
'furl',
......@@ -14,11 +13,11 @@ setup(
],
entry_points={
'zc.buildout': [
'default = caddyprofiledummy:Recipe',
'default = software:Recipe',
],
'console_scripts': [
'smart-caucase-signer = caddyprofiledummy:smart_sign',
'caucase-csr-sign-check = caddyprofiledummy:caucase_csr_sign_check'
'smart-caucase-signer = software:smart_sign',
'caucase-csr-sign-check = software:caucase_csr_sign_check'
]
}
)
......@@ -19,7 +19,7 @@ extends =
parts +=
caucase-eggs
template
caddyprofiledeps
software-install
kedifa
[kedifa]
......@@ -28,15 +28,15 @@ eggs =
${python-cryptography:egg}
kedifa
[caddyprofiledeps-setup]
[software-setup]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/setup.py
[caddyprofiledeps-dummy]
[software-py]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/caddyprofiledummy.py
url = ${:_profile_base_location_}/software.py
[caddyprofiledeps-prepare]
[software-prepare]
recipe = plone.recipe.command
stop-on-error = True
location = ${buildout:parts-directory}/${:_buildout_section_name_}
......@@ -44,18 +44,18 @@ update-command = ${:command}
command =
rm -fr ${:location} &&
mkdir -p ${:location} &&
cp ${caddyprofiledeps-setup:target} ${:location}/ &&
cp ${caddyprofiledeps-dummy:target} ${:location}/
cp ${software-setup:target} ${:location}/ &&
cp ${software-py:target} ${:location}/
[caddyprofiledeps-develop]
[software-develop]
recipe = zc.recipe.egg:develop
setup = ${caddyprofiledeps-prepare:location}
setup = ${software-prepare:location}
[caddyprofiledeps]
depends = ${caddyprofiledeps-develop:recipe}
[software-install]
depends = ${software-develop:recipe}
recipe = zc.recipe.egg
eggs =
caddyprofiledeps
software
websockify
[profile-common]
......@@ -71,21 +71,21 @@ context =
caucase_jinja2_library = ${caucase-jinja2-library:target}
# profiles
profile_caddy_frontend = ${profile-caddy-frontend:target}
profile_caddy_replicate = ${profile-caddy-replicate:target}
profile_frontend = ${profile-frontend:target}
profile_master = ${profile-master:target}
profile_common = ${profile-common:output}
profile_kedifa = ${profile-kedifa:target}
profile_logrotate_base = ${template-logrotate-base:output}
profile_monitor = ${monitor-template:output}
profile_monitor2 = ${monitor2-template:output}
profile_replicate_publish_slave_information = ${profile-replicate-publish-slave-information:target}
profile_master_publish_slave_information = ${profile-master-publish-slave-information:target}
profile_slave_list = ${profile-slave-list:target}
# templates
template_backend_haproxy_configuration = ${template-backend-haproxy-configuration:target}
template_backend_haproxy_rsyslogd_conf = ${template-backend-haproxy-rsyslogd-conf:target}
template_caddy_frontend_configuration = ${profile-caddy-frontend-configuration:target}
template_caddy_lazy_script_call = ${template-caddy-lazy-script-call:target}
template_caddy_frontend_configuration = ${template-caddy-frontend-configuration:target}
template_lazy_script_call = ${template-lazy-script-call:target}
template_configuration_state_script = ${template-configuration-state-script:target}
template_default_slave_virtualhost = ${template-default-slave-virtualhost:target}
template_empty = ${template-empty:target}
......@@ -133,29 +133,30 @@ output = ${buildout:directory}/template.cfg
context =
section software_parameter_dict software-parameter-section
[profile-caddy-frontend]
[download-profile]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-apache-frontend.cfg.in
url = ${:_profile_base_location_}/${:filename}
[profile-caddy-replicate]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-apache-replicate.cfg.in
[profile-frontend]
<= download-profile
[profile-master]
<= download-profile
[profile-kedifa]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-kedifa.cfg.in
<= download-profile
[profile-slave-list]
<= download-profile
[profile-master-publish-slave-information]
<= download-profile
[download-template]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
[profile-slave-list]
<=download-template
[profile-replicate-publish-slave-information]
<=download-template
[profile-caddy-frontend-configuration]
[template-caddy-frontend-configuration]
<=download-template
[template-not-found-html]
......@@ -190,7 +191,7 @@ output = ${buildout:directory}/template-wrapper.cfg
[template-rotate-script]
<=download-template
[template-caddy-lazy-script-call]
[template-lazy-script-call]
<=download-template
[template-graceful-script]
......
......@@ -6,15 +6,15 @@
"custom-personal": {
"description": "",
"index": 2,
"request": "instance-caddy-input-schema.json",
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"title": "Custom Personal"
},
"custom-personal-slave": {
"description": "Custom Personal",
"index": 1,
"request": "instance-slave-caddy-input-schema.json",
"response": "instance-output-schema.json",
"request": "instance-slave-input-schema.json",
"response": "instance-slave-output-schema.json",
"shared": true,
"software-type": "custom-personal",
"title": "Custom Personal (Slave)"
......@@ -22,7 +22,7 @@
"default": {
"description": "Default",
"index": 3,
"request": "instance-caddy-input-schema.json",
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"software-type": "default",
"title": "Default"
......@@ -30,20 +30,11 @@
"default-slave": {
"description": "Default",
"index": 4,
"request": "instance-slave-caddy-input-schema.json",
"response": "instance-output-schema.json",
"request": "instance-slave-input-schema.json",
"response": "instance-slave-output-schema.json",
"shared": true,
"software-type": "default",
"title": "Default (slave)"
},
"default-simplified-slave": {
"description": "Default",
"index": 5,
"request": "instance-slave-caddy-simplified-input-schema.json",
"response": "instance-output-schema.json",
"shared": true,
"software-type": "default",
"title": "Default Basic (slave)"
}
}
}
import caucase.client
import caucase.utils
import os
import ssl
import sys
import urllib.request, urllib.parse, urllib.error
import urllib.error
import urllib.parse
import urllib.request
from cryptography import x509
from cryptography.hazmat.primitives import serialization
class Recipe(object):
def __init__(self, *args, **kwargs):
pass
......@@ -21,10 +20,11 @@ class Recipe(object):
def update(self):
return self.install()
def validate_netloc(netloc):
# a bit crazy way to validate that the passed parameter is haproxy
# compatible server netloc
parsed = urllib.parse.urlparse('scheme://'+netloc)
parsed = urllib.parse.urlparse('scheme://' + netloc)
if ':' in parsed.hostname:
hostname = '[%s]' % parsed.hostname
else:
......
# Main caddy configuration file
import {{ slave_configuration_directory }}/*.conf
:{{ https_port }} {
tls {{ master_certificate }} {{ master_certificate }} {
{%- if global_disable_http2 %}
# Disallow HTTP2
alpn http/1.1
{%- else %}
# Allow http2
alpn h2 http/1.1
{%- endif %}
}
bind {{ local_ipv4 }}
......@@ -39,13 +32,8 @@ import {{ slave_configuration_directory }}/*.conf
# Access to server-status Caddy-style
https://[{{ global_ipv6 }}]:{{ https_port }}/server-status, https://{{ local_ipv4 }}:{{ https_port }}/server-status {
tls {{ frontend_configuration['ip-access-certificate'] }} {{ frontend_configuration['ip-access-certificate'] }} {
{%- if global_disable_http2 %}
# Disallow HTTP2
alpn http/1.1
{%- else %}
# Allow http2
alpn h2 http/1.1
{%- endif %}
}
bind {{ local_ipv4 }}
basicauth "{{ username }}" {{ password | trim }} {
......
......@@ -19,7 +19,7 @@ $WorkDirectory {{ configuration['spool-directory'] }}
{%- set regex = ".*-backend (.*)-http.{0,1}(|-failover)/" %}
template(name="extract_slave_name" type="string" string="%msg:R,ERE,1,FIELD:{{ regex }}--end%")
set $!slave_name = exec_template("extract_slave_name");
template(name="slave_output" type="string" string="{{ configuration['caddy-log-directory'] }}/%$!slave_name%_backend_log")
template(name="slave_output" type="string" string="{{ configuration['log-directory'] }}/%$!slave_name%_backend_log")
if (re_match($msg, "{{ regex }}")) then {
action(type="omfile" dynaFile="slave_output")
stop
......
......@@ -2,7 +2,7 @@
set -e
if {{ caddy_configuration_state }} ; then
if {{ configuration_state }} ; then
echo "Reloading.."
{{ graceful_reload_command }}
else
......
......@@ -1037,10 +1037,10 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
return generate_auth_url, upload_url
def assertNodeInformationWithPop(self, parameter_dict):
key = 'caddy-frontend-1-node-information-json'
key = 'frontend-node-1-node-information-json'
node_information_json_dict = {}
for k in list(parameter_dict.keys()):
if k.startswith('caddy-frontend') and k.endswith(
if k.startswith('frontend-node') and k.endswith(
'node-information-json'):
node_information_json_dict[k] = parameter_dict.pop(k)
self.assertEqual(
......@@ -1054,10 +1054,10 @@ class HttpFrontendTestCase(SlapOSInstanceTestCase):
self.node_information_dict = node_information_dict
def assertBackendHaproxyStatisticUrl(self, parameter_dict):
url_key = 'caddy-frontend-1-backend-haproxy-statistic-url'
url_key = 'frontend-node-1-backend-haproxy-statistic-url'
backend_haproxy_statistic_url_dict = {}
for key in list(parameter_dict.keys()):
if key.startswith('caddy-frontend') and key.endswith(
if key.startswith('frontend-node') and key.endswith(
'backend-haproxy-statistic-url'):
backend_haproxy_statistic_url_dict[key] = parameter_dict.pop(key)
self.assertEqual(
......@@ -1562,11 +1562,11 @@ class TestMasterAIKCDisabledAIBCCDisabledRequest(
self.assertRejectedSlavePromiseEmptyWithPop(parameter_dict)
self.assertKeyWithPop('kedifa-csr-certificate', parameter_dict)
self.assertKeyWithPop('kedifa-csr-url', parameter_dict)
self.assertKeyWithPop('caddy-frontend-1-kedifa-csr-url', parameter_dict)
self.assertKeyWithPop('frontend-node-1-kedifa-csr-url', parameter_dict)
self.assertKeyWithPop(
'caddy-frontend-1-backend-client-csr-url', parameter_dict)
'frontend-node-1-backend-client-csr-url', parameter_dict)
self.assertKeyWithPop(
'caddy-frontend-1-csr-certificate', parameter_dict)
'frontend-node-1-csr-certificate', parameter_dict)
self.assertNodeInformationWithPop(parameter_dict)
self.assertEqual(
{
......@@ -1797,7 +1797,9 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
},
'type-redirect': {
'url': cls.backend_url,
'https-url': cls.backend_https_url,
'type': 'redirect',
'https-only': False,
},
'type-redirect-custom_domain': {
'url': cls.backend_url,
......@@ -2100,7 +2102,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
}
expected_node_information['version-hash-history']['testhash'] = 'testurl'
self.assertEqual(
json.loads(parameter_dict['caddy-frontend-1-node-information-json']),
json.loads(parameter_dict['frontend-node-1-node-information-json']),
expected_node_information
)
......@@ -2179,7 +2181,7 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
def test_server_polluted_keys_removed(self):
buildout_file = os.path.join(
self.getMasterPartitionPath(), 'instance-caddy-replicate.cfg')
self.getMasterPartitionPath(), 'instance-master.cfg')
with open(buildout_file) as fh:
for line in [
q for q in fh.readlines()
......@@ -2757,11 +2759,6 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertEqualResultJson(result, 'Path', '/test-path')
@skip('Feature postponed')
def test_check_error_log(self):
# Caddy: Need to implement similar thing like check-error-on-apache-log
raise NotImplementedError(self.id())
def test_ssl_ca_crt(self):
parameter_dict = self.assertSlaveBase(
'custom_domain_ssl_crt_ssl_key_ssl_ca_crt')
......@@ -3473,6 +3470,20 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
result.status_code
)
self.assertEqual(
'%stest-path/deeper' % (self.backend_https_url,),
result.headers['Location']
)
result = fakeHTTPResult(
parameter_dict['domain'],
'test-path/deep/.././deeper')
self.assertEqual(
http.client.FOUND,
result.status_code
)
self.assertEqual(
'%stest-path/deeper' % (self.backend_url,),
result.headers['Location']
......@@ -4591,12 +4602,12 @@ class TestReplicateSlave(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertLogAccessUrlWithPop(parameter_dict)
self.assertKedifaKeysWithPop(parameter_dict)
key_list = [
'caddy-frontend-1-node-information-json',
'caddy-frontend-2-node-information-json'
'frontend-node-1-node-information-json',
'frontend-node-2-node-information-json'
]
node_information_json_dict = {}
for k in list(parameter_dict.keys()):
if k.startswith('caddy-frontend') and k.endswith(
if k.startswith('frontend-node') and k.endswith(
'node-information-json'):
node_information_json_dict[k] = parameter_dict.pop(k)
self.assertEqual(
......@@ -4692,7 +4703,7 @@ class TestReplicateSlaveOtherDestroyed(SlaveHttpFrontendTestCase):
self.slap.waitForInstance(self.instance_max_retry)
buildout_file = os.path.join(
self.getMasterPartitionPath(), 'instance-caddy-replicate.cfg')
self.getMasterPartitionPath(), 'instance-master.cfg')
with open(buildout_file) as fh:
buildout_file_content = fh.read()
node_1_present = re.search(
......@@ -4900,79 +4911,6 @@ class TestRe6stVerificationUrlSlave(SlaveHttpFrontendTestCase,
)
class TestSlaveGlobalDisableHttp2(TestSlave):
@classmethod
def getInstanceParameterDict(cls):
instance_parameter_dict = super(
TestSlaveGlobalDisableHttp2, cls).getInstanceParameterDict()
instance_parameter_dict['global-disable-http2'] = 'TrUe'
return instance_parameter_dict
def test_enable_http2_default(self):
parameter_dict = self.assertSlaveBase('enable-http2-default')
result = fakeHTTPSResult(
parameter_dict['domain'], 'test-path')
self.assertEqual(
self.certificate_pem,
der2pem(result.peercert))
self.assertEqualResultJson(result, 'Path', '/test-path')
headers = self.assertResponseHeaders(result)
self.assertEqual(
{
'Content-type': 'application/json',
'Set-Cookie': 'secured=value;secure, nonsecured=value',
},
headers
)
self.assertFalse(
isHTTP2(parameter_dict['domain']))
class TestEnableHttp2ByDefaultFalseSlaveGlobalDisableHttp2(
TestEnableHttp2ByDefaultFalseSlave):
@classmethod
def getInstanceParameterDict(cls):
instance_parameter_dict = super(
TestEnableHttp2ByDefaultFalseSlaveGlobalDisableHttp2,
cls).getInstanceParameterDict()
instance_parameter_dict['global-disable-http2'] = 'TrUe'
return instance_parameter_dict
def test_enable_http2_true(self):
parameter_dict = self.assertSlaveBase('enable-http2-true')
self.assertFalse(
isHTTP2(parameter_dict['domain']))
class TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2(
TestEnableHttp2ByDefaultDefaultSlave):
@classmethod
def getInstanceParameterDict(cls):
instance_parameter_dict = super(
TestEnableHttp2ByDefaultDefaultSlaveGlobalDisableHttp2,
cls).getInstanceParameterDict()
instance_parameter_dict['global-disable-http2'] = 'TrUe'
return instance_parameter_dict
def test_enable_http2_true(self):
parameter_dict = self.assertSlaveBase('enable-http2-true')
self.assertFalse(
isHTTP2(parameter_dict['domain']))
def test_enable_http2_default(self):
parameter_dict = self.assertSlaveBase('enable-http2-default')
self.assertFalse(
isHTTP2(parameter_dict['domain']))
class TestSlaveSlapOSMasterCertificateCompatibilityOverrideMaster(
SlaveHttpFrontendTestCase, TestDataMixin):
@classmethod
......@@ -6624,7 +6562,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'apache-key': self.key_pem,
'domain': 'example.com',
'enable-http2-by-default': True,
'global-disable-http2': True,
'mpm-graceful-shutdown-timeout': 2,
're6st-verification-url': 're6st-verification-url',
'backend-connect-timeout': 2,
......@@ -6718,7 +6655,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'enable-http2-by-default': 'True',
'extra_slave_instance_list': '[]',
'frontend-name': 'caddy-frontend-1',
'global-disable-http2': 'True',
'kedifa-caucase-url': kedifa_caucase_url,
'monitor-cors-domains': 'monitor.app.officejs.com',
'monitor-httpd-port': 8411,
......@@ -6745,7 +6681,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'enable-http2-by-default': 'True',
'extra_slave_instance_list': '[]',
'frontend-name': 'caddy-frontend-2',
'global-disable-http2': 'True',
'kedifa-caucase-url': kedifa_caucase_url,
'monitor-cors-domains': 'monitor.app.officejs.com',
'monitor-httpd-port': 8412,
......@@ -6772,7 +6707,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'enable-http2-by-default': 'True',
'extra_slave_instance_list': '[]',
'frontend-name': 'caddy-frontend-3',
'global-disable-http2': 'True',
'kedifa-caucase-url': kedifa_caucase_url,
'monitor-cors-domains': 'monitor.app.officejs.com',
'monitor-httpd-port': 8413,
......@@ -6818,7 +6752,6 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'domain': 'example.com',
'enable-http2-by-default': 'True',
'full_address_list': [],
'global-disable-http2': 'True',
'instance_title': 'testing partition 0',
'kedifa_port': '15080',
'mpm-graceful-shutdown-timeout': '2',
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
[
{
"caucase_port": "15090",
"domain": "example.com",
"full_address_list": [],
"global-disable-http2": "TrUe",
"instance_title": "testing partition 0",
"ip_list": [
[
"T-0",
"@@_ipv4_address@@"
],
[
"T-0",
"@@_ipv6_address@@"
]
],
"kedifa_port": "15080",
"plain_http_port": "11080",
"port": "11443",
"root_instance_title": "testing partition 0",
"slap_computer_id": "local",
"slap_computer_partition_id": "T-0",
"slap_software_release_url": "@@00getSoftwareURL@@",
"slap_software_type": "RootSoftwareInstance",
"slave_instance_list": [
{
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_enable-http2-default",
"slave_title": "_enable-http2-default"
},
{
"enable-http2": "false",
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_enable-http2-false",
"slave_title": "_enable-http2-false"
},
{
"enable-http2": "true",
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_enable-http2-true",
"slave_title": "_enable-http2-true"
},
{
"enable_cache": true,
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_dummy-cached",
"slave_title": "_dummy-cached",
"url": "http://@@_ipv4_address@@:@@_server_http_port@@/"
}
],
"timestamp": "@@TIMESTAMP@@"
},
{
"_": {
"caucase_port": "15090",
"cluster-identification": "testing partition 0",
"kedifa_port": "15080",
"monitor-cors-domains": "monitor.app.officejs.com",
"monitor-httpd-port": "8402",
"monitor-password": "@@monitor-password@@",
"monitor-username": "admin",
"slave-list": [
{
"enable_cache": true,
"slave_reference": "_dummy-cached",
"url": "http://@@_ipv4_address@@:@@_server_http_port@@/"
},
{
"slave_reference": "_enable-http2-default"
},
{
"enable-http2": "false",
"slave_reference": "_enable-http2-false"
},
{
"enable-http2": "true",
"slave_reference": "_enable-http2-true"
}
]
},
"full_address_list": [],
"instance_title": "kedifa",
"ip_list": [
[
"T-1",
"@@_ipv4_address@@"
],
[
"T-1",
"@@_ipv6_address@@"
]
],
"root_instance_title": "testing partition 0",
"slap_computer_id": "local",
"slap_computer_partition_id": "T-1",
"slap_software_release_url": "@@00getSoftwareURL@@",
"slap_software_type": "kedifa",
"slave_instance_list": [],
"timestamp": "@@TIMESTAMP@@"
},
{
"_": {
"backend-client-caucase-url": "http://[@@_ipv6_address@@]:8990",
"cluster-identification": "testing partition 0",
"domain": "example.com",
"extra_slave_instance_list": "[{\"enable_cache\": true, \"slave_reference\": \"_dummy-cached\", \"url\": \"http://@@_ipv4_address@@:@@_server_http_port@@/\"}, {\"slave_reference\": \"_enable-http2-default\"}, {\"enable-http2\": \"false\", \"slave_reference\": \"_enable-http2-false\"}, {\"enable-http2\": \"true\", \"slave_reference\": \"_enable-http2-true\"}]",
"frontend-name": "caddy-frontend-1",
"global-disable-http2": "TrUe",
"kedifa-caucase-url": "http://[@@_ipv6_address@@]:15090",
"master-key-download-url": "https://[@@_ipv6_address@@]:15080/@@master-key-download-url_endpoint@@",
"monitor-cors-domains": "monitor.app.officejs.com",
"monitor-httpd-port": 8411,
"monitor-password": "@@monitor-password@@",
"monitor-username": "admin",
"plain_http_port": "11080",
"port": "11443",
"slave-kedifa-information": "{\"_dummy-cached\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@dummy-cached_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@dummy-cached_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@dummy-cached_key-generate-auth-url@@?auth=\"}, \"_enable-http2-default\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-default_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-default_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-default_key-generate-auth-url@@?auth=\"}, \"_enable-http2-false\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-false_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-false_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-false_key-generate-auth-url@@?auth=\"}, \"_enable-http2-true\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-true_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-true_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-true_key-generate-auth-url@@?auth=\"}}"
},
"full_address_list": [],
"instance_title": "caddy-frontend-1",
"ip_list": [
[
"T-2",
"@@_ipv4_address@@"
],
[
"T-2",
"@@_ipv6_address@@"
]
],
"root_instance_title": "testing partition 0",
"slap_computer_id": "local",
"slap_computer_partition_id": "T-2",
"slap_software_release_url": "@@00getSoftwareURL@@",
"slap_software_type": "single-custom-personal",
"slave_instance_list": [],
"timestamp": "@@TIMESTAMP@@"
}
]
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
[
{
"caucase_port": "15090",
"domain": "example.com",
"enable-http2-by-default": "false",
"full_address_list": [],
"global-disable-http2": "TrUe",
"instance_title": "testing partition 0",
"ip_list": [
[
"T-0",
"@@_ipv4_address@@"
],
[
"T-0",
"@@_ipv6_address@@"
]
],
"kedifa_port": "15080",
"plain_http_port": "11080",
"port": "11443",
"root_instance_title": "testing partition 0",
"slap_computer_id": "local",
"slap_computer_partition_id": "T-0",
"slap_software_release_url": "@@00getSoftwareURL@@",
"slap_software_type": "RootSoftwareInstance",
"slave_instance_list": [
{
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_enable-http2-default",
"slave_title": "_enable-http2-default"
},
{
"enable-http2": "false",
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_enable-http2-false",
"slave_title": "_enable-http2-false"
},
{
"enable-http2": "true",
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_enable-http2-true",
"slave_title": "_enable-http2-true"
},
{
"enable_cache": true,
"slap_software_type": "RootSoftwareInstance",
"slave_reference": "_dummy-cached",
"slave_title": "_dummy-cached",
"url": "http://@@_ipv4_address@@:@@_server_http_port@@/"
}
],
"timestamp": "@@TIMESTAMP@@"
},
{
"_": {
"caucase_port": "15090",
"cluster-identification": "testing partition 0",
"kedifa_port": "15080",
"monitor-cors-domains": "monitor.app.officejs.com",
"monitor-httpd-port": "8402",
"monitor-password": "@@monitor-password@@",
"monitor-username": "admin",
"slave-list": [
{
"enable_cache": true,
"slave_reference": "_dummy-cached",
"url": "http://@@_ipv4_address@@:@@_server_http_port@@/"
},
{
"slave_reference": "_enable-http2-default"
},
{
"enable-http2": "false",
"slave_reference": "_enable-http2-false"
},
{
"enable-http2": "true",
"slave_reference": "_enable-http2-true"
}
]
},
"full_address_list": [],
"instance_title": "kedifa",
"ip_list": [
[
"T-1",
"@@_ipv4_address@@"
],
[
"T-1",
"@@_ipv6_address@@"
]
],
"root_instance_title": "testing partition 0",
"slap_computer_id": "local",
"slap_computer_partition_id": "T-1",
"slap_software_release_url": "@@00getSoftwareURL@@",
"slap_software_type": "kedifa",
"slave_instance_list": [],
"timestamp": "@@TIMESTAMP@@"
},
{
"_": {
"backend-client-caucase-url": "http://[@@_ipv6_address@@]:8990",
"cluster-identification": "testing partition 0",
"domain": "example.com",
"enable-http2-by-default": "false",
"extra_slave_instance_list": "[{\"enable_cache\": true, \"slave_reference\": \"_dummy-cached\", \"url\": \"http://@@_ipv4_address@@:@@_server_http_port@@/\"}, {\"slave_reference\": \"_enable-http2-default\"}, {\"enable-http2\": \"false\", \"slave_reference\": \"_enable-http2-false\"}, {\"enable-http2\": \"true\", \"slave_reference\": \"_enable-http2-true\"}]",
"frontend-name": "caddy-frontend-1",
"global-disable-http2": "TrUe",
"kedifa-caucase-url": "http://[@@_ipv6_address@@]:15090",
"master-key-download-url": "https://[@@_ipv6_address@@]:15080/@@master-key-download-url_endpoint@@",
"monitor-cors-domains": "monitor.app.officejs.com",
"monitor-httpd-port": 8411,
"monitor-password": "@@monitor-password@@",
"monitor-username": "admin",
"plain_http_port": "11080",
"port": "11443",
"slave-kedifa-information": "{\"_dummy-cached\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@dummy-cached_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@dummy-cached_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@dummy-cached_key-generate-auth-url@@?auth=\"}, \"_enable-http2-default\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-default_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-default_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-default_key-generate-auth-url@@?auth=\"}, \"_enable-http2-false\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-false_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-false_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-false_key-generate-auth-url@@?auth=\"}, \"_enable-http2-true\": {\"kedifa-caucase-url\": \"http://[@@_ipv6_address@@]:15090\", \"key-download-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-true_key-generate-auth-url@@\", \"key-generate-auth-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-true_key-generate-auth-url@@/@@dummy-cached_key-upload-url@@\", \"key-upload-url\": \"https://[@@_ipv6_address@@]:15080/@@enable-http2-true_key-generate-auth-url@@?auth=\"}}"
},
"full_address_list": [],
"instance_title": "caddy-frontend-1",
"ip_list": [
[
"T-2",
"@@_ipv4_address@@"
],
[
"T-2",
"@@_ipv6_address@@"
]
],
"root_instance_title": "testing partition 0",
"slap_computer_id": "local",
"slap_computer_partition_id": "T-2",
"slap_software_release_url": "@@00getSoftwareURL@@",
"slap_software_type": "single-custom-personal",
"slave_instance_list": [],
"timestamp": "@@TIMESTAMP@@"
}
]
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
T-0/etc/plugin/__init__.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,8 +5,8 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-2.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-2.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -5,7 +5,7 @@ T-0/etc/plugin/aikc-sign-promise.py
T-0/etc/plugin/aikc-user-caucase-updater.py
T-0/etc/plugin/buildout-T-0-status.py
T-0/etc/plugin/caucased-backend-client.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-caddy-frontend-1.py
T-0/etc/plugin/check-backend-haproxy-statistic-url-frontend-node-1.py
T-0/etc/plugin/check-free-disk-space.py
T-0/etc/plugin/master-key-download-url-ready-promise.py
T-0/etc/plugin/master-key-generate-auth-url-ready-promise.py
......
......@@ -835,14 +835,7 @@ class ZopeTestMixin(ZopeSkinsMixin, CrontabMixin):
class TestZopeWSGI(ZopeTestMixin, ERP5InstanceTestCase):
@unittest.expectedFailure
def test_long_request_log_rotation(self):
super().test_long_request_log_rotation()
@unittest.expectedFailure
def test_basic_authentication_user_in_access_log(self):
super().test_basic_authentication_user_in_access_log()
pass
class TestZopePublisherTimeout(ZopeSkinsMixin, ERP5InstanceTestCase):
......
......@@ -14,8 +14,8 @@
# not need these here).
[deploy-script-controller-script]
filename = deploy-script-controller
md5sum = 8357771b70efd0740561b1cb46f6955e
md5sum = ca83be8dd6ebebe0fa37ec1266330b0d
[template-deploy-test]
filename = instance.cfg.in
md5sum = 1faa52013b12b1753bcaff0b1309ad90
md5sum = ba11521137356f4361b7d3d304f8fc0c
......@@ -13,10 +13,13 @@
# Format of data-to-vm is shell script:
# URL=<url>\nWAITTIME=<seconds>\nTRIES=<amount>
#
# Expected values in configuration:
# MANDATORY values in configuration:
# * URL - the url of the script to download and test
# OPTIONAL values in configuration:
# * WAITTIME - waiting time, before next try
# * TRIES - amount of tries
# * any other exported variables can be used by the deployment script
# note: you need to export the variables for them to be used in the deployment script
# Possible TODOs:
# * post results on each try
......@@ -24,9 +27,9 @@
LOG_FILE=/var/log/test-script-deployment.log
wget -O /tmp/test-script.cfg.$$ -q http://10.0.2.100/data
wget -O /tmp/test-script.cfg."$$" -q http://10.0.2.100/data
source /tmp/test-script.cfg.$$
source /tmp/test-script.cfg."$$"
if [ -z "$LOG_FILE" ] ; then
echo "Output log file is missing"
......@@ -34,79 +37,73 @@ if [ -z "$LOG_FILE" ] ; then
fi
if [ -z "$URL" ] ; then
echo "URL is missing" >> $LOG_FILE 2>&1
echo "URL is missing." >> "$LOG_FILE" 2>&1
exit 1
fi
if [ -z "$WAITTIME" ] ; then
echo "WAITTIME missing" >> $LOG_FILE 2>&1
exit 1
fi
if [ -z "$TRIES" ] ; then
echo "TRIES missing" >> $LOG_FILE 2>&1
exit 1
fi
export WAITTIME=${WAITTIME:-360}
echo "INFO: WAITTIME is $WAITTIME" >> "$LOG_FILE" 2>&1
export TRIES=${TRIES:-80}
echo "INFO: TRIES is $TRIES" >> "$LOG_FILE" 2>&1
DEPLOYMENT_SCRIPT=/tmp/test-script-deployment.bash.$$
wget -O $DEPLOYMENT_SCRIPT -q $URL
DEPLOYMENT_SCRIPT=/tmp/test-script-deployment.bash."$$"
wget -O "$DEPLOYMENT_SCRIPT" -q "$URL"
if [[ ! -s "$DEPLOYMENT_SCRIPT" ]] ; then
echo "exit 1" > $DEPLOYMENT_SCRIPT
echo "exit 1" > "$DEPLOYMENT_SCRIPT"
fi
function add_log ()
{
LOG_FILE=$1
LOG_FILE="$1"
for f in /opt/slapos/log/slapos-node-{software,instance}.log ; do
echo "Tail of '$f':" >> $LOG_FILE
tail -n 500 $f >> $LOG_FILE
echo "Tail of '$f':" >> "$LOG_FILE"
tail -n 500 "$f" >> "$LOG_FILE"
done
}
function add_checks ()
{
LOG_FILE=$1
echo 'lsof -Pni' >> $LOG_FILE 2>&1
lsof -Pni >> $LOG_FILE 2>&1
echo 'iptables-save' >> $LOG_FILE 2>&1
iptables-save >> $LOG_FILE 2>&1
for f in /tmp/playbook-* ; do echo $f ; cat $f; echo; done >> $LOG_FILE 2>&1
echo 'slapos node status' >> $LOG_FILE 2>&1
slapos node status >> $LOG_FILE 2>&1
LOG_FILE="$1"
echo 'lsof -Pni' >> "$LOG_FILE" 2>&1
lsof -Pni >> "$LOG_FILE" 2>&1
echo 'iptables-save' >> "$LOG_FILE" 2>&1
iptables-save >> "$LOG_FILE" 2>&1
for f in /tmp/playbook-* ; do echo "$f" ; cat "$f"; echo; done >> "$LOG_FILE" 2>&1
echo 'slapos node status' >> "$LOG_FILE" 2>&1
slapos node status >> "$LOG_FILE" 2>&1
}
function upload ()
{
try=$1
LOG_FILE=$2
add_log $LOG_FILE
add_checks $LOG_FILE
try="$1"
LOG_FILE="$2"
add_log "$LOG_FILE"
add_checks "$LOG_FILE"
t=`date '+%Y%m%d%H%S'`
mv $LOG_FILE ${LOG_FILE}.$t
mv "$LOG_FILE" ${LOG_FILE}."$t"
curl -q -X POST --data-urlencode "path=test-script-result/log-file.log.$t" --data-urlencode "content@${LOG_FILE}.$t" http://10.0.2.100/
}
try=1
while true; do
echo "$0: Try $try. Running '/bin/bash $DEPLOYMENT_SCRIPT'" >> $LOG_FILE 2>&1
export TEST_YML_PATH
/bin/bash $DEPLOYMENT_SCRIPT >> $LOG_FILE 2>&1
result=$?
if [ $result == 0 ] ; then
echo "$0: Try $try. Script executed successfully." >> $LOG_FILE 2>&1
upload $try $LOG_FILE
echo "$0: Try $try. Running '/bin/bash $DEPLOYMENT_SCRIPT'" >> "$LOG_FILE" 2>&1
/bin/bash "$DEPLOYMENT_SCRIPT" >> "$LOG_FILE" 2>&1
result="$?"
if [ "$result" == 0 ] ; then
echo "$0: Try $try. Script executed successfully." >> "$LOG_FILE" 2>&1
upload "$try" "$LOG_FILE"
break
fi
if (( try > TRIES )) ; then
echo "$0: Try $try. Amount of tries $TRIES exceeded, giving up." >> $LOG_FILE 2>&1
upload $try $LOG_FILE
upload "$try" "$LOG_FILE"
break
fi
# wait WAITTIME before checking the state
echo "$0: Try $try. Sleeping $WAITTIME before retry." >> $LOG_FILE 2>&1
upload $try $LOG_FILE
sleep $WAITTIME
upload "$try" "$LOG_FILE"
sleep "$WAITTIME"
((try++))
done
exit $result
exit "$result"
......@@ -2,8 +2,7 @@
{% set test_type = slapparameter_dict.get('test-type', 'script-from-url') -%}
{# Choose parameters according to test type -#}
{% if test_type == 'script-from-url' -%}
{% set script_url = slapparameter_dict.get('script-to-test-url') -%}
{% set test_yml_path = '/not/required' -%}
{% set data_to_vm = slapparameter_dict.get('data-to-vm') -%}
{% elif test_type == 'cloned-playbook' -%}
{% set script_url = 'http://10.0.2.100/standalone-local-playbook' -%}
{% set test_yml_path = slapparameter_dict.get('yml-path-to-test') -%}
......@@ -38,10 +37,7 @@ config-bootstrap-script-url = {{ in_vm_test_script }}#{{ in_vm_test_script_md5 }
# Script configuration
config-data-to-vm =
URL={{ script_url }}
WAITTIME={{ waittime }}
TRIES={{ tries }}
TEST_YML_PATH={{ test_yml_path }}
{{ data_to_vm }}
# require HTTP server
config-enable-http-server = true
......
......@@ -48,8 +48,6 @@ context =
raw bin_directory ${buildout:bin-directory}
raw in_vm_test_script ${deploy-script-controller-script:location}
raw in_vm_test_script_md5 ${deploy-script-controller-script:md5sum}
raw waittime ${deploy-script-controller-script:waittime}
raw tries ${deploy-script-controller-script:tries}
section test_image_repository test-image-repository
[test-image-repository]
......
......@@ -43,9 +43,6 @@ output = ${buildout:directory}/template-original.kvm.cfg
[deploy-script-controller-script]
location = ${:_profile_base_location_}/${:filename}
# configuration
waittime = 360
tries = 80
[standalone-local-playbook]
filename = standalone-local-playbook
......
......@@ -22,7 +22,7 @@ eggs =
<= go-git-package
go.importpath = lab.nexedi.com/nexedi/galene
repository = https://lab.nexedi.com/nexedi/galene.git
revision = 6669a93ae39ad83b8b3a222dd8210dfef8a7ed02
revision = galene-0.6
[gowork]
install =
......
......@@ -21,7 +21,7 @@ md5sum = 23c15a579b66cef866b30a2f53b1b737
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
md5sum = 743f7ec8718de67f31720a68258a5ff2
md5sum = fc1dd9faf99a4f75e3727b80bb2d59fb
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
......
......@@ -90,7 +90,7 @@ path_access_log = ${basedirectory:log}/nginx.access.log
path_error_log = ${basedirectory:log}/nginx.error.log
path_tmp = ${tempdirectory:tmp}
# Docroot
docroot = ${downloader:location}
docroot = ${docroot:location}
default_index = ${:docroot}/index.html
# Config files
path_nginx_conf = ${directory:etc}/nginx.conf
......@@ -127,42 +127,39 @@ output = ${html5as:bin_launcher}
context =
section param_html5as html5as
# Command to put content in the docroot
# Command to download archive from provided url
[downloader]
recipe = slapos.recipe.build:download
# We add: or '', otherwise jinja2 will render a 'None' string
url = {{ parameter_dict['download_url'] or '' }}
# Allow to use slapos.recipe.build:download which can only be used in "online" mode
offline = false
# Command to put content in the docroot
[docroot]
recipe = slapos.recipe.build
# Path where the recipe stores any produced file,
# it will be automatically removed at the beginning of "install".
location = ${directory:srv}/html5as
# All the keys in this section will be available as a dict called "self.options"
# We add: or '', otherwise jinja2 will render a 'None' string
url = {{ parameter_dict['download_url'] or '' }}
archive = {{ '${downloader:destination}' if parameter_dict['download_url'] else '' }}
default_index_html = ${default_index_html:output}
# If a tarball is passed as a parameter in download url
# it's content will be served by the instance.
# If the parameter is not provided it fallback to the default template
install =
import os, shutil
buildout_offline = self.buildout['buildout']['offline']
try:
# Allow to do self.download() which can only be used in "online" mode
self.buildout['buildout']['offline'] = 'false'
if self.options['url']:
# Use fonctions from the slapos.recipe.build repository
# Download a file from a URL to a temporary path
file = self.download(self.options['url'])
# Create a directory and extract the file that are compressed inside
extract_dir = self.extract(file)
# Return the right directory path
workdir = guessworkdir(extract_dir)
# Recursively copy directory
self.copyTree(workdir, location)
else:
# Create directory and copy the default template inside
os.makedirs(location)
shutil.copy(self.options['default_index_html'], location)
finally:
# reset the parameter
self.buildout['buildout']['offline'] = buildout_offline
if self.options['archive']:
# Create a directory and extract the file that are compressed inside
extract_dir = self.extract(self.options['archive'])
# Return the right directory path
workdir = guessworkdir(extract_dir)
# Recursively copy directory
self.copyTree(workdir, location)
else:
# Create directory and copy the default template inside
os.makedirs(location)
shutil.copy(self.options['default_index_html'], location)
[default_index_html]
recipe = slapos.recipe.template:jinja2
......
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = f0a12f3abc25713f5c79c9bf13290340
md5sum = fe055b993754ca665b8249cbfb9bbc8b
[template-lte-enb-epc]
_update_hash_filename_ = instance-enb-epc.jinja2.cfg
......@@ -24,7 +24,7 @@ md5sum = c9994f2ef03edd7d6773307a6385c47c
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = c450b8c307d20738a98bcb4f6ffeee16
md5sum = 8f8c7295104757e0cccfab3811a4fb24
[template-lte-gnb-epc]
_update_hash_filename_ = instance-gnb-epc.jinja2.cfg
......@@ -36,19 +36,27 @@ md5sum = b17674f523adce9b0dda942c1493674d
[template-lte-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum = 9732653a0e2c7fe91d80da80762430d2
md5sum = fdc012ad6f0d3d055450a4ff7efd15e4
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
md5sum = 728f4d3ae248710c23e4b73eea4d628e
[template-lte-ue-lte]
_update_hash_filename_ = instance-ue-lte.jinja2.cfg
md5sum = 0808194507345550abc37118129fb757
[template-lte-ue-nr]
_update_hash_filename_ = instance-ue-nr.jinja2.cfg
md5sum = ed4112748616803ec0eb3c30bde80856
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
md5sum = 8029046031f17da3f81ace017ba193c9
md5sum = 9fd6abb1e69fe59af0dafbb336f24f8d
[sib23.asn]
filename = config/sib23.asn
......@@ -56,7 +64,7 @@ md5sum = b377dac7f1fcf94fb9ce9ebed617f36a
[gnb.jinja2.cfg]
filename = config/gnb.jinja2.cfg
md5sum = 7f7c8ddf242027bddc3e84c7a0c74474
md5sum = 0ad683812818a02ef5010d087ec7138b
[ltelogs.jinja2.sh]
filename = ltelogs.jinja2.sh
......@@ -70,10 +78,18 @@ md5sum = 21e24367dd8213a00f6c777df33d5c03
filename = config/ims.jinja2.cfg
md5sum = 36281b03597252cf75169417d02fc28c
[ue-lte.jinja2.cfg]
filename = config/ue-lte.jinja2.cfg
md5sum = 31c166f0a1b6d664f92b8f318b233d9a
[ue-nr.jinja2.cfg]
filename = config/ue-nr.jinja2.cfg
md5sum = b3078deab008d7e81ddd88ac02b8b698
[sdr-busy-promise]
_update_hash_filename_ = promise/check_sdr_busy.jinja2.py
md5sum = 93dacb1da15310eb70d0815711a06cdf
_update_hash_filename_ = promise/check_sdr_busy.py
md5sum = a9d7a06c43410e02070b9ddae7b46b38
[interface-up-promise]
_update_hash_filename_ = promise/check_interface_up.py
md5sum = cbe3ac5d123e38cc6adf168f39cc8189
md5sum = 7797aeaf02e055226249f2c08209775a
......@@ -4,7 +4,7 @@
#define N_ANTENNA_UL 2
{
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,file.rotate=1G,file.path=/dev/null",
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/enb.log",
rf_driver: {
......@@ -205,7 +205,7 @@
cipher_algo_pref: [],
integ_algo_pref: [2, 1],
inactivity_timer: 10000,
inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_lte_inactivity_timer']) }},
srb_config: [
{
......
......@@ -6,7 +6,7 @@
#define NR_LONG_PUCCH_FORMAT 2 // Values: 2, 3, 4
{
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,file.rotate=1G,file.path=/dev/null",
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/gnb.log",
rf_driver: {
......@@ -577,7 +577,7 @@
cipher_algo_pref: [],
integ_algo_pref: [2, 1],
inactivity_timer: 10000,
inactivity_timer: {{ slapparameter_dict.get('inactivity_timer', slap_configuration['configuration.default_nr_inactivity_timer']) }},
#ifndef EPS_FALLBACK
#define EPS_FALLBACK 0
......
{
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/ue.log",
rue_bind_addr: "{{ pub_info['rue_bind_addr'] }}",
com_addr: "{{ pub_info['com_addr'] }}",
rf_driver: {
name: "sdr",
args: "dev0=/dev/sdr0",
rx_antenna:"tx_rx",
},
tx_gain: {{ slapparameter_dict.get('tx_gain', slap_configuration['configuration.default_lte_tx_gain']) }},
rx_gain: {{ slapparameter_dict.get('rx_gain', slap_configuration['configuration.default_lte_rx_gain']) }},
cell_groups: [{
multi_ue: true,
cells: [
{
bandwidth: {{ slapparameter_dict.get('n_rb_dl', slap_configuration['configuration.default_lte_n_rb_dl']) }},
dl_earfcn: {{ slapparameter_dict.get('dl_earfcn', slap_configuration['configuration.default_dl_earfcn']) }},
n_antenna_dl: {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }},
n_antenna_ul: {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }},
global_timing_advance: -1,
}
],
pdcch_decode_opt: false,
pdcch_decode_opt_threshold: 0.1,
}],
ue_list: [
{
sim_algo: "{{ slapparameter_dict.get('sim_algo', 'milenage') }}",
opc: "{{ slapparameter_dict.get('opc', '') }}",
amf: {{ slapparameter_dict.get('amf', '0x9001') }},
sqn: "{{ slapparameter_dict.get('sqn', '000000000000') }}",
impu: "{{ slapparameter_dict.get('impu', '') }}",
impi: "{{ slapparameter_dict.get('impi', '') }}",
imsi: "{{ slapparameter_dict.get('imsi', slap_configuration['configuration.default_lte_imsi']) }}",
K: "{{ slapparameter_dict.get('k', slap_configuration['configuration.default_lte_k']) }}",
rue_addr: "{{ slapparameter_dict.get('rue_addr', '') }}",
ue_category: 12,
tun_setup_script: "ue-ifup",
apn: "internet",
}
],
}
{
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/ue.log",
rue_bind_addr: "{{ pub_info['rue_bind_addr'] }}",
com_addr: "{{ pub_info['com_addr'] }}",
rf_driver: {
name: "sdr",
args: "dev0=/dev/sdr0",
rx_antenna:"tx_rx",
},
tx_gain: {{ slapparameter_dict.get('tx_gain', slap_configuration['configuration.default_nr_tx_gain']) }},
rx_gain: {{ slapparameter_dict.get('rx_gain', slap_configuration['configuration.default_nr_rx_gain']) }},
cell_groups: [{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: {{ slapparameter_dict.get('nr_bandwidth', slap_configuration['configuration.default_nr_bandwidth']) }},
band: {{ slapparameter_dict.get('nr_band', slap_configuration['configuration.default_nr_band']) }},
dl_nr_arfcn: {{ slapparameter_dict.get('dl_nr_arfcn', slap_configuration['configuration.default_dl_nr_arfcn']) }},
ssb_nr_arfcn: {{ slapparameter_dict.get('ssb_nr_arfcn', slap_configuration['configuration.default_ssb_nr_arfcn']) }},
subcarrier_spacing: 30,
n_antenna_dl: {{ slapparameter_dict.get('n_antenna_dl', slap_configuration['configuration.default_n_antenna_dl']) }},
n_antenna_ul: {{ slapparameter_dict.get('n_antenna_ul', slap_configuration['configuration.default_n_antenna_ul']) }},
}
],
}],
ue_list: [
{
sim_algo: "{{ slapparameter_dict.get('sim_algo', 'milenage') }}",
opc: "{{ slapparameter_dict.get('opc', '') }}",
amf: {{ slapparameter_dict.get('amf', '0x9001') }},
sqn: "{{ slapparameter_dict.get('sqn', '000000000000') }}",
impu: "{{ slapparameter_dict.get('impu', '') }}",
impi: "{{ slapparameter_dict.get('impi', '') }}",
imsi: "{{ slapparameter_dict.get('imsi', slap_configuration['configuration.default_nr_imsi']) }}",
K: "{{ slapparameter_dict.get('k', slap_configuration['configuration.default_nr_k']) }}",
rue_addr: "{{ slapparameter_dict.get('rue_addr', '') }}",
as_release: 15,
ue_category: "nr",
tun_setup_script: "ue-ifup",
apn: "internet",
}
]
}
......@@ -108,6 +108,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": {{ default_lte_inactivity_timer }}
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -36,6 +36,7 @@ configuration.default_lte_band = {{ default_lte_band }}
configuration.default_lte_n_rb_dl = {{ default_lte_n_rb_dl }}
configuration.default_lte_tx_gain = {{ default_lte_tx_gain }}
configuration.default_lte_rx_gain = {{ default_lte_rx_gain }}
configuration.default_lte_inactivity_timer = {{ default_lte_inactivity_timer }}
[directory]
recipe = slapos.cookbook:mkdirectory
......@@ -74,7 +75,9 @@ output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true;
sudo /opt/amarisoft/rm-tmp-lte;
sudo /opt/amarisoft/init-sdr;
sudo /opt/amarisoft/init-enb;
{{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${directory:log}/enb-output.log 2>> ${directory:log}/enb-output.log
{% endif %}
......@@ -127,17 +130,10 @@ monitor-title = {{ slapparameter_dict['name'] | string }}
password = {{ slapparameter_dict['monitor-password'] | string }}
{% endif %}
[sdr-busy-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ sdr_busy_promise }}
output = ${directory:etc}/check-sdr-busy.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if /dev/sdr0 is busy
[sdr-busy-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file = ${sdr-busy-promise-template:output}
file = {{ sdr_busy_promise }}
output = ${directory:plugins}/check-sdr-busy.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
......@@ -150,6 +150,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": {{ default_nr_inactivity_timer }}
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -35,6 +35,7 @@ configuration.default_nr_band = {{ default_nr_band }}
configuration.default_nr_dl_freq = {{ default_nr_dl_freq }}
configuration.default_nr_bandwidth = {{ default_nr_bandwidth }}
configuration.default_nr_tx_gain = {{ default_nr_tx_gain }}
configuration.default_nr_inactivity_timer = {{ default_nr_inactivity_timer }}
configuration.default_nr_rx_gain = {{ default_nr_rx_gain }}
configuration.default_nr_ssb_pos_bitmap = {{ default_nr_ssb_pos_bitmap }}
......@@ -75,7 +76,9 @@ output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true;
sudo /opt/amarisoft/rm-tmp-lte;
sudo /opt/amarisoft/init-sdr;
sudo /opt/amarisoft/init-enb;
{{ enb }}/lteenb ${directory:etc}/gnb.cfg >> ${directory:log}/gnb-output.log 2>> ${directory:log}/gnb-output.log
{% endif %}
......@@ -127,17 +130,10 @@ monitor-title = {{ slapparameter_dict['name'] | string }}
password = {{ slapparameter_dict['monitor-password'] | string }}
{% endif %}
[sdr-busy-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ sdr_busy_promise }}
output = ${directory:etc}/check-sdr-busy.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if /dev/sdr0 is busy
[sdr-busy-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file = ${sdr-busy-promise-template:output}
file = {{ sdr_busy_promise }}
output = ${directory:plugins}/check-sdr-busy.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
......@@ -106,6 +106,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -88,6 +88,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -148,6 +148,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -130,6 +130,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink E-UTRA Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 38350
},
"n_rb_dl": {
"title": "DL RB",
"description": "number of DL resource blocks",
"type": "number",
"default": 100
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 378000
},
"nr_band": {
"title": "NR band",
"description": "NR band number",
"type": "number",
"default": 39
},
"nr_bandwidth": {
"title": "Bandwidth",
"description": "Downlink Bandwidth (in MHz)",
"type": "number",
"default": 40
},
"ssb_nr_arfcn": {
"title": "SSB NR ARFCN",
"description": "SSB NR ARFCN, you can retrieve from ENB/GNB side",
"type": "number",
"default": 377790
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
......@@ -106,6 +106,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -88,6 +88,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -148,6 +148,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -130,6 +130,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink E-UTRA Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 38050
},
"n_rb_dl": {
"title": "DL RB",
"description": "number of DL resource blocks",
"type": "number",
"default": 100
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 520000
},
"nr_band": {
"title": "NR band",
"description": "NR band number",
"type": "number",
"default": 38
},
"nr_bandwidth": {
"title": "Bandwidth",
"description": "Downlink Bandwidth (in MHz)",
"type": "number",
"default": 40
},
"ssb_nr_arfcn": {
"title": "SSB NR ARFCN",
"description": "SSB NR ARFCN, you can retrieve from ENB/GNB side",
"type": "number",
"default": 517930
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
......@@ -106,6 +106,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -88,6 +88,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -148,6 +148,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -130,6 +130,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink E-UTRA Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 42590
},
"n_rb_dl": {
"title": "DL RB",
"description": "number of DL resource blocks",
"type": "number",
"default": 100
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 632628
},
"nr_band": {
"title": "NR band",
"description": "NR band number",
"type": "number",
"default": 78
},
"nr_bandwidth": {
"title": "Bandwidth",
"description": "Downlink Bandwidth (in MHz)",
"type": "number",
"default": 40
},
"ssb_nr_arfcn": {
"title": "SSB NR ARFCN",
"description": "SSB NR ARFCN, you can retrieve from ENB/GNB side",
"type": "number",
"default": 632544
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
......@@ -106,6 +106,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -88,6 +88,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -148,6 +148,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
......@@ -130,6 +130,12 @@
"type": "object",
"default": {}
},
"inactivity_timer": {
"title": "Inactivity Timer",
"description": "Send RRC connection release after this time (in ms) of network inactivity.",
"type": "number",
"default": 10000
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
......
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink E-UTRA Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 44590
},
"n_rb_dl": {
"title": "DL RB",
"description": "number of DL resource blocks",
"type": "number",
"default": 100
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": 646666
},
"nr_band": {
"title": "NR band",
"description": "NR band number",
"type": "number",
"default": 78
},
"nr_bandwidth": {
"title": "Bandwidth",
"description": "Downlink Bandwidth (in MHz)",
"type": "number",
"default": 40
},
"ssb_nr_arfcn": {
"title": "SSB NR ARFCN",
"description": "SSB NR ARFCN, you can retrieve from ENB/GNB side",
"type": "number",
"default": 646656
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": 2
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "001010123456789"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "00112233445566778899aabbccddeeff"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": {{ default_lte_tx_gain }}
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": {{ default_lte_rx_gain }}
},
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink E-UTRA Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": {{ default_dl_earfcn }}
},
"n_rb_dl": {
"title": "DL RB",
"description": "number of DL resource blocks",
"type": "number",
"default": {{ default_lte_n_rb_dl }}
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": {{ default_n_antenna_dl }}
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": {{ default_n_antenna_ul }}
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "{{ default_lte_imsi }}"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "{{ default_lte_k }}"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
[buildout]
parts =
directory
ltelogs
lte-ue-lte-config
lte-ue-service
sdr-busy-promise
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = {{ slap_connection['computer-id'] }}
partition = {{ slap_connection['partition-id'] }}
url = {{ slap_connection['server-url'] }}
key = {{ slap_connection['key-file'] }}
cert = {{ slap_connection['cert-file'] }}
configuration.default_dl_earfcn = {{ default_dl_earfcn }}
configuration.default_lte_n_rb_dl = {{ default_lte_n_rb_dl }}
configuration.default_lte_tx_gain = {{ default_lte_tx_gain }}
configuration.default_lte_rx_gain = {{ default_lte_rx_gain }}
configuration.default_n_antenna_dl = {{ default_n_antenna_dl }}
configuration.default_n_antenna_ul = {{ default_n_antenna_ul }}
configuration.default_lte_imsi = {{ default_lte_imsi }}
configuration.default_lte_k = {{default_lte_k}}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
tmp = ${:home}/tmp
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
url = {{ ltelogs_template }}
output = ${directory:home}/ltelogs.sh
extensions = jinja2.ext.do
context =
section directory directory
{% if slapparameter_dict.get("ue_lte_config_link", None) %}
[ue-lte-config-dl]
recipe = slapos.recipe.build:download
url = {{ slapparameter_dict.get("ue_lte_config_link") }}
version = {{ slapparameter_dict.get("ue_lte_config_version") }}
offline = false
{% endif %}
[lte-ue-sh-wrapper]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true;
{{ ue }}/lteue ${directory:etc}/ue.cfg >> ${directory:log}/ue-output.log 2>> ${directory:log}/ue-output.log
{% endif %}
### User Equipment (UE)
[lte-ue-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:output} ${directory:log}/ue.log; sleep 2
command-line = ${lte-ue-sh-wrapper:output}
wrapper-path = ${directory:service}/lte-ue
mode = 0775
reserve-cpu = True
pidfile = ${directory:run}/ue.pid
hash-files =
${lte-ue-lte-config:output}
${lte-ue-sh-wrapper:output}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[config-base]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
context =
section directory directory
section slap_configuration slap-configuration
section pub_info publish-connection-information
key slapparameter_dict slap-configuration:configuration
[lte-ue-lte-config]
<= config-base
{% if slapparameter_dict.get("ue_lte_config_link", None) %}
url = ${ue-lte-config-dl:target}
{% else %}
url = {{ ue_lte_template }}
{% endif %}
output = ${directory:etc}/ue.cfg
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish.serialised
rue_bind_addr = ${slap-configuration:ipv6-random}
com_addr = [${slap-configuration:ipv6-random}]:9002
[monitor-instance-parameter]
{% if slapparameter_dict.get("name", None) %}
monitor-title = {{ slapparameter_dict['name'] | string }}
{% endif %}
{% if slapparameter_dict.get("monitor-password", None) %}
password = {{ slapparameter_dict['monitor-password'] | string }}
{% endif %}
[sdr-busy-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ sdr_busy_promise }}
output = ${directory:etc}/check-sdr-busy.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if /dev/sdr0 is busy
[sdr-busy-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file = ${sdr-busy-promise-template:output}
output = ${directory:plugins}/check-sdr-busy.py
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": {{ default_nr_tx_gain }}
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": {{ default_nr_rx_gain }}
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
"type": "number",
"default": {{ default_dl_nr_arfcn }}
},
"nr_band": {
"title": "NR band",
"description": "NR band number",
"type": "number",
"default": {{ default_nr_band }}
},
"nr_bandwidth": {
"title": "Bandwidth",
"description": "Downlink Bandwidth (in MHz)",
"type": "number",
"default": {{ default_nr_bandwidth }}
},
"ssb_nr_arfcn": {
"title": "SSB NR ARFCN",
"description": "SSB NR ARFCN, you can retrieve from ENB/GNB side",
"type": "number",
"default": {{ default_ssb_nr_arfcn }}
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of DL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": {{ default_n_antenna_dl }}
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"description": "Enumeration: 1, 2, 4 or 8. Number of UL antennas. It must be the same for all NB-IoT and LTE cells sharing the same RF port.",
"type": "number",
"default": {{ default_n_antenna_ul }}
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": "{{ default_nr_imsi }}"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": "{{ default_nr_k }}"
},
"sim_algo": {
"title": "sim_algo",
"description": "Optional enumeration. xor, milenage or tuak (default = milenage). Set the USIM authentication algorithm. Note: test USIM cards use the XOR algorithm.",
"type": "string",
"default": "milenage"
},
"opc": {
"title": "opc",
"description": "Optional string. Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, either op or opc must be set.",
"type": "string",
"default": "milenage"
},
"amf": {
"title": "amf",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "sqn",
"description": "Optional String (6 byte hexadecimal string). Default = '000000000000'. Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"impu": {
"title": "impu",
"description": "Array of string or object. Each string represent an IMPU and can be a sip URI or a telephone number.",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "String. Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
[buildout]
parts =
directory
ltelogs
lte-ue-nr-config
lte-ue-service
sdr-busy-promise
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = {{ slap_connection['computer-id'] }}
partition = {{ slap_connection['partition-id'] }}
url = {{ slap_connection['server-url'] }}
key = {{ slap_connection['key-file'] }}
cert = {{ slap_connection['cert-file'] }}
configuration.default_dl_nr_arfcn = {{ default_dl_nr_arfcn }}
configuration.default_nr_bandwidth = {{ default_nr_bandwidth }}
configuration.default_nr_band = {{ default_nr_band}}
configuration.default_nr_tx_gain = {{ default_nr_tx_gain }}
configuration.default_nr_rx_gain = {{ default_nr_rx_gain }}
configuration.default_ssb_nr_arfcn = {{ default_ssb_nr_arfcn }}
configuration.default_n_antenna_dl = {{ default_n_antenna_dl }}
configuration.default_n_antenna_ul = {{ default_n_antenna_ul }}
configuration.default_nr_imsi = {{ default_nr_imsi }}
configuration.default_nr_k = {{ default_nr_k }}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
tmp = ${:home}/tmp
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
url = {{ ltelogs_template }}
output = ${directory:home}/ltelogs.sh
extensions = jinja2.ext.do
context =
section directory directory
{% if slapparameter_dict.get("ue_nr_config_link", None) %}
[ue-nr-config-dl]
recipe = slapos.recipe.build:download
url = {{ slapparameter_dict.get("ue_nr_config_link") }}
version = {{ slapparameter_dict.get("ue_nr_config_version") }}
offline = false
{% endif %}
[lte-ue-sh-wrapper]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true;
{{ ue }}/lteue ${directory:etc}/ue.cfg >> ${directory:log}/ue-output.log 2>> ${directory:log}/ue-output.log
{% endif %}
### User Equipment (UE)
[lte-ue-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:output} ${directory:log}/ue.log; sleep 2
command-line = ${lte-ue-sh-wrapper:output}
wrapper-path = ${directory:service}/lte-ue
mode = 0775
reserve-cpu = True
pidfile = ${directory:run}/ue.pid
hash-files =
${lte-ue-nr-config:output}
${lte-ue-sh-wrapper:output}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[config-base]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
context =
section directory directory
section slap_configuration slap-configuration
section pub_info publish-connection-information
key slapparameter_dict slap-configuration:configuration
[lte-ue-nr-config]
<= config-base
{% if slapparameter_dict.get("ue_nr_config_link", None) %}
url = ${ue-nr-config-dl:target}
{% else %}
url = {{ ue_nr_template }}
{% endif %}
output = ${directory:etc}/ue.cfg
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish.serialised
rue_bind_addr = ${slap-configuration:ipv6-random}
com_addr = [${slap-configuration:ipv6-random}]:9002
[monitor-instance-parameter]
{% if slapparameter_dict.get("name", None) %}
monitor-title = {{ slapparameter_dict['name'] | string }}
{% endif %}
{% if slapparameter_dict.get("monitor-password", None) %}
password = {{ slapparameter_dict['monitor-password'] | string }}
{% endif %}
[sdr-busy-promise-template]
recipe = slapos.recipe.template:jinja2
url = {{ sdr_busy_promise }}
output = ${directory:etc}/check-sdr-busy.py
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
# Add custom promise to check if /dev/sdr0 is busy
[sdr-busy-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file = ${sdr-busy-promise-template:output}
output = ${directory:plugins}/check-sdr-busy.py
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment