From 2b2e1def1059f3fc66fa3b02357aa483b59c5f62 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Mon, 16 Oct 2017 13:44:05 +0200 Subject: [PATCH] TT#22018 Add system-test to check asterisk ODBC connection on PRO/Carrier Check node with role PROXY only, as another nodes has no asterisk running. Change-Id: I484cc10afda4ec47227177ddd37866fa64a61fa3 --- .../920_service-asterisk-odbc-pro.yaml.tt2 | 34 +++++++++++++++++++ templates/goss.yaml.tt2 | 3 ++ 2 files changed, 37 insertions(+) create mode 100644 templates/920_service-asterisk-odbc-pro.yaml.tt2 diff --git a/templates/920_service-asterisk-odbc-pro.yaml.tt2 b/templates/920_service-asterisk-odbc-pro.yaml.tt2 new file mode 100644 index 0000000..2a84f08 --- /dev/null +++ b/templates/920_service-asterisk-odbc-pro.yaml.tt2 @@ -0,0 +1,34 @@ +[% + PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; + hostname = out; + + argv.host = hostname; + argv.role = 'proxy'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_proxy = out; +-%] +[% PERL -%] + my $node_state = qx(ngcp-check_active -v); + chomp $node_state; + + $stash->set(node_state => $node_state); +[% END -%] + +command: + +[% IF is_proxy && asterisk.enabled == "yes" && node_state == 'active' -%] + asterisk -rx "voicemail show users for default": + exit-status: 0 + stdout: + - "/Configured Voicemail Users/" + stderr: [] + timeout: 10000 + +[% ELSE -%] + echo "The test for active node with enabled asterisk and proxy role only": + exit-status: 0 + stdout: [] + stderr: [] + timeout: 10000 + +[% END -%] \ No newline at end of file diff --git a/templates/goss.yaml.tt2 b/templates/goss.yaml.tt2 index a653f20..fcd2b27 100644 --- a/templates/goss.yaml.tt2 +++ b/templates/goss.yaml.tt2 @@ -36,3 +36,6 @@ gossfile: [% END -%] 900_service-ngcp-api.yaml: {} 910_service-influxdb.yaml: {} +[% IF general.ngcp_type != 'spce' -%] + 920_service-asterisk-odbc-pro.yaml: {} +[% END -%]