diff --git a/test/test-std.js b/test/test-std.js new file mode 100644 index 0000000..3ba606e --- /dev/null +++ b/test/test-std.js @@ -0,0 +1,29 @@ +var proto='http'; +//var host='localhost'; +var host ='ag-0.de' + +if (proto=='http') { + p=port(DIR.IP('http://localhost:*')) + connect(DIR.IP('http://'+host+':10001')) +} else { + p=port(DIR.IP('udp://localhost:*')) + connect(DIR.IP('udp://'+host+':10002')) +} +var counter=0; +function postit(what) { + return function (msg) { + print(what,msg); + counter++; if (counter==4) exit() + } +} +on('link+',function () { + var nodes = connected(DIR.IP('%')); + print(nodes) + if (nodes.length) { + Std.info(nodes[0],'node',postit('std.info node')) + Std.status(nodes[0],'node',postit('std.status node')) + Std.status(nodes[0],'agents',postit('std.status agents')) + Std.status(nodes[0],'links',postit('std.status links')) + } +}) +print('Done')