From 528a78bad359d1fa4849faac6d2094a0c5f7a681 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Wed, 28 Aug 2019 14:38:04 -0400 Subject: [PATCH] Add test for issue #480 --- test/client.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/client.test.js b/test/client.test.js index f44c6f7..d3b28a9 100644 --- a/test/client.test.js +++ b/test/client.test.js @@ -1,6 +1,7 @@ 'use strict' const util = require('util') +const assert = require('assert') const tap = require('tap') const uuid = require('uuid') const vasync = require('vasync') @@ -57,6 +58,12 @@ tap.beforeEach((done, t) => { return next() }) + server.modifyDN('cn=issue-480', function (req, res, next) { + assert(req.newRdn.toString().length > 132) + res.end() + return next() + }) + server.search('dc=slow', function (req, res, next) { res.send({ dn: 'dc=slow', @@ -533,6 +540,15 @@ tap.test('modify DN new superior', function (t) { }) }) +tap.test('modify DN excessive length (GH-480)', function (t) { + t.context.client.modifyDN('cn=issue-480', 'cn=a292979f2c86d513d48bbb9786b564b3c5228146e5ba46f404724e322544a7304a2b1049168803a5485e2d57a544c6a0d860af91330acb77e5907a9e601ad1227e80e0dc50abe963b47a004f2c90f570450d0e920d15436fdc771e3bdac0487a9735473ed3a79361d1778d7e53a7fb0e5f01f97a75ef05837d1d5496fc86968ff47fcb64', function (err, res) { + t.error(err) + t.ok(res) + t.equal(res.status, 0) + t.end() + }) +}) + tap.test('search basic', function (t) { t.context.client.search('cn=test, ' + SUFFIX, '(objectclass=*)', function (err, res) { t.error(err)