Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
davehorton committed Jun 26, 2024
1 parent ddc6bc1 commit 0e3c0b4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,6 @@ module.exports = function(mysqlConfig, logger, writeMysqlConfig = null) {
lookupCarrierByAccountLcr: require('./lib/lookup-carrier-by-account-lcr').bind(null, pool, logger),
lookupOutboundCarrierForAccount: require('./lib/lookup-outbound-carrier-for-account').bind(null, pool, logger),
lookupClientByAccountAndUsername: require('./lib/lookup-client-by-account-username').bind(null, pool, logger),
lookupSystemInformation: require('./lib/lookup-system-information').bind(null, pool, logger),
};
};
Empty file.
4 changes: 3 additions & 1 deletion test/db/populate-test-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ insert into phone_numbers (phone_number_sid, number, voip_carrier_sid, account_s
values ('5cd93593-fe66-443c-9ab3-4f52c13c3d28', '15083084809', '287c1452-620d-4195-9f19-c9814ef90d78', '422affb5-4d1e-45e8-b2a4-2623f08b95ef', '3b43e39f-4346-4218-8434-a53130e8be49');

insert into ms_teams_tenants (ms_teams_tenant_sid,service_provider_sid,account_sid,application_sid,tenant_fqdn)
values ('11446d20-9c92-4a33-80f3-90d0132a0b83','7e306626-4ee9-471b-af8d-27d9f6042fc9','422affb5-4d1e-45e8-b2a4-2623f08b95ef','3b43e39f-4346-4218-8434-a53130e8be49','daveh.customers.drachtio.org');
values ('11446d20-9c92-4a33-80f3-90d0132a0b83','7e306626-4ee9-471b-af8d-27d9f6042fc9','422affb5-4d1e-45e8-b2a4-2623f08b95ef','3b43e39f-4346-4218-8434-a53130e8be49','daveh.customers.drachtio.org');

insert into system_information (domain_name, sip_domain_name, monitoring_domain_name) values ('jambonz.xyz', 'sip.jambonz.xyz', 'grafana.jambonz.xyz');
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require('./docker_start');
require('./create-test-db');
require('./ping');
require('./system-information');
require('./clients');
require('./lookup-lcr');
require('./query-call-limits');
Expand Down
25 changes: 25 additions & 0 deletions test/system-information.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const test = require('tape').test ;
const config = require('config');
const mysqlOpts = config.get('mysql');

process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
});


test('system_information tests', async(t) => {
const fn = require('..');
const {
lookupSystemInformation
} = fn(mysqlOpts);
try {
let info = await lookupSystemInformation();
console.log({info});
t.ok(info.length === 1 && info[0].domain === 'jambonz.xyz', 'found system information');

t.end();
}
catch (err) {
t.end(err);
}
});

0 comments on commit 0e3c0b4

Please sign in to comment.