Skip to content

Commit

Permalink
[iface] test networkInterface property on discovered services
Browse files Browse the repository at this point in the history
  • Loading branch information
agnat committed Dec 24, 2012
1 parent 89e8ac5 commit c87ffc7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_functional.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var mdns_test = require('../utils/lib/mdns_test') var mdns_test = require('../utils/lib/mdns_test')
, mdns = mdns_test.require('mdns') , mdns = mdns_test.require('mdns')
, util = require('util') , util = require('util')
, os = require('os')
; ;


exports['simple browsing'] = function(t) { exports['simple browsing'] = function(t) {
Expand Down Expand Up @@ -67,6 +68,9 @@ exports['simple browsing'] = function(t) {
t.strictEqual(service.replyDomain, 'local.', t.strictEqual(service.replyDomain, 'local.',
"'replyDomain' must match 'local.'"); "'replyDomain' must match 'local.'");


t.strictEqual(typeof service.networkInterface, 'string',
'must have a networkInterface');

t.ok(ctx, 'must have context'); t.ok(ctx, 'must have context');
t.strictEqual(ctx.some, 'context', 'property must match input'); t.strictEqual(ctx.some, 'context', 'property must match input');


Expand Down Expand Up @@ -114,6 +118,10 @@ exports['simple browsing'] = function(t) {
"'rawTxtRecord' must be truthy"); "'rawTxtRecord' must be truthy");
t.ok(service.txtRecord, t.ok(service.txtRecord,
"'txtRecord' must be truthy"); "'txtRecord' must be truthy");

t.strictEqual(typeof service.networkInterface, 'string',
'must have a networkInterface');

var p; var p;
for (p in txt_record) { for (p in txt_record) {
t.strictEqual('' + txt_record[p], service.txtRecord[p], t.strictEqual('' + txt_record[p], service.txtRecord[p],
Expand Down Expand Up @@ -144,6 +152,9 @@ exports['simple browsing'] = function(t) {
t.strictEqual(service.replyDomain, 'local.', t.strictEqual(service.replyDomain, 'local.',
"'replyDomain' must match 'local.'"); "'replyDomain' must match 'local.'");


t.strictEqual(typeof service.networkInterface, 'string',
'must have a networkInterface');

t.ok(ctx, 'must have context'); t.ok(ctx, 'must have context');
t.strictEqual(ctx.some, 'context', 'property must match input'); t.strictEqual(ctx.some, 'context', 'property must match input');


Expand All @@ -163,7 +174,6 @@ exports['simple browsing'] = function(t) {
ad.start(); ad.start();
} }



exports['create ads'] = function(t) { exports['create ads'] = function(t) {
var timeout = 500 // ms var timeout = 500 // ms
, counter = 0 , counter = 0
Expand Down Expand Up @@ -200,7 +210,6 @@ exports['create ads'] = function(t) {


var ad = this; var ad = this;
setTimeout(function(){ ad.stop(); stopIfDone(); }, timeout); setTimeout(function(){ ad.stop(); stopIfDone(); }, timeout);
//console.log(service)
}); });
ad3.start(); ad3.start();


Expand Down

0 comments on commit c87ffc7

Please sign in to comment.