diff --git a/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java b/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java index aa37302190f..592c10b2f5f 100755 --- a/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java +++ b/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java @@ -46,6 +46,7 @@ import org.opends.messages.MessageBuilder; import org.opends.server.config.ConfigException; import org.opends.server.core.AddOperation; +import org.opends.server.core.BindOperation; import org.opends.server.core.ModifyDNOperation; import org.opends.server.core.ModifyOperation; import org.opends.server.protocols.internal.InternalClientConnection; @@ -811,5 +812,22 @@ public ChangeRecordEntry addGroupUniqueMembers(String groupDn, List memb } return executeLdifChange(sb.toString()); } + + public boolean checkPassword(String entryDn, String password) throws DirectoryException { + InternalClientConnection conn = new InternalClientConnection(DN.decode(entryDn)); + BindOperation op = conn.processSimpleBind(entryDn, password); + if (op.getResultCode() == ResultCode.SUCCESS) { + return true; + } else { + LOGGER.error("Bind error: {} ({})", op.getAuthFailureReason(), op.getResultCode()); + return false; + } + } + + public void assertPassword(String entryDn, String password) throws DirectoryException { + if (!checkPassword(entryDn, password)) { + AssertJUnit.fail("Expected that entry "+entryDn+" will have password '"+password+"'. But the check failed."); + } + } } diff --git a/infra/test-util/src/main/resources/test-data/ldif/example-4000.ldif b/infra/test-util/src/main/resources/test-data/ldif/example-4000.ldif index 8940472b3ae..b2fd003150a 100644 --- a/infra/test-util/src/main/resources/test-data/ldif/example-4000.ldif +++ b/infra/test-util/src/main/resources/test-data/ldif/example-4000.ldif @@ -58,6 +58,7 @@ description: Special LDAP acccount used by the IDM ou: Administrators userPassword: secret ds-privilege-name: unindexed-search +ds-privilege-name: password-reset dn: uid=u00000000,ou=people,dc=example,dc=com objectClass: top diff --git a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/00000000.jdb b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/00000000.jdb index 36541dd1e4f..ce0e9dd718c 100644 Binary files a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/00000000.jdb and b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/00000000.jdb differ diff --git a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.config.csv b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.config.csv index 4051cc81bc3..3480e328917 100644 --- a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.config.csv +++ b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.config.csv @@ -23,3 +23,4 @@ time,envcfg:com.sleepycat.je.util.ConsoleHandler.level,envcfg:com.sleepycat.je.u 2015-03-17 15:38:54.981 UTC,"OFF","ALL","0","500000000","3","true","30000000","true","false","0","5","20","5","1000","10","false","false","3","2","true","false","","false","false","500 ms","2097152","0","2","5","5","50","0","5","10","true","24","true","0","3","500 ms","5 s","false","0","1 ms","0","true","false","100","true","10 seconds","true","false","false","true","false","true","true","true","false","false","true","true","true","true","true","5 min","10 s","true","1","0","3","524288","10","false","600000000","false","10","10","10","95","5 s","false","97","false","0 MICROSECONDS","1048576","true","0","false","4096","100","100000000","500 ms","0 ns","0","16777216","2097152","false","0","3","0","false","false","true","false","1048576","0","50","128","128","false","true","1 min","","1440","10","25","16","10","512000","false","false","WRITE_NO_SYNC,NO_SYNC,SIMPLE_MAJORITY","false","0"," -Dorg.opends.server.scriptName=start-ds","1862270976","130813568","Oracle Corporation","1.7.0_75","5.0.104","amd64","4","Linux","3.16.0-30-generic" 2015-03-17 15:42:49.895 UTC,"OFF","ALL","0","500000000","3","true","30000000","true","false","0","5","20","5","1000","10","false","false","3","2","true","false","","false","false","500 ms","2097152","0","2","5","5","50","0","5","10","true","24","true","0","3","500 ms","5 s","false","0","1 ms","0","true","false","100","true","10 seconds","true","false","false","true","false","true","true","true","false","false","true","false","true","true","true","5 min","10 s","true","1","0","3","524288","10","false","600000000","false","2","10","10","95","5 s","false","97","false","0 MICROSECONDS","1048576","true","0","false","4096","100","100000000","500 ms","0 ns","0","16777216","2097152","false","0","3","0","false","false","true","false","1048576","5000000","1","128","128","false","true","1 min","","1440","10","25","16","10","512000","false","false","WRITE_NO_SYNC,NO_SYNC,SIMPLE_MAJORITY","false","0"," -Dorg.opends.server.scriptName=start-ds","1862270976","130813568","Oracle Corporation","1.7.0_75","5.0.104","amd64","4","Linux","3.16.0-30-generic" 2015-07-03 08:38:26.161 UTC,"OFF","ALL","0","500000000","3","true","30000000","true","false","0","5","20","5","1000","10","false","false","3","2","true","false","","false","false","500 ms","2097152","0","2","5","5","50","0","5","10","true","24","true","0","3","500 ms","5 s","false","0","1 ms","0","true","false","100","true","10 seconds","true","false","false","true","false","true","true","true","false","false","true","false","true","true","true","5 min","10 s","true","1","0","3","524288","10","false","600000000","false","2","10","10","95","5 s","false","97","false","0 MICROSECONDS","1048576","true","0","false","4096","100","100000000","500 ms","0 ns","0","16777216","2097152","false","0","3","0","false","false","true","false","1048576","5000000","1","128","128","false","true","1 min","","1440","10","25","16","10","512000","false","false","WRITE_NO_SYNC,NO_SYNC,SIMPLE_MAJORITY","false","0"," -Dorg.opends.server.scriptName=start-ds","1862270976","130813568","Oracle Corporation","1.7.0_79","5.0.104","amd64","4","Linux","3.16.0-30-generic" +2015-08-04 11:55:20.556 UTC,"OFF","ALL","0","500000000","3","true","30000000","true","false","0","5","20","5","1000","10","false","false","3","2","true","false","","false","false","500 ms","2097152","0","2","5","5","50","0","5","10","true","24","true","0","3","500 ms","5 s","false","0","1 ms","0","true","false","100","true","10 seconds","true","false","false","true","false","true","true","true","false","false","true","false","true","true","true","5 min","10 s","true","1","0","3","524288","10","false","600000000","false","2","10","10","95","5 s","false","97","false","0 MICROSECONDS","1048576","true","0","false","4096","100","100000000","500 ms","0 ns","0","16777216","2097152","false","0","3","0","false","false","true","false","1048576","5000000","1","128","128","false","true","1 min","","1440","10","25","16","10","512000","false","false","WRITE_NO_SYNC,NO_SYNC,SIMPLE_MAJORITY","false","0"," -javaagent:/usr/share/java/jayatanaag.jar -Dorg.opends.server.scriptName=start-ds","1860698112","130805760","Oracle Corporation","1.7.0_79","5.0.104","amd64","4","Linux","3.19.0-25-generic" diff --git a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.info.0 b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.info.0 index 299c038cb1a..5335c302626 100644 --- a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.info.0 +++ b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.info.0 @@ -357,3 +357,28 @@ 2015-07-03 08:38:26.617 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping REMOVE_TEMP_DBS Recovery Info firstActive=0x0/0xe5b639 ckptStart=0x0/0xe5b639 ckptEnd=0x0/0xe5b78b lastUsed=0x0/0xe5b78b nextAvail=0x0/0xe5b7c1 useRoot=0x0/0xe5b6dftime=2015-03-17 16:43:21.955 lastLocalNodeId=1676 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=309 lastReplicatedTxnId=-10 id=21 rootExists=true ckptStartLsn=0x0/0xe5b639 root=0x0/0xe5b6df firstActive=0x0/0xe5b639 cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1676 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=309 2015-07-03 08:38:26.617 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping TOTAL_RECOVERY Recovery Info firstActive=0x0/0xe5b639 ckptStart=0x0/0xe5b639 ckptEnd=0x0/0xe5b78b lastUsed=0x0/0xe5b78b nextAvail=0x0/0xe5b7c1 useRoot=0x0/0xe5b6dftime=2015-03-17 16:43:21.955 lastLocalNodeId=1676 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=309 lastReplicatedTxnId=-10 id=21 rootExists=true ckptStartLsn=0x0/0xe5b639 root=0x0/0xe5b6df firstActive=0x0/0xe5b639 cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1676 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=309 2015-07-03 08:38:26.713 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping TOTAL_ENV_OPEN Recovery Info firstActive=0x0/0xe5b639 ckptStart=0x0/0xe5b639 ckptEnd=0x0/0xe5b78b lastUsed=0x0/0xe5b78b nextAvail=0x0/0xe5b7c1 useRoot=0x0/0xe5b6dftime=2015-03-17 16:43:21.955 lastLocalNodeId=1676 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=309 lastReplicatedTxnId=-10 id=21 rootExists=true ckptStartLsn=0x0/0xe5b639 root=0x0/0xe5b6df firstActive=0x0/0xe5b639 cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1676 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=309 +2015-08-04 11:55:20.573 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting TOTAL_RECOVERY Recovery Info null useMinReplicatedNodeId=0 useMaxNodeId=0 useMinReplicatedDbId=0 useMaxDbId=0 useMinReplicatedTxnId=0 useMaxTxnId=0 +2015-08-04 11:55:20.576 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting FIND_END_OF_LOG Recovery Info null useMinReplicatedNodeId=0 useMaxNodeId=0 useMinReplicatedDbId=0 useMaxDbId=0 useMinReplicatedTxnId=0 useMaxTxnId=0 +2015-08-04 11:55:20.829 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping FIND_END_OF_LOG Recovery Info ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67enull useMinReplicatedNodeId=0 useMaxNodeId=0 useMinReplicatedDbId=0 useMaxDbId=0 useMinReplicatedTxnId=0 useMaxTxnId=0 +2015-08-04 11:55:20.830 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting FIND_LAST_CKPT Recovery Info ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67enull useMinReplicatedNodeId=0 useMaxNodeId=0 useMinReplicatedDbId=0 useMaxDbId=0 useMinReplicatedTxnId=0 useMaxTxnId=0 +2015-08-04 11:55:20.832 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping FIND_LAST_CKPT Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=0 useMaxNodeId=0 useMinReplicatedDbId=0 useMaxDbId=0 useMinReplicatedTxnId=0 useMaxTxnId=0 +2015-08-04 11:55:20.835 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting BUILD_TREE Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=0 useMaxNodeId=0 useMinReplicatedDbId=0 useMaxDbId=0 useMinReplicatedTxnId=0 useMaxTxnId=0 +2015-08-04 11:55:20.836 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting READ_MAP_INS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=0 useMaxNodeId=0 useMinReplicatedDbId=0 useMaxDbId=0 useMinReplicatedTxnId=0 useMaxTxnId=0 +2015-08-04 11:55:20.848 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping READ_MAP_INS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.848 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting UNDO_MAP_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.854 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping UNDO_MAP_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.854 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting REDO_MAP_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.864 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping REDO_MAP_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.864 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting READ_INS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.878 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping READ_INS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.878 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting UNDO_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.885 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping UNDO_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.885 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting REDO_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.890 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping REDO_LNS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.891 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping BUILD_TREE Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.891 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting POPULATE_UP Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.901 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping POPULATE_UP Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.901 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Starting REMOVE_TEMP_DBS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.902 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping REMOVE_TEMP_DBS Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.902 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping TOTAL_RECOVERY Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 +2015-08-04 11:55:20.912 UTC CONFIG [/opt/opendj-2.6.2/db/userRoot] Stopping TOTAL_ENV_OPEN Recovery Info firstActive=0x0/0xe5be3c ckptStart=0x0/0xe5be3c ckptEnd=0x0/0xe5c75e lastUsed=0x0/0xe5c75e nextAvail=0x0/0xe5c794 useRoot=0x0/0xe5c67etime=2015-07-03 10:40:35.401 lastLocalNodeId=1678 lastReplicatedNodeId=-9 lastLocalDbId=57 lastReplicatedDbId=-256 lastLocalTxnId=347 lastReplicatedTxnId=-10 id=22 rootExists=true ckptStartLsn=0x0/0xe5be3c root=0x0/0xe5c67e firstActive=0x0/0xe5be3c cleanerLogSummary= useMinReplicatedNodeId=-9 useMaxNodeId=1678 useMinReplicatedDbId=-256 useMaxDbId=57 useMinReplicatedTxnId=-10 useMaxTxnId=347 diff --git a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.stat.csv b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.stat.csv index 939c4b45482..0c6af364ec0 100644 --- a/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.stat.csv +++ b/infra/test-util/src/main/resources/test-data/opendj-4000.template/db/userRoot/je.stat.csv @@ -76,3 +76,5 @@ time,Cache:adminBytes,Cache:avgBatchCACHEMODE,Cache:avgBatchCRITICAL,Cache:avgBa 2015-07-03 08:39:26.767 UTC,589,0,0,0,0,0,411925,6488,95588,3248,0,0,0,0,0,179,10,0,0,0,0,0,0,13,12,0,11,3,18,1070,103,0,0,0,0, ,0,0,0,0,0,0,0,0,0,0,15054731,21,15054393,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15054747,0,1435912706024,312498,15054731,0,0,124,0,0,0,3,2,0,0,3,0,0,0,0,124,1,241664,59,124,1,0,1,284422,69,189,1,0,0,0,0,0,0,2,82,89793056,0,0,0,0,0,0,0,304,0,0,0,0,0,0,0,0,0,3,1,15,0,0,0,0,0,0,0,0,0,0,87,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 2015-07-03 08:40:26.771 UTC,589,0,0,0,0,0,416380,6592,100043,3248,0,0,0,0,0,14,0,0,0,0,0,0,0,14,13,0,11,3,20,8,2,0,0,0,0, ,0,0,0,0,0,0,0,0,0,0,15054731,21,15054393,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1435912706024,312498,0,0,0,2,0,0,0,0,5,0,0,3,0,0,0,0,2,1,4096,1,66,1,0,0,4096,1,1200,4,0,0,0,0,0,0,0,0,96018248,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,3,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 2015-07-03 08:40:35.396 UTC,589,0,0,0,0,0,413132,6592,100043,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,13,0,11,3,20,0,0,0,0,0,0, ,0,0,0,0,0,0,0,0,0,0,15054731,21,15054393,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1435912706024,312498,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120010312,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2015-08-04 11:55:20.922 UTC,125,0,0,0,0,0,331134,1624,18509,0,0,0,0,0,0,24,3,0,0,0,0,0,7,3,3,0,2,1,4,16,7,0,0,0,0, ,0,0,0,0,0,0,0,0,0,0,15058782,22,15056444,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1438689320411,312498,0,0,0,17,0,0,0,2,0,0,0,3,0,0,0,0,17,0,4218880,8,0,0,0,0,25219072,25,0,0,0,0,0,0,0,0,4,115,146509664,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +2015-08-04 11:55:48.509 UTC,589,0,0,0,0,0,397269,5896,84180,0,0,0,0,0,0,174,10,0,0,0,0,0,0,13,12,0,11,2,19,1019,100,0,0,0,0, ,0,0,0,0,0,0,0,0,0,0,15058782,22,15056444,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15058798,0,1438689320411,312498,15058782,0,0,120,0,0,0,3,3,0,0,3,0,0,0,0,120,1,225280,55,971,2,0,0,278528,68,191,1,0,0,0,0,0,0,2,74,122164712,0,0,0,0,0,0,0,296,0,0,0,0,0,0,0,0,0,3,1,19,0,0,0,0,0,0,0,0,0,0,88,0,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/ProvisioningTestUtil.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/ProvisioningTestUtil.java index f9cb6d41c19..e0794c1e545 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/ProvisioningTestUtil.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/ProvisioningTestUtil.java @@ -83,6 +83,9 @@ public class ProvisioningTestUtil { public static final String OBJECT_CLASS_INETORGPERSON_NAME = "inetOrgPerson"; public static final String RESOURCE_OPENDJ_PRIMARY_IDENTIFIER_LOCAL_NAME = "entryUUID"; public static final String RESOURCE_OPENDJ_SECONDARY_IDENTIFIER_LOCAL_NAME = "dn"; + + public static final String CONNECTOR_LDAP_TYPE = "com.evolveum.polygon.connector.ldap.LdapConnector"; + public static final String CONNECTOR_LDAP_NS = "http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-ldap/com.evolveum.polygon.connector.ldap.LdapConnector"; public static void assertConnectorSchemaSanity(ConnectorType conn, PrismContext prismContext) throws SchemaException { XmlSchemaType xmlSchemaType = conn.getSchema(); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/AbstractOpenDJTest.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/AbstractOpenDJTest.java index 5a3dced4d8d..8c5e0825785 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/AbstractOpenDJTest.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/AbstractOpenDJTest.java @@ -123,7 +123,6 @@ public abstract class AbstractOpenDJTest extends AbstractIntegrationTest { protected static final String RESOURCE_NS = "http://midpoint.evolveum.com/xml/ns/public/resource/instance/ef2bc95b-76e0-59e2-86d6-3d4f02d3ffff"; protected static final QName RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS = new QName(RESOURCE_NS,"inetOrgPerson"); protected static final QName RESOURCE_OPENDJ_POSIX_ACCOUNT_OBJECTCLASS = new QName(RESOURCE_NS,"posixAccount"); - protected static final String LDAP_CONNECTOR_TYPE = "com.evolveum.polygon.connector.ldap.LdapConnector"; protected static final File QUERY_COMPLEX_FILTER_FILE = new File(TEST_DIR, "query-complex-filter.xml"); protected static final File QUERY_ALL_ACCOUNTS_FILE = new File(TEST_DIR, "query-filter-all-accounts.xml"); @@ -155,7 +154,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti // not have a definition here InternalsConfig.encryptionChecks = false; provisioningService.postInit(initResult); - resource = addResourceFromFile(RESOURCE_OPENDJ_FILE, LDAP_CONNECTOR_TYPE, initResult); + resource = addResourceFromFile(RESOURCE_OPENDJ_FILE, ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, initResult); repoAddShadowFromFile(ACCOUNT_BAD_FILE, initResult); } diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJ.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJ.java index 4f91f039870..5b3eb682710 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJ.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJ.java @@ -941,17 +941,18 @@ public void test150ChangePassword() throws Exception { assertNull("Unexpected password before change",passwordBefore); ObjectModificationType objectChange = PrismTestUtil.parseAtomicValue( - new File("src/test/resources/impl/account-change-password.xml"), ObjectModificationType.COMPLEX_TYPE); + new File(TEST_DIR, "account-change-password.xml"), ObjectModificationType.COMPLEX_TYPE); ObjectDelta delta = DeltaConvertor.createObjectDelta(objectChange, accountType.asPrismObject().getDefinition()); display("Object change",delta); // WHEN + TestUtil.displayWhen(TEST_NAME); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), null, null, taskManager.createTaskInstance(), result); // THEN + TestUtil.displayThen(TEST_NAME); // Check if object was modified in LDAP - SearchResultEntry entryAfter = openDJController.searchAndAssertByEntryUuid(uid); display("LDAP account after", entryAfter); @@ -959,6 +960,8 @@ public void test150ChangePassword() throws Exception { assertNotNull("The password was not changed",passwordAfter); System.out.println("Changed password: "+passwordAfter); + + openDJController.assertPassword(entryAfter.getDN().toString(), "mehAbigH4X0R"); assertShadows(3); } @@ -1006,6 +1009,8 @@ public void test151AddObjectWithPassword() throws Exception { assertNotNull("The password was not changed",passwordAfter); System.out.println("Account password: "+passwordAfter); + + openDJController.assertPassword(entryAfter.getDN().toString(), "t4k30v3rTh3W0rld"); assertShadows(4); } @@ -1953,7 +1958,7 @@ public void test401ConfiguredCapabilityNoRead() throws Exception{ OperationResult parentResult = new OperationResult("test401noReadNativeCapability"); - addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "resource-opendj-no-read.xml"), LDAP_CONNECTOR_TYPE, true, parentResult); + addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "resource-opendj-no-read.xml"), ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, true, parentResult); Task task = taskManager.createTaskInstance(); @@ -1973,7 +1978,7 @@ public void test402ConfiguredCapabilityNoCreate() throws Exception{ OperationResult parentResult = new OperationResult("test401noReadNativeCapability"); - addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "/resource-opendj-no-create.xml"), LDAP_CONNECTOR_TYPE, true, parentResult); + addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "/resource-opendj-no-create.xml"), ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, true, parentResult); Task task = taskManager.createTaskInstance(); @@ -1994,7 +1999,7 @@ public void test403ConfiguredCapabilityNoDelete() throws Exception{ OperationResult parentResult = new OperationResult("test401noReadNativeCapability"); - addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "/resource-opendj-no-delete.xml"), LDAP_CONNECTOR_TYPE, true, parentResult); + addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "/resource-opendj-no-delete.xml"), ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, true, parentResult); Task task = taskManager.createTaskInstance(); @@ -2013,7 +2018,7 @@ public void test404ConfiguredCapabilityNoUpdate() throws Exception{ OperationResult parentResult = new OperationResult("test401noReadNativeCapability"); - addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "/resource-opendj-no-update.xml"), LDAP_CONNECTOR_TYPE, true, parentResult); + addResourceFromFile(new File(ProvisioningTestUtil.COMMON_TEST_DIR_FILE, "/resource-opendj-no-update.xml"), ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, true, parentResult); Task task = taskManager.createTaskInstance(); @@ -2038,7 +2043,7 @@ public void test600AddResourceOpenDjBadCredentials() throws Exception { + "." + TEST_NAME); PrismObject resource = prismContext.parseObject(RESOURCE_OPENDJ_BAD_CREDENTIALS_FILE); - fillInConnectorRef(resource, LDAP_CONNECTOR_TYPE, result); + fillInConnectorRef(resource, ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, result); // WHEN String addedObjectOid = provisioningService.addObject(resource, null, null, taskManager.createTaskInstance(), result); @@ -2076,7 +2081,7 @@ public void test610AddResourceOpenDjBadBindDn() throws Exception { + "." + TEST_NAME); PrismObject resource = prismContext.parseObject(RESOURCE_OPENDJ_BAD_BIND_DN_FILE); - fillInConnectorRef(resource, LDAP_CONNECTOR_TYPE, result); + fillInConnectorRef(resource, ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, result); // WHEN String addedObjectOid = provisioningService.addObject(resource, null, null, taskManager.createTaskInstance(), result); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJNegative.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJNegative.java index a2e649b259f..97d0f812052 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJNegative.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestOpenDJNegative.java @@ -450,7 +450,7 @@ public void test500ReplaceResource() throws Exception { result.computeStatus(); TestUtil.assertSuccess(result); - resource = addResourceFromFile(RESOURCE_OPENDJ_INITIALIZED_FILE, LDAP_CONNECTOR_TYPE, result); + resource = addResourceFromFile(RESOURCE_OPENDJ_INITIALIZED_FILE, ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, result); result.computeStatus(); TestUtil.assertSuccess(result); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestSynchronization.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestSynchronization.java index e7be9b2e72e..57956ae7566 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestSynchronization.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/impl/TestSynchronization.java @@ -110,7 +110,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti // let provisioning discover the connectors provisioningService.postInit(initResult); - resourceType = addResourceFromFile(RESOURCE_OPENDJ_FILE, AbstractOpenDJTest.LDAP_CONNECTOR_TYPE, initResult).asObjectable(); + resourceType = addResourceFromFile(RESOURCE_OPENDJ_FILE, ProvisioningTestUtil.CONNECTOR_LDAP_TYPE, initResult).asObjectable(); //it is needed to declare the task owner, so we add the user admin to the reposiotry repoAddObjectFromFile(FILENAME_USER_ADMIN, UserType.class, initResult); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/ucf/TestUcfOpenDj.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/ucf/TestUcfOpenDj.java index e76badb3dae..84c20f9545a 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/ucf/TestUcfOpenDj.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/test/ucf/TestUcfOpenDj.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Evolveum + * Copyright (c) 2010-2015 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package com.evolveum.midpoint.provisioning.test.ucf; import com.evolveum.midpoint.prism.Definition; +import com.evolveum.midpoint.prism.PrismContainerDefinition; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.PrismObjectDefinition; @@ -27,12 +28,14 @@ import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.prism.schema.PrismSchema; +import com.evolveum.midpoint.prism.util.PrismAsserts; import com.evolveum.midpoint.prism.util.PrismTestUtil; import com.evolveum.midpoint.prism.xnode.MapXNode; import com.evolveum.midpoint.prism.xnode.XNode; import com.evolveum.midpoint.provisioning.ProvisioningTestUtil; import com.evolveum.midpoint.provisioning.ucf.api.*; import com.evolveum.midpoint.provisioning.ucf.impl.ConnectorFactoryIcfImpl; +import com.evolveum.midpoint.provisioning.util.ProvisioningUtil; import com.evolveum.midpoint.schema.CapabilityUtil; import com.evolveum.midpoint.schema.DeltaConvertor; import com.evolveum.midpoint.schema.MidPointPrismContextFactory; @@ -205,7 +208,17 @@ public void test010ConnectorSchemaSanity() throws Exception { final String TEST_NAME = "test010ConnectorSchemaSanity"; TestUtil.displayTestTile(TEST_NAME); - ProvisioningTestUtil.assertConnectorSchemaSanity(connectorSchema, "LDAP connector"); + ProvisioningTestUtil.assertConnectorSchemaSanity(connectorSchema, "LDAP connector"); + + PrismContainerDefinition configurationDefinition = + connectorSchema.findItemDefinition(ResourceType.F_CONNECTOR_CONFIGURATION.getLocalPart(), PrismContainerDefinition.class); + PrismContainerDefinition configurationPropertiesDefinition = + configurationDefinition.findContainerDefinition(ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONFIGURATION_PROPERTIES_ELEMENT_QNAME); + PrismPropertyDefinition propHost = configurationPropertiesDefinition.findPropertyDefinition(new QName(ProvisioningTestUtil.CONNECTOR_LDAP_NS,"host")); + assertNotNull("No definition for configuration property 'host' in connector schema", propHost); + PrismAsserts.assertDefinition(propHost, new QName(ProvisioningTestUtil.CONNECTOR_LDAP_NS,"host"), DOMUtil.XSD_STRING, 0, 1); + assertEquals("Wrong property 'host' display name", "Host", propHost.getDisplayName()); + assertEquals("Wrong property 'host' help", "The name or IP address of the LDAP server host.", propHost.getHelp()); } diff --git a/provisioning/provisioning-impl/src/test/resources/impl/account-change-password.xml b/provisioning/provisioning-impl/src/test/resources/impl/opendj/account-change-password.xml similarity index 100% rename from provisioning/provisioning-impl/src/test/resources/impl/account-change-password.xml rename to provisioning/provisioning-impl/src/test/resources/impl/opendj/account-change-password.xml diff --git a/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/AbstractLdapConnTest.java b/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/AbstractLdapConnTest.java index a28700a7b1a..6d4c2dff33f 100644 --- a/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/AbstractLdapConnTest.java +++ b/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/AbstractLdapConnTest.java @@ -110,6 +110,8 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentPolicyEnforcementType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; @@ -117,6 +119,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemObjectsType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType; /** * @author Radovan Semancik @@ -773,6 +776,8 @@ public void test200AssignAccountToBarbossa() throws Exception { assertEquals("Wrong ICFS UID", entry.get(getAttributeEntryIdName()).getString(), accountBarbossaIcfUid); + assertLdapPassword(USER_BARBOSSA_USERNAME, "deadjacktellnotales"); + ResourceAttribute createTimestampAttribute = ShadowUtil.getAttribute(shadow, new QName(MidPointConstants.NS_RI, "createTimestamp")); assertNotNull("No createTimestamp in "+shadow, createTimestampAttribute); Long createTimestamp = createTimestampAttribute.getRealValue(); @@ -813,6 +818,38 @@ public void test210ModifyAccountBarbossaTitle() throws Exception { assertEquals("Shadows have moved", accountBarbossaOid, shadowOid); } + @Test + public void test220ModifyUserBarbossaPassword() throws Exception { + final String TEST_NAME = "test220ModifyUserBarbossaPassword"; + TestUtil.displayTestTile(this, TEST_NAME); + + // GIVEN + Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME); + OperationResult result = task.getResult(); + + ProtectedStringType userPasswordPs = new ProtectedStringType(); + userPasswordPs.setClearValue("hereThereBeMonsters"); + + // WHEN + TestUtil.displayWhen(TEST_NAME); + modifyUserReplace(USER_BARBOSSA_OID, + new ItemPath(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD, PasswordType.F_VALUE), + task, result, userPasswordPs); + + // THEN + TestUtil.displayThen(TEST_NAME); + result.computeStatus(); + TestUtil.assertSuccess(result); + + Entry entry = assertLdapAccount(USER_BARBOSSA_USERNAME, USER_BARBOSSA_FULL_NAME); + assertAttribute(entry, "title", "Captain"); + assertLdapPassword(USER_BARBOSSA_USERNAME, "hereThereBeMonsters"); + + PrismObject user = getUser(USER_BARBOSSA_OID); + String shadowOid = getSingleLinkOid(user); + assertEquals("Shadows have moved", accountBarbossaOid, shadowOid); + } + @Test public void test290ModifyUserBarbossaRename() throws Exception { final String TEST_NAME = "test290ModifyUserBarbossaRename"; @@ -1348,6 +1385,13 @@ protected List ldapSearch(LdapNetworkConnection connection, String baseDn } return entries; } + + protected void assertLdapPassword(String uid, String password) throws LdapException, IOException, CursorException { + Entry entry = getLdapAccountByUid(uid); + LdapNetworkConnection conn = ldapConnect(entry.getDn().toString(), password); + assertTrue("Not connected", conn.isConnected()); + assertTrue("Not authenticated", conn.isAuthenticated()); + } protected Entry addLdapAccount(String uid, String cn, String givenName, String sn) throws LdapException, IOException, CursorException { LdapNetworkConnection connection = ldapConnect(); @@ -1402,6 +1446,10 @@ protected String toGroupDn(String cn) { } protected LdapNetworkConnection ldapConnect() throws LdapException { + return ldapConnect(getLdapBindDn(), getLdapBindPassword()); + } + + protected LdapNetworkConnection ldapConnect(String bindDn, String bindPassword) throws LdapException { LdapConnectionConfig config = new LdapConnectionConfig(); config.setLdapHost(getLdapServerHost()); config.setLdapPort(getLdapServerPort()); @@ -1411,8 +1459,8 @@ protected LdapNetworkConnection ldapConnect() throws LdapException { AssertJUnit.fail("Cannot connect to LDAP server "+getLdapServerHost()+":"+getLdapServerPort()); } BindRequest bindRequest = new BindRequestImpl(); - bindRequest.setDn(new Dn(getLdapBindDn())); - bindRequest.setCredentials(getLdapBindPassword()); + bindRequest.setDn(new Dn(bindDn)); + bindRequest.setCredentials(bindPassword); BindResponse bindResponse = connection.bind(bindRequest); return connection; } diff --git a/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/TestOpenDj.java b/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/TestOpenDj.java index 7c0a29f8b34..dda75a6307e 100644 --- a/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/TestOpenDj.java +++ b/testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/TestOpenDj.java @@ -116,7 +116,7 @@ protected String getSyncTaskOid() { @Override protected void assertStepSyncToken(String syncTaskOid, int step, long tsStart, long tsEnd) throws ObjectNotFoundException, SchemaException { - assertSyncToken(syncTaskOid, (Integer)(step+4)); + assertSyncToken(syncTaskOid, (Integer)(step+5)); } } diff --git a/testing/conntest/src/test/resources/389ds/resource-bacchus.xml b/testing/conntest/src/test/resources/389ds/resource-bacchus.xml index 4d5dfadccb0..66bb4cebbf1 100644 --- a/testing/conntest/src/test/resources/389ds/resource-bacchus.xml +++ b/testing/conntest/src/test/resources/389ds/resource-bacchus.xml @@ -197,6 +197,17 @@ + + + + + strong + + + + + + diff --git a/testing/conntest/src/test/resources/389ds/resource-localhost.xml b/testing/conntest/src/test/resources/389ds/resource-localhost.xml index b6c73786f9e..b21ec2ba6dd 100644 --- a/testing/conntest/src/test/resources/389ds/resource-localhost.xml +++ b/testing/conntest/src/test/resources/389ds/resource-localhost.xml @@ -197,6 +197,17 @@ + + + + + strong + + + + + + diff --git a/testing/conntest/src/test/resources/opendj/resource.xml b/testing/conntest/src/test/resources/opendj/resource.xml index 458ac525530..2296b69c2fb 100644 --- a/testing/conntest/src/test/resources/opendj/resource.xml +++ b/testing/conntest/src/test/resources/opendj/resource.xml @@ -195,6 +195,17 @@ + + + + + strong + + + + + + diff --git a/testing/conntest/src/test/resources/openldap/resource.xml b/testing/conntest/src/test/resources/openldap/resource.xml index 5f704e08aef..44bfde1f861 100644 --- a/testing/conntest/src/test/resources/openldap/resource.xml +++ b/testing/conntest/src/test/resources/openldap/resource.xml @@ -198,6 +198,17 @@ + + + + + strong + + + + + +