TT#71952 Integrate ngcpcfg functional tests into t testsuite

There were functional tests for the get and values actions, but had
never been hooked into any testing framework. And some obsolete build
action tests already covered by the python tests.

Rewrite the get tests in python so that they get executed within docker
with the expected permissions, and remove the old unhooked tests that
are just confusing when adding new functionality.

Change-Id: I7570e35428c1fa0a0f26de75721f84365d4daf9a
changes/99/37699/2
Guillem Jover 6 years ago
parent a5285488d0
commit 6b9e569c91

@ -6,3 +6,18 @@ cluster_sets:
dispatcher_id: '50'
default_set: default
type: central
www_admin:
fees_csv:
element_order:
- destination
- zone
- zone_detail
- onpeak_init_rate
- onpeak_init_interval
- onpeak_follow_rate
- onpeak_follow_interval
- offpeak_init_rate
- offpeak_init_interval
- offpeak_follow_rate
- offpeak_follow_interval
- use_free_time

@ -1,2 +1,11 @@
---
tests:
database:
dbhost: localhost
dbport: 3306
ossbss:
provisioning:
database:
name: provisioning
user: soap
pass: hEuxXrzLF43X93ULhoNu

@ -0,0 +1,66 @@
#!/usr/bin/env py.test-3
import pytest
import re
import tempfile
###############################################################
# ngcpcfg get
###############################################################
@pytest.mark.get
def test_get_action_missing_key_parameter(ngcpcfgcli, tmpdir):
out = ngcpcfgcli("get")
assert "" in out.stdout
assert "Usage: ngcpcfg get <key>" in out.stderr
assert out.returncode == 1
@pytest.mark.get
def test_get_action_missing_file(ngcpcfgcli, tmpdir):
out = ngcpcfgcli("get", "test",
env={
'NGCPCTL_CONFIG': '/run/nonexistent-file'
})
assert "" in out.stdout
assert "Error: Configuration file /run/nonexistent-file does not " + \
"exist (unconfigured?) - exiting." in out.stderr
assert out.returncode == 1
@pytest.mark.get
def test_get_wrong_get_option(ngcpcfgcli, tmpdir):
out = ngcpcfgcli("get", "--something", "key.missing")
assert "" in out.stdout
assert "Usage: ngcpcfg get <key>" in out.stderr
assert out.returncode == 1
@pytest.mark.get
def test_get_action_constants_child_item(ngcpcfgcli, tmpdir):
out = ngcpcfgcli("get", "database.dbhost")
assert "localhost" in out.stdout
assert "" in out.stderr
assert out.returncode == 0
@pytest.mark.get
def test_get_action_config_child_item(ngcpcfgcli, tmpdir):
out = ngcpcfgcli("get", "www_admin.fees_csv.element_order")
assert "destination zone zone_detail " + \
"onpeak_init_rate onpeak_init_interval " + \
"onpeak_follow_rate onpeak_follow_interval " + \
"offpeak_init_rate offpeak_init_interval " + \
"offpeak_follow_rate offpeak_follow_interval " + \
"use_free_time" in out.stdout
assert "" in out.stderr
assert out.returncode == 0
@pytest.mark.get
def test_get_action_missing_item(ngcpcfgcli, tmpdir):
out = ngcpcfgcli("get", "key.missing")
assert "\\n" in out.stdout
assert "" in out.stderr
assert out.returncode == 0

@ -1,87 +0,0 @@
#!/bin/bash
set -e
set -u
# when invoked under DEBUG_SHELL=1 then provide
# interactive shell before exiting
if [ -n "${DEBUG_SHELL:-}" ] ; then
bailout() { bash; exit 1; }
else
bailout() { exit 1; }
fi
testsuite="$(dirname "${PWD}/$0")"
export testsuite
TMPDIR="$(mktemp -d)"
echo "Switching to temporary directory $TMPDIR"
cd "$TMPDIR"
cp -a "${testsuite}"/* .
export FUNCTIONS="$testsuite/../functions/"
export HELPER="$testsuite/../helper/"
export HOOKS="$testsuite/../hooks/"
export SCRIPTS="$testsuite/../scripts/"
echo -n "Testing ngcpcfg without any arguments: "
if "$testsuite"/../sbin/ngcpcfg 2>&1 | grep -q "^Usage:$" ; then
echo OK
else
echo "Error with executing ngcpcfg without any arguments" >&2
bailout
fi
echo -n "Testing ngcpcfg --help: "
if "$testsuite"/../sbin/ngcpcfg --help 2>&1 | grep -q "^Usage:$" ; then
echo OK
else
echo "Error with executing ngcpcfg --help" >&2
bailout
fi
echo -n "Testing ngcpcfg --version: "
if "$testsuite"/../sbin/ngcpcfg --version 2>&1 | grep -q "version" ; then
echo OK
else
echo "Error with executing ngcpcfg --version" >&2
bailout
fi
echo "Testing ngcpcfg build:"
"$testsuite"/../sbin/ngcpcfg build > build.log
while IFS= read -r line ; do
case "$line" in
Generating\ testsuite/*OK) echo generation OK ;;
Executing\ postbuild\ for\ testsuite/*) echo postbuild OK;;
chgrp\ www-data\ testsuite/ngcp-ossbss/logging.conf) echo postbuild OK;;
DEBUG:*) ;; # support running under "--debug"
*)
echo "Error caught: $line" >&2
bailout
;;
esac
done < build.log
# test main tt2 processing
if [[ $(cat testsuite/testtemplate) == "foo" ]] ; then
echo "template test is OK"
else
echo "Error with [ngcp-config/templates/]testsuite/testtemplate.tt2" >&2
bailout
fi
# test precedence of files
if [[ $(cat testsuite/precedence/all/test) == "test.custom.tt2" ]] ; then
echo "precedence test is OK"
else
echo "Error with [ngcp-config/templates/]testsuite/precedence/all/*" >&2
bailout
fi
rm -rf "$TMPDIR"
echo "Everything seems to be ok."
# EOF

@ -1,13 +0,0 @@
requires 'Carp';
requires 'Data::Clone';
requires 'Data::Validate::IP';
requires 'Getopt::Long';
requires 'IO::Interface';
requires 'IO::Socket';
requires 'IPC::Open3';
requires 'Net::Netmask';
requires 'Pod::Usage';
requires 'Regexp::IPv6';
requires 'Socket';
requires 'Sys::Hostname';
requires 'YAML::XS';

@ -1,279 +0,0 @@
#These values might be changed to constants.yml
networking:
eaddress: 192.168.51.117
ha:
eiface: eth0
bindnetaddr: 192.168.51.0
mcastaddr: 226.94.1.1
mcastport: 5405
database:
bufferpoolsize: 254M
kamailio:
port: 5060
disable_tcp: yes
authenticate_bye: no
multi_homed: no
allow_peer_relay: no
use_enum: no
enum_suffix: e164.arpa.
patterns:
emergency: 112|911|999
asterisk:
sip:
bindport: 5070
dtmfmode: rfc2833
rtp:
minport: 10000
maxport: 20000
voicemail:
serveremail: voicebox@sip.sipwise.com
maxmsg: 30
max_msg_length: 180
min_msg_length: 3
maxgreet: 60
fromstring: Voicemail server
mailsubject: '[Voicebox] New message ${VM_MSGNUM} in voicebox ${VM_MAILBOX}'
mailbody: 'You have received a new message from ${VM_CALLERID} in voicebox ${VM_MAILBOX} on ${VM_DATE}.'
log:
facility: local6
mediator:
interval: 10
rateomat:
splitpeakparts: 0
loopinterval: 10
ossbss:
htpasswd:
- user: ngcpsoap
pass: '{SHA}w4zj3mxbmynIQ1jsUEjSkN2z2pk='
apache:
port: 2443
serveradmin: support@sipwise.com
servername: '"myserver"'
sslcertfile: /etc/apache2/ssl/myserver.crt
sslcertkeyfile: /etc/apache2/ssl/myserver.pem
provisioning:
log_passwords: 0
no_logline_truncate: 0
allow_ip_as_domain: 1
allow_numeric_usernames: 0
tmpdir: /tmp
faxpw_min_char: 0
routing:
cc_regex: '[1-9]\d{0,3}'
ac_regex: '[1-9]\d{0,4}'
sn_regex: '[1-9]\d+'
logging:
ossbss:
facility: local0
level: DEBUG
identity: provisioning
web:
facility: local0
level: DEBUG
apache:
err:
facility: local7
level: info
acc:
facility: daemon
level: info
identity: oss
www_admin:
apache:
port: 1443
serveradmin: support@sipwise.com
servername: '"myserver"'
sslcertfile: /etc/apache2/ssl/myserver.crt
sslcertkeyfile: /etc/apache2/ssl/myserver.pem
billing_features: 1
peering_features: 1
voicemail_features: 1
fax_features: 1
conference_features: 1
cc_dial_prefix: 00
ac_dial_prefix: 0
dashboard:
enable: 1
subscriber:
extension_features: 0
audiofile_features: 0
domain:
rewrite_features: 1
audiofile_features: 0
vsc_features: 0
default_admin_settings:
is_master: 0
is_active: 1
read_only: 0
show_passwords: 1
call_data: 0
fees_csv:
element_order:
- destination
- zone
- zone_detail
- onpeak_init_rate
- onpeak_init_interval
- onpeak_follow_rate
- onpeak_follow_interval
- offpeak_init_rate
- offpeak_init_interval
- offpeak_follow_rate
- offpeak_follow_interval
- use_free_time
speed_dial_vsc_presets:
vsc:
- '*0'
- '*1'
- '*2'
- '*3'
- '*4'
- '*5'
- '*6'
- '*7'
- '*8'
- '*9'
logging:
apache:
err:
facility: local7
level: info
acc:
facility: daemon
level: info
identity: oss
www_csc:
apache:
port: 443
serveradmin: support@sipwise.com
servername: myserver
sslcertfile: /etc/apache2/ssl/myserver.crt
sslcertkeyfile: /etc/apache2/ssl/myserver.pem
site_domain: sip.yourdomain.tld
display_account_info: 0
sip_server: sip.yourdomain.tld
tftp_server: tftp.yourdomain.tld
payment_features: 0
cc_dial_prefix: 00
ac_dial_prefix: 0
site_config:
title: Sipwise NGCP CSC
default_language: en
default_uri: '/desktop'
languages:
- en
- es
company:
name: Your Company
logo: 'https://some.server/path/to/logo.gif'
hotline: ''
city: ''
street: ''
phone: ''
fax: ''
email: ''
webserver: ''
main_menu:
desktop: 1
calllist: 1
voicebox: 1
addressbook: 1
callforward: 1
callblock: 1
reminder: 1
device: 0
account: 1
logging:
apache:
err:
facility: local7
level: info
acc:
facility: daemon
level: info
identity: csc
rtpproxy:
minport: 30000
maxport: 40000
sems:
bindport: 5080
lowport: 40001
highport: 50000
xmlrpcport: 8090
vsc:
voicemail_number: 2000
cfu_code: 72
cfb_code: 90
cft_code: 92
cfna_code: 93
speedial_code: 50
reminder_code: 55
rsyslog:
external_log: 0
external_address: 192.168.32.1
external_proto: udp
external_port: 514
external_loglevel: warning
reminder:
retries: 2
retry_time: 60
wait_time: 30
sip_fromuser: reminder
sip_fromdomain: voicebox.sipwise.local
checktools:
sip_check_enable: 1
mysql_check_enable: 1
mpt_check_enable: 0
exim_check_enable: 0
kamailio_check_dialog_active_enable: 1
kamailio_check_dialog_early_enable: 0
kamailio_check_usrloc_regusers_enable: 1
kamailio_check_usrloc_regdevices_enable: 0
oss_check_provisioned_subscribers_enable: 1
force: 0
mysql_check_replication: 1
kamailio_check_dialog_local_enable: 0
kamailio_check_dialog_relay_enable: 0
kamailio_check_dialog_incoming_enable: 0
kamailio_check_dialog_outgoing_enable: 0
collcheck:
maxage: 600
cpuidle: 0.1
swapfree: 0.5
dfused: 0.9
memused: 0.7
loadshort: 3
loadmedium: 2
loadlong: 2
siptimeout: 15
eximmaxqueue: 15
cdrexport:
exportpath: '/home/jail/home/cdrexport'
filepreffix: sipwise
fileversion: 001
monthly_folder: yes
daily_folder: yes
cleanuptools:
batch: 10000
archive_targetdir: '/tmp'
compress: gzip
acc_days: 90
trash_days: 30
acc2_days: 180
general:
companyname: sipwise
lang: en
adminmail: nomail@nodomain.org
# vim: ft=yaml

@ -1,129 +0,0 @@
#############################
#
# DO NOT EDIT THIS FILE!!
#
# This file contains some values not being handled by the ngcp configuration framework.
# Editing this file may cause your system to stop working.
# Do not manually edit this file unless you know what you're doing.
#
#
############################
database:
dbhost: localhost
dbport: 3306
kamailio:
dbengine: MYSQL
dbname: kamailio
dbrootuser: root
dbropw: jJXgh7AAmkJ4KCMWYHCX
dbrouser: kamailioro
dbrwpw: g7PYspcXhLRNjgwPghkx
dbrwuser: kamailio
uaccryptpw: UwrpwmpCUMhfv4zscuha
asterisk:
odbc:
dbuser: asterisk
dbpassword: cx9W7PWMmkjRVpzzYkts
dbname: kamailio
mediator:
dbuser: mediator
dbpassword: AcMcrhbzXhUmTvTf9gsm
srcdbname: kamailio
destdbname: accounting
provdbname: provisioning
rateomat:
billingdb:
name: billing
user: rateomat
pass: dn7iM9YgPcJhmHXo9eWr
accountingdb:
name: accounting
user: rateomat
pass: dn7iM9YgPcJhmHXo9eWr
provisioningdb:
name: provisioning
user: rateomat
pass: dn7iM9YgPcJhmHXo9eWr
mysql:
repuser: replicator
reppassword: KtXpr3jT7jtcd7PmnTbd
ossbss:
provisioning:
database:
name: provisioning
user: soap
pass: hEuxXrzLF43X93ULhoNu
billingdb:
name: billing
user: soap
pass: hEuxXrzLF43X93ULhoNu
openserdb:
name: kamailio
user: soap
pass: hEuxXrzLF43X93ULhoNu
acl:
- user: csc
pass: RMYisfV4rvpWYVKosYnU
allow:
- Voip
- Billing
fax:
sendfax: /usr/bin/sendfax
faxserver: 127.0.0.1
default_sender: webfax
routing:
internal_domain: voip.sipwise.local
no_such_number: no_such_number
voicebox_domain: voicebox.local
fax2mail_domain: fax2mail.local
conference_domain: conference.local
backends:
available:
- Billing
- Voip
enabled:
- Billing
- Voip
www_csc:
prov_user: csc
prov_pass: RMYisfV4rvpWYVKosYnU
sems:
dbuser: soap
dbpassword: hEuxXrzLF43X93ULhoNu
rsyslog:
dbname: syslog
dbuser: rsyslog
dbpassword: bAmjr7gTaevK4tFofkaP
rotate_days: 28
reminder:
context: reminder
sip_peer: sip_proxy
dbname: provisioning
dbuser: soap
dbpassword: hEuxXrzLF43X93ULhoNu
checktools:
dbuser: nagios
dbpassword: XM4s47qEyJrckCoqPVYe
sipuser: nagios
sipdomain: voip.sipwise.local
sip_check_ip: 127.0.0.1
cdrexport:
dbuser: exporter
dbpassword: zghivhVEv7fPMRiLAPRR
dbname: accounting
cleanuptools:
dbuser: dbcleaner
dbpassword: q43aaqRucmTmYz9gvJhe
acc_db: kamailio
trash_db: kamailio
#### Do not touch this! ####
configuration_framework:
constants_version: 4083
config_version: 4083
# vim: ft=yaml

@ -1,18 +0,0 @@
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
59 23 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

@ -1,170 +0,0 @@
[client]
port = [% database.dbport %]
socket = /run/mysqld/mysqld.sock
default_character_set = utf8
#----------------------------------------------------------------
[safe_mysqld]
syslog
#----------------------------------------------------------------
[mysqld]
user = mysql
port = [% database.dbport %]
socket = /run/mysqld/mysqld.sock
max_connections = 2048
back_log = 128
max_connect_errors = 1000
connect_timeout = 2
wait_timeout = 60
max_allowed_packet = 16M
net_buffer_length = 8K
default_character_set = utf8
character_set_server = utf8
default_collation = utf8_general_ci
init_connect = 'SET NAMES utf8; SET sql_mode = STRICT_TRANS_TABLES'
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
log-error = /var/log/mysql/mysqld.err
pid-file = /run/mysqld/mysqld.pid
log_slow_queries = /var/log/mysql/slow-queries.log
log_output = FILE
long_query_time = 5
log_long_format
#log = /var/log/mysql/queries.log
#Binlog options
log_bin = /var/lib/mysql/log-bin
max_binlog_size = 512M
expire_logs_days = 90 #Values 0-99
binlog_format = row
binlog_cache_size = 1M
sync_binlog = 1
relay_log = /var/lib/mysql/log-relay-bin
max_relay_log_size = 512M
#Replication options
server_id = 1
auto_increment_offset = 1
auto_increment_increment = 2
master-host = sp2
master-port=[% database.dbport %]
master-user=[% mysql.repuser %]
master-password=[% mysql.reppassword %]
master-connect-retry=10
replicate-wild-do-table=kamailio.%
replicate-wild-do-table=provisioning.%
replicate-wild-do-table=operating.%
replicate-wild-do-table=billing.%
replicate-wild-do-table=accounting.%
replicate-wild-do-table=syslog.%
replicate-ignore-table=accounting.acc_backup
replicate-ignore-table=accounting.acc_trash
replicate-ignore-table=kamailio.acc_backup
replicate-ignore-table=kamailio.acc_trash
table_cache = 4096
join_buffer_size = 8M
tmp_table_size = 64M
sort_buffer_size = 8M
thread_cache_size = 64
thread_concurrency = 8
thread_stack = 192K
# Query cache, disabled
query_cache_size = 0
query_cache_type = 1
query_cache_limit = 2M
transaction_isolation = REPEATABLE-READ
# MyISAM options
key_buffer_size = 256M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 128M
bulk_insert_buffer_size = 64M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 2
#myisam_recover_options = DEFAULT
# InnoDB options
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table
innodb_buffer_pool_size = [% database.bufferpoolsize %]
innodb_additional_mem_pool_size = 32M
innodb_log_group_home_dir = /var/lib/mysql
innodb_log_files_in_group = 4
innodb_log_file_size = 128M
innodb_log_buffer_size = 8M
innodb_max_dirty_pages_pct = 80
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_flush_method = O_DIRECT
innodb_thread_concurrency = 32
innodb_autoinc_lock_mode = 1
innodb_locks_unsafe_for_binlog
innodb_fast_shutdown = 1
innodb_max_purge_lag = 0
#----------------------------------------------------------------
[mysqldump]
quick
max_allowed_packet = 16M
single_transaction
#----------------------------------------------------------------
[mysql]
#no_auto_rehash
#----------------------------------------------------------------
[myisamchk]
# databases
key_buffer = 256M
sort_buffer = 256M
read_buffer = 64M
write_buffer = 64M

@ -1,170 +0,0 @@
[client]
port = [% database.dbport %]
socket = /run/mysqld/mysqld.sock
default_character_set = utf8
#----------------------------------------------------------------
[safe_mysqld]
syslog
#----------------------------------------------------------------
[mysqld]
user = mysql
port = [% database.dbport %]
socket = /run/mysqld/mysqld.sock
max_connections = 2048
back_log = 128
max_connect_errors = 1000
connect_timeout = 2
wait_timeout = 60
max_allowed_packet = 16M
net_buffer_length = 8K
default_character_set = utf8
character_set_server = utf8
default_collation = utf8_general_ci
init_connect = 'SET NAMES utf8; SET sql_mode = STRICT_TRANS_TABLES'
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
log-error = /var/log/mysql/mysqld.err
pid-file = /run/mysqld/mysqld.pid
log_slow_queries = /var/log/mysql/slow-queries.log
log_output = FILE
long_query_time = 5
log_long_format
#log = /var/log/mysql/queries.log
#Binlog options
log_bin = /var/lib/mysql/log-bin
max_binlog_size = 512M
expire_logs_days = 90 #Values 0-99
binlog_format = row
binlog_cache_size = 1M
sync_binlog = 1
relay_log = /var/lib/mysql/log-relay-bin
max_relay_log_size = 512M
#Replication options
server_id = 2
auto_increment_offset = 2
auto_increment_increment = 2
master-host = sp1
master-port=[% database.dbport %]
master-user=[% mysql.repuser %]
master-password=[% mysql.reppassword %]
master-connect-retry=10
replicate-wild-do-table=kamailio.%
replicate-wild-do-table=provisioning.%
replicate-wild-do-table=operating.%
replicate-wild-do-table=billing.%
replicate-wild-do-table=accounting.%
replicate-wild-do-table=syslog.%
replicate-ignore-table=accounting.acc_backup
replicate-ignore-table=accounting.acc_trash
replicate-ignore-table=kamailio.acc_backup
replicate-ignore-table=kamailio.acc_trash
table_cache = 4096
join_buffer_size = 8M
tmp_table_size = 64M
sort_buffer_size = 8M
thread_cache_size = 64
thread_concurrency = 8
thread_stack = 192K
# Query cache, disabled
query_cache_size = 0
query_cache_type = 1
query_cache_limit = 2M
transaction_isolation = REPEATABLE-READ
# MyISAM options
key_buffer_size = 256M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 128M
bulk_insert_buffer_size = 64M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 2
#myisam_recover_options = DEFAULT
# InnoDB options
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table
innodb_buffer_pool_size = [% database.bufferpoolsize %]
innodb_additional_mem_pool_size = 32M
innodb_log_group_home_dir = /var/lib/mysql
innodb_log_files_in_group = 4
innodb_log_file_size = 128M
innodb_log_buffer_size = 8M
innodb_max_dirty_pages_pct = 80
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_flush_method = O_DIRECT
innodb_thread_concurrency = 32
innodb_autoinc_lock_mode = 1
innodb_locks_unsafe_for_binlog
innodb_fast_shutdown = 1
innodb_max_purge_lag = 0
#----------------------------------------------------------------
[mysqldump]
quick
max_allowed_packet = 16M
single_transaction
#----------------------------------------------------------------
[mysql]
#no_auto_rehash
#----------------------------------------------------------------
[myisamchk]
# databases
key_buffer = 256M
sort_buffer = 256M
read_buffer = 64M
write_buffer = 64M

@ -1,5 +0,0 @@
#!/bin/bash
ngcp-service mysql restart
# vim: ft=sh

@ -1,16 +0,0 @@
log4perl.logger.Sipwise.Provisioning = [% ossbss.logging.ossbss.level %], ProvSyslogApp
log4perl.appender.ProvSyslogApp = Log::Dispatch::Syslog
log4perl.appender.ProvSyslogApp.facility = [% ossbss.logging.ossbss.facility %]
log4perl.appender.ProvSyslogApp.ident = [% ossbss.logging.ossbss.identity %]
log4perl.appender.ProvSyslogApp.layout = PatternLayout
log4perl.appender.ProvSyslogApp.layout.ConversionPattern = %M: %m%n
log4perl.logger.Catalyst = WARN, CatalystSyslogApp
log4perl.logger.csc = [% ossbss.logging.web.level %], CatalystSyslogApp
log4perl.logger.admin = [% ossbss.logging.web.level %], CatalystSyslogApp
log4perl.appender.CatalystSyslogApp = Log::Dispatch::Syslog
log4perl.appender.CatalystSyslogApp.facility = [% ossbss.logging.web.facility %]
log4perl.appender.CatalystSyslogApp.layout = PatternLayout

@ -1,21 +0,0 @@
#!/bin/bash
MYSQL_USER='sipwise'
. /etc/mysql/sipwise.cnf
. /etc/ngcp-ossbss/mysql_values.cfg
#dispatcher values reloaded
MYCOM="mysql -u$MYSQL_USER -p$SIPWISE_DB_PASSWORD kamailio -e"
$MYCOM "update dispatcher set destination='sip:$EADDRESS:$ASTERISK_PORT' where setid='2' "
$MYCOM "update dispatcher set destination='sip:$EADDRESS:$SEMS_PORT' where setid='3' "
#xmlrcp values reloaded
#sems ip does not need to change
#kamailio rpc port not configurable at the moment
MYCOM="mysql -u$MYSQL_USER -p$SIPWISE_DB_PASSWORD provisioning -e"
$MYCOM "update xmlhosts set ip='$EADDRESS' where id='1' "
$MYCOM "update xmlhosts set port='$SEMS_XMLRPCPORT' where id='2' "
ngcp-service kamailio restart
sleep 2

@ -1,4 +0,0 @@
EADDRESS='[% networking.eaddress %]'
ASTERISK_PORT='[% asterisk.sip.bindport %]'
SEMS_PORT='[% sems.bindport %]'
SEMS_XMLRPCPORT='[% sems.xmlrpcport %]'

@ -1,65 +0,0 @@
<config logconf="/etc/ngcp-ossbss/logging.conf"
usrprefs_as_number="1"
speed_dial_destinations_as_number="1"
log_passwords="[% ossbss.provisioning.log_passwords %]"
no_logline_truncate="[% ossbss.provisioning.no_logline_truncate %]"
allow_ip_as_domain="[% ossbss.provisioning.allow_ip_as_domain %]"
allow_numeric_usernames="[% ossbss.provisioning.allow_numeric_usernames %]"
tmpdir="[% ossbss.provisioning.tmpdir %]"
fax_features="[% www_admin.fax_features %]"
faxpw_min_char="[% ossbss.provisioning.faxpw_min_char %]"
prov_data_typing="1"
voicemail_map_via_number="0"
apache_port="[% ossbss.apache.port %]"
customer_features="0"
product_features="0"
numberblock_features="0"
lnp_features="0"
>
<database dsn="DBI:mysql:database=[% ossbss.provisioning.database.name %];host=[% database.dbhost %];port=[% database.dbport %]"
username="[% ossbss.provisioning.database.user %]"
password="[% ossbss.provisioning.database.pass %]" />
<billingdb dsn="DBI:mysql:database=[% ossbss.provisioning.billingdb.name %];host=[% database.dbhost %];port=[% database.dbport %]"
username="[% ossbss.provisioning.billingdb.user %]"
password="[% ossbss.provisioning.billingdb.pass %]" />
<openserdb dsn="DBI:mysql:database=[% ossbss.provisioning.openserdb.name %];host=[% database.dbhost %];port=[% database.dbport %]"
username="[% ossbss.provisioning.openserdb.user %]"
password="[% ossbss.provisioning.openserdb.pass %]" />
<acl>
[% FOREACH aclentry = ossbss.provisioning.acl %]
<[% aclentry.user %] password="[% aclentry.pass %]" [% FOREACH aclallow = aclentry.allow %][% aclallow %]="" [% END %] />
[% END %]
</acl>
<invoice template="/usr/local/etc/corporate.pdf" />
<fax sendfax="[% ossbss.provisioning.fax.sendfax %]"
faxserver="[% ossbss.provisioning.fax.faxserver %]"
default_sender="[% ossbss.provisioning.fax.default_sender %]" />
<vsc>
<actions>error</actions>
<actions>unknown</actions>
<actions>cfu_on</actions>
<actions>cfu_off</actions>
<actions>cfb_on</actions>
<actions>cfb_off</actions>
<actions>cft_on</actions>
<actions>cft_off</actions>
<actions>cfna_on</actions>
<actions>cfna_off</actions>
<actions>reminder_on</actions>
<actions>reminder_off</actions>
</vsc>
<routing internal_domain="[% ossbss.provisioning.routing.internal_domain %]"
no_such_number="[% ossbss.provisioning.routing.no_such_number %]"
voicebox_domain="[% ossbss.provisioning.routing.voicebox_domain %]"
fax2mail_domain="[% ossbss.provisioning.routing.fax2mail_domain %]"
conference_domain="[% ossbss.provisioning.routing.conference_domain %]"
cc_regex="[% ossbss.provisioning.routing.cc_regex %]"
ac_regex="[% ossbss.provisioning.routing.ac_regex %]"
sn_regex="[% ossbss.provisioning.routing.sn_regex %]"
/>
<reserved_usernames>voicebox</reserved_usernames>
<system rrd_path="/var/lib/collectd/rrd" />
[% FOREACH backend = ossbss.provisioning.backends.enabled %]
<backends_enabled>[% backend %]</backends_enabled>
[% END %]
</config>

@ -1,4 +0,0 @@
[% FOREACH htentry = ossbss.htpasswd %]
[% htentry.user %]:[% htentry.pass %]
[% END %]

@ -1,40 +0,0 @@
<config debugging="0"
log4perlconf="/etc/ngcp-ossbss/logging.conf"
billing_features="[% www_admin.billing_features %]"
peering_features="[% www_admin.peering_features %]"
voicemail_features="[% www_admin.voicemail_features %]"
fax_features="[% www_admin.fax_features %]"
conference_features="[% www_admin.conference_features %]"
customer_features="0"
product_features="0"
numberblock_features="0"
lnp_features="0"
cc_dial_prefix="[% www_admin.cc_dial_prefix %]"
ac_dial_prefix="[% www_admin.ac_dial_prefix %]"
voicebox_domain="[% ossbss.provisioning.routing.voicebox_domain %]"
fax2mail_domain="[% ossbss.provisioning.routing.fax2mail_domain %]"
conference_domain="[% ossbss.provisioning.routing.conference_domain %]"
>
<dashboard enabled="[% www_admin.dashboard.enable %]" />
<subscriber extension_features="[% www_admin.subscriber.extension_features %]"
audiofile_features="[% www_admin.subscriber.audiofile_features %]"
/>
<domain rewrite_features="[% www_admin.domain.rewrite_features %]"
audiofile_features="[% www_admin.domain.audiofile_features %]"
vsc_features="[% www_admin.domain.vsc_features %]"
/>
<default_admin_settings is_master="[% www_admin.default_admin_settings.is_master %]" is_active="[% www_admin.default_admin_settings.is_active %]"
read_only="[% www_admin.default_admin_settings.read_only %]" show_passwords="[% www_admin.default_admin_settings.show_passwords %]"
call_data="[% www_admin.default_admin_settings.call_data %]" />
<fees_csv>
[% FOREACH feecsvelement = www_admin.fees_csv.element_order %]
<element_order>[% feecsvelement %]</element_order>
[% END %]
</fees_csv>
<speed_dial_vsc_presets>
[% FOREACH speeddialvsc = www_admin.speed_dial_vsc_presets.vsc %]
<vsc>[% speeddialvsc %]</vsc>
[% END %]
</speed_dial_vsc_presets>
</config>

@ -1,31 +0,0 @@
# Filename: /etc/ngcp-config/ngcpcfg.cfg
# Purpose: main configuration file for ngcpcfg tools
# Note: do not modify unless you have a really good reason to do so
# directory name where ngcpcfg is managed through git
NGCPCTL_MAIN='./ngcp-config'
NGCPCTL_CONFIG="${NGCPCTL_MAIN}/config.yml"
HOST_CONFIG="${NGCPCTL_MAIN}/config.$(hostname).yml"
LOCAL_CONFIG="${NGCPCTL_MAIN}/config.local.yml"
CONSTANTS_CONFIG="${NGCPCTL_MAIN}/constants.yml"
# configuration files that should be managed
CONFIG_POOL='/tmp/output'
# location of templates
TEMPLATE_POOL_BASE="${NGCPCTL_MAIN}/templates/testsuite"
# location of service definitions
SERVICES_POOL_BASE="${NGCPCTL_MAIN}/templates/testsuite"
## NOTE: only supported with ngcp-ngcpcfg-ha
# supported values: {true,false}
SHARED_STORAGE='true'
# name of shared storage
GLUSTERFS='./glusterfs'
# name of shared storage repository
NGCPCTL_SHARE="${GLUSTERFS}/ngcpcfg-share"
## END OF FILE #################################################################

@ -1,83 +0,0 @@
#!/bin/bash
set -e
set -u
# when invoked under DEBUG_SHELL=1 then provide
# interactive shell before exiting
if [ -n "${DEBUG_SHELL:-}" ] ; then
bailout() { bash; exit 1; }
else
bailout() { exit 1; }
fi
testsuite="$(dirname "${PWD}/$0")"
export testsuite
TMPDIR="$(mktemp -d)"
echo "Switching to temporary directory $TMPDIR"
cd "$TMPDIR"
cp -a "${testsuite}"/* .
export FUNCTIONS="$testsuite/../functions/"
export HELPER="$testsuite/../helper/"
export HOOKS="$testsuite/../hooks/"
export SCRIPTS="$testsuite/../scripts/"
echo -n "Testing ngcpcfg without any arguments: "
if "$testsuite"/../sbin/ngcpcfg 2>&1 | grep -q "^Usage:$" ; then
echo OK
else
echo "Error with executing ngcpcfg without any arguments" >&2
bailout
fi
echo -n "Testing ngcpcfg --help: "
if "$testsuite"/../sbin/ngcpcfg --help 2>&1 | grep -q "^Usage:$" ; then
echo OK
else
echo "Error with executing ngcpcfg --help" >&2
bailout
fi
echo -n "Testing ngcpcfg --version: "
if "$testsuite"/../sbin/ngcpcfg --version 2>&1 | grep -q "version" ; then
echo OK
else
echo "Error with executing ngcpcfg --version" >&2
bailout
fi
for action in values get ; do
echo "Testing ngcpcfg ${action} database.dbhost"
value=$("$testsuite"/../sbin/ngcpcfg "${action}" database.dbhost)
if [ "${value}" != "localhost" ] ; then
echo "Error caught: database.dbhost != 'localhost' (action '${action}')"
bailout
fi
echo "Testing ngcpcfg ${action} ossbss.provisioning.database.user"
value=$("$testsuite"/../sbin/ngcpcfg "${action}" ossbss.provisioning.database.user)
if [ "${value}" != "soap" ] ; then
echo "Error caught: ossbss.provisioning.database.user != 'soap' (action '${action}')"
bailout
fi
echo "Testing ngcpcfg ${action} www_admin.fees_csv.element_order"
value=$("$testsuite"/../sbin/ngcpcfg "${action}" www_admin.fees_csv.element_order)
if [ "${value}" != "destination zone zone_detail onpeak_init_rate \
onpeak_init_interval onpeak_follow_rate onpeak_follow_interval \
offpeak_init_rate offpeak_init_interval offpeak_follow_rate \
offpeak_follow_interval use_free_time" ] ;
then
echo "Error caught: www_admin.fees_csv.element_order != expected value (action '${action}')"
bailout
fi
done
rm -rf "$TMPDIR"
echo "Everything seems to be ok."
# EOF
Loading…
Cancel
Save