rem: assert(res != undefined); assert(res.length == 1); assert(res[0].dn == dn); assert(res[0].description == "foo"); assert(res[0].badPwdCount == "3"); assert(res[0].nextRid == "1001"); assert(res[0].revision == "1"); /* Check in local db */ res = s4.db.search("", dn, ldb.SCOPE_BASE, attrs); assert(res != undefined); assert(res.length == 1); assert(res[0].dn == dn); assert(res[0].description == undefined); assert(res[0].badPwdCount == undefined); assert(res[0].nextRid == undefined); assert(res[0].revision == "1"); 
add: assert(res.error == 0); assert(res.msgs.length == 1); assert(res.msgs[0].dn == dn); assert(res.msgs[0].description == "foo"); assert(res.msgs[0].badPwdCount == "3"); assert(res.msgs[0].nextRid == "1001"); assert(res.msgs[0].revision == "1"); /* Check in local db */ res = s4.db.search("", dn, ldb.SCOPE_BASE, attrs); assert(res.error == 0); assert(res.msgs.length == 1); assert(res.msgs[0].dn == dn); assert(res.msgs[0].description == undefined); assert(res.msgs[0].badPwdCount == undefined); assert(res.msgs[0].nextRid == undefined); assert(res.msgs[0].revision == "1"); 
context: function test_map_modify(ldb, s3, s4){	println("Running modification tests on mapped data");	var ldif;	var attrs;	var dn, dn2;	var res;	var ok;	println("Testing modification of local records");	/* Add local record */	dn = "cn=test,dc=idealx,dc=org";	ldif = "dn: " + dn + "cn: testfoo: barrevision: 1description: test";	ok = ldb.add(ldif);	assert(ok);	/* Check it's there */	attrs = new Array("foo", "revision", "description");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].foo == "bar");	assert(res[0].revision == "1");	assert(res[0].description == "test");	/* Check it's not in the local db */	res = s4.db.search("(cn=test)", NULL, ldb.SCOPE_DEFAULT, attrs);	assert(res != undefined);	assert(res.length == 0);	/* Check it's not in the remote db */	res = s3.db.search("(cn=test)", NULL, ldb.SCOPE_DEFAULT, attrs);	assert(res != undefined);	assert(res.length == 0);	/* Modify local record */	ldif = "dn: " + dn + "replace: foofoo: bazreplace: descriptiondescription: foo";	ok = ldb.modify(ldif);	assert(ok);	/* Check in local db */	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].foo == "baz");	assert(res[0].revision == "1");	assert(res[0].description == "foo");	/* Rename local record */	dn2 = "cn=toast,dc=idealx,dc=org";	ok = ldb.rename(dn, dn2);	assert(ok);	/* Check in local db */	res = ldb.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].foo == "baz");	assert(res[0].revision == "1");	assert(res[0].description == "foo");	/* Delete local record */	ok = ldb.del(dn2);	assert(ok);	/* Check it's gone */	res = ldb.search("", dn2, ldb.SCOPE_BASE);	assert(res != undefined);	assert(res.length == 0);	println("Testing modification of remote records");	/* Add remote record */	dn = s4.dn("cn=test");	dn2 = s3.dn("cn=test");	ldif = "dn: " + dn2 + "cn: testdescription: foosambaBadPasswordCount: 3sambaNextRid: 1001";	ok = s3.db.add(ldif);	assert(ok);	/* Check it's there */	attrs = new Array("description", "sambaBadPasswordCount", "sambaNextRid");	res = s3.db.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].description == "foo");	assert(res[0].sambaBadPasswordCount == "3");	assert(res[0].sambaNextRid == "1001");	/* Check in mapped db */	attrs = new Array("description", "badPwdCount", "nextRid");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == "foo");	assert(res[0].badPwdCount == "3");	assert(res[0].nextRid == "1001");	/* Check in local db */	res = s4.db.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 0);	/* Modify remote data of remote record */	ldif = "dn: " + dn + "replace: descriptiondescription: testreplace: badPwdCountbadPwdCount: 4";	ok = ldb.modify(ldif);	/* Check in mapped db */	attrs = new Array("description", "badPwdCount", "nextRid");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == "test");	assert(res[0].badPwdCount == "4");	assert(res[0].nextRid == "1001");	/* Check in remote db */	attrs = new Array("description", "sambaBadPasswordCount", "sambaNextRid");	res = s3.db.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].description == "test");	assert(res[0].sambaBadPasswordCount == "4");	assert(res[0].sambaNextRid == "1001");	/* Rename remote record */	dn2 = s4.dn("cn=toast");	ok = ldb.rename(dn, dn2);	assert(ok);	/* Check in mapped db */	dn = dn2;	attrs = new Array("description", "badPwdCount", "nextRid");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == "test");	assert(res[0].badPwdCount == "4");	assert(res[0].nextRid == "1001");	/* Check in remote db */	dn2 = s3.dn("cn=toast");	attrs = new Array("description", "sambaBadPasswordCount", "sambaNextRid");	res = s3.db.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].description == "test");	assert(res[0].sambaBadPasswordCount == "4");	assert(res[0].sambaNextRid == "1001");	/* Delete remote record */	ok = ldb.del(dn);	assert(ok);	/* Check in mapped db */	res = ldb.search("", dn, ldb.SCOPE_BASE);	assert(res != undefined);	assert(res.length == 0);	/* Check in remote db */	res = s3.db.search("", dn2, ldb.SCOPE_BASE);	assert(res != undefined);	assert(res.length == 0);	/* Add remote record (same as before) */	dn = s4.dn("cn=test");	dn2 = s3.dn("cn=test");	ldif = "dn: " + dn2 + "cn: testdescription: foosambaBadPasswordCount: 3sambaNextRid: 1001";	ok = s3.db.add(ldif);	assert(ok);	/* Modify local data of remote record */	ldif = "dn: " + dn + "add: revisionrevision: 1replace: descriptiondescription: test";	ok = ldb.modify(ldif);	/* Check in mapped db */	attrs = new Array("revision", "description");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == "test");	assert(res[0].revision == "1");	/* Check in remote db */	res = s3.db.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].description == "test");	assert(res[0].revision == undefined);	/* Check in local db */	res = s4.db.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == undefined);	assert(res[0].revision == "1");	/* Delete (newly) split record */	ok = ldb.del(dn);	assert(ok);	println("Testing modification of split records");	/* Add split record */	dn = s4.dn("cn=test");	dn2 = s3.dn("cn=test");	ldif = "dn: " + dn + "cn: testdescription: foobadPwdCount: 3nextRid: 1001revision: 1";	ok = ldb.add(ldif);	assert(ok);	/* Check it's there */	attrs = new Array("description", "badPwdCount", "nextRid", "revision");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == "foo");	assert(res[0].badPwdCount == "3");	assert(res[0].nextRid == "1001");	assert(res[0].revision == "1");	/* Check in local db */	res = s4.db.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == undefined);	assert(res[0].badPwdCount == undefined);	assert(res[0].nextRid == undefined);	assert(res[0].revision == "1");	/* Check in remote db */	attrs = new Array("description", "sambaBadPasswordCount", "sambaNextRid", "revision");	res = s3.db.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].description == "foo");	assert(res[0].sambaBadPasswordCount == "3");	assert(res[0].sambaNextRid == "1001");	assert(res[0].revision == undefined);	/* Modify of split record */	ldif = "dn: " + dn + "replace: descriptiondescription: testreplace: badPwdCountbadPwdCount: 4replace: revisionrevision: 2";	ok = ldb.modify(ldif);	assert(ok);	/* Check in mapped db */	attrs = new Array("description", "badPwdCount", "nextRid", "revision");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == "test");	assert(res[0].badPwdCount == "4");	assert(res[0].nextRid == "1001");	assert(res[0].revision == "2");	/* Check in local db */	res = s4.db.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == undefined);	assert(res[0].badPwdCount == undefined);	assert(res[0].nextRid == undefined);	assert(res[0].revision == "2");	/* Check in remote db */	attrs = new Array("description", "sambaBadPasswordCount", "sambaNextRid", "revision");	res = s3.db.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].description == "test");	assert(res[0].sambaBadPasswordCount == "4");	assert(res[0].sambaNextRid == "1001");	assert(res[0].revision == undefined);	/* Rename split record */	dn2 = s4.dn("cn=toast");	ok = ldb.rename(dn, dn2);	assert(ok);	/* Check in mapped db */	dn = dn2;	attrs = new Array("description", "badPwdCount", "nextRid", "revision");	res = ldb.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == "test");	assert(res[0].badPwdCount == "4");	assert(res[0].nextRid == "1001");	assert(res[0].revision == "2");	/* Check in local db */	res = s4.db.search("", dn, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn);	assert(res[0].description == undefined);	assert(res[0].badPwdCount == undefined);	assert(res[0].nextRid == undefined);	assert(res[0].revision == "2");	/* Check in remote db */	dn2 = s3.dn("cn=toast");	attrs = new Array("description", "sambaBadPasswordCount", "sambaNextRid", "revision");	res = s3.db.search("", dn2, ldb.SCOPE_BASE, attrs);	assert(res != undefined);	assert(res.length == 1);	assert(res[0].dn == dn2);	assert(res[0].description == "test");	assert(res[0].sambaBadPasswordCount == "4");	assert(res[0].sambaNextRid == "1001");	assert(res[0].revision == undefined);	/* Delete split record */	ok = ldb.del(dn);	assert(ok);	/* Check in mapped db */	res = ldb.search("", dn, ldb.SCOPE_BASE);	assert(res != undefined);	assert(res.length == 0);	/* Check in local db */	res = s4.db.search("", dn, ldb.SCOPE_BASE);	assert(res != undefined);	assert(res.length == 0);	/* Check in remote db */	res = s3.db.search("", dn2, ldb.SCOPE_BASE);	assert(res != undefined);	assert(res.length == 0);}
meta: 1914	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1914/7ca399c0755e186508a4ed9796cbbbe6f50181e9/samba3sam.js/clean/testprogs/ejs/samba3sam.js