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 -%]