2010-10-24 08:21:01 +08:00
|
|
|
require(__dirname+'/test-helper');
|
|
|
|
|
|
|
|
test('cleartext password authentication', function(){
|
|
|
|
|
|
|
|
var client = createClient();
|
|
|
|
client.password = "!";
|
2010-10-25 11:52:12 +08:00
|
|
|
client.connection.stream.packets = [];
|
2010-10-24 08:21:01 +08:00
|
|
|
client.connection.emit('authenticationCleartextPassword');
|
|
|
|
test('responds with password', function() {
|
2010-10-25 11:52:12 +08:00
|
|
|
var packets = client.connection.stream.packets;
|
|
|
|
assert.length(packets, 1);
|
|
|
|
var packet = packets[0];
|
2010-10-24 08:21:01 +08:00
|
|
|
assert.equalBuffers(packet, [0x70, 0, 0, 0, 6, 33, 0]);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|