Skip to content

Commit

Permalink
Swap out test pcap file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Kunkle committed Jan 5, 2012
1 parent dc1cb4e commit 24ad394
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test/pcap-parser.js
Expand Up @@ -6,7 +6,7 @@ var pcapp = require('../index.js');


vows.describe('pcap-parser').addBatch({ vows.describe('pcap-parser').addBatch({
'given a readable stream of a pcap file': { 'given a readable stream of a pcap file': {
topic: new pcapp.Parser(fs.createReadStream(path.join(__dirname, 'test.pcap'))), topic: new pcapp.Parser(fs.createReadStream(path.join(__dirname, 'smtp.pcap'))),


'the parser should emit globalHeader events': { 'the parser should emit globalHeader events': {
topic: function(parser) { topic: function(parser) {
Expand All @@ -22,7 +22,7 @@ vows.describe('pcap-parser').addBatch({
assert.equal(header.gmtOffset, 0); assert.equal(header.gmtOffset, 0);
assert.equal(header.timestampAccuracy, 0); assert.equal(header.timestampAccuracy, 0);
assert.equal(header.snapshotLength, 65535); assert.equal(header.snapshotLength, 65535);
assert.equal(header.linkLayerType, 127); assert.equal(header.linkLayerType, 1);
} }
}, },


Expand All @@ -34,10 +34,10 @@ vows.describe('pcap-parser').addBatch({


'packet header values should be correct': function(packetHeader) { 'packet header values should be correct': function(packetHeader) {
assert.isNotNull(packetHeader); assert.isNotNull(packetHeader);
assert.equal(packetHeader.timestampSeconds, 1325709927); assert.equal(packetHeader.timestampSeconds, 1254722767);
assert.equal(packetHeader.timestampMicroseconds, 299312); assert.equal(packetHeader.timestampMicroseconds, 492060);
assert.equal(packetHeader.includedLength, 129); assert.equal(packetHeader.includedLength, 76);
assert.equal(packetHeader.originalLength, 129); assert.equal(packetHeader.originalLength, 76);
} }
}, },


Expand All @@ -49,7 +49,7 @@ vows.describe('pcap-parser').addBatch({


'packet data buffer should not be empty': function(packetData) { 'packet data buffer should not be empty': function(packetData) {
assert.isNotNull(packetData); assert.isNotNull(packetData);
assert.equal(packetData.length, 129); assert.equal(packetData.length, 76);
} }
}, },


Expand All @@ -63,11 +63,11 @@ vows.describe('pcap-parser').addBatch({
assert.isNotNull(packet); assert.isNotNull(packet);
assert.isDefined(packet.header); assert.isDefined(packet.header);
assert.isDefined(packet.data); assert.isDefined(packet.data);
assert.equal(packet.header.timestampSeconds, 1325709927); assert.equal(packet.data.length, 76);
assert.equal(packet.header.timestampMicroseconds, 299312); assert.equal(packet.header.timestampSeconds, 1254722767);
assert.equal(packet.header.includedLength, 129); assert.equal(packet.header.timestampMicroseconds, 492060);
assert.equal(packet.header.originalLength, 129); assert.equal(packet.header.includedLength, 76);
assert.isTrue(packet.data.length > 0); assert.equal(packet.header.originalLength, 76);
} }
}, },


Expand All @@ -92,14 +92,14 @@ vows.describe('pcap-parser').addBatch({
parser.parse(); parser.parse();
}, },


'it should process 10151 packets': function(count) { 'it should process 60 packets': function(count) {
assert.equal(count, 10151); assert.equal(count, 60);
} }
} }
}, },


'given a path to a pcap file': { 'given a path to a pcap file': {
topic: new pcapp.Parser(path.join(__dirname, 'test.pcap')), topic: new pcapp.Parser(path.join(__dirname, 'smtp.pcap')),


'the parser should emit all the same events': { 'the parser should emit all the same events': {
topic: function(parser) { topic: function(parser) {
Expand Down
Binary file added test/smtp.pcap
Binary file not shown.
Binary file removed test/test.pcap
Binary file not shown.

0 comments on commit 24ad394

Please sign in to comment.