Skip to content

Commit

Permalink
another test message
Browse files Browse the repository at this point in the history
  • Loading branch information
portertech committed Aug 6, 2011
1 parent 5df3764 commit 3f48710
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/syslog_test.js
Expand Up @@ -8,11 +8,14 @@ var options = require("nomnom").opts({
}
}).parseArgs()

var message = new Buffer("<71>Nov 23 17:22:23 pirate_ship-127-0-0-1 all the piracy. none of the scurvy! all ye be walkin the plank if me timbers be shiverin. polly does not want a cracker but i will taketh one from ye.")
var messages = []
messages.push(new Buffer("<71>Nov 23 17:22:23 pirate_ship-127-0-0-1 all the piracy. none of the scurvy! all ye be walkin the plank if me timbers be shiverin. polly does not want a cracker but i will taketh one from ye."))
messages.push(new Buffer("<56>Nov 23 17:22:24 red_stone-127-0-0-1 tired of constantly buying batteries for automatic doors and deathtraps."))

var syslog = dgram.createSocket("udp4")
var syslogPort = parseInt(process.env.TAILS_SYSLOG_PORT) || options.syslog
setInterval(function() {
message = messages[Math.floor(Math.random()*messages.length)]
syslog.send(message, 0, message.length, syslogPort, '127.0.0.1',
function (err, bytes) {
if (err) {
Expand Down

0 comments on commit 3f48710

Please sign in to comment.