Project

General

Profile

« Previous | Next » 

Revision 77b40df8

Added by François ARMAND about 7 years ago

Fixes #10545: Rudder fails to accept inventories with user account different only in their case

View differences:

inventory-repository/src/main/resources/ldap/inventory.schema
attributetype ( InventoryAttributes:300.2
NAME 'localAdministratorAccountName'
DESC 'The local administrator account name (login) on the node'
EQUALITY caseIgnoreMatch
EQUALITY caseExactMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
......
attributetype ( InventoryAttributes:300.5
NAME 'localAccountName'
DESC 'A local account name (login) on the server'
EQUALITY caseIgnoreMatch
EQUALITY caseExactMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributetype ( InventoryAttributes:300.6
NAME 'lastLoggedUser'
DESC 'Login of the last logged user'
EQUALITY caseIgnoreMatch
EQUALITY caseExactMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
inventory-repository/src/test/resources/ldap-data/schema/099-0-inventory.ldif
attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.2
NAME 'localAdministratorAccountName'
DESC 'The local administrator account name (login) on the node'
EQUALITY caseIgnoreMatch
EQUALITY caseExactMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.3
......
attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.5
NAME 'localAccountName'
DESC 'A local account name (login) on the server'
EQUALITY caseIgnoreMatch
EQUALITY caseExactMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.6
NAME 'lastLoggedUser'
DESC 'Login of the last logged user'
EQUALITY caseIgnoreMatch
EQUALITY caseExactMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributeTypes: ( 1.3.6.1.4.1.35061.1.1.300.7
inventory-repository/src/test/scala/com/normation/inventory/ldap/core/TestInventory.scala
import net.liftweb.common.Full
import net.liftweb.common.EmptyBox
import net.liftweb.common.Box
import com.unboundid.ldap.sdk.Attribute
import com.unboundid.ldap.sdk.Modification
import com.unboundid.ldap.sdk.ModificationType
import org.specs2.matcher.MatchResult
/**
......
i + x
}
ldap.server.countEntries === numEntries
}
"can add case-ignore-match equals localaccounts" in {
val dn = "nodeId=node0,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration"
//it throws exception if not success
ldap.server.modify(dn, new Modification(ModificationType.ADD, "localAccountName", "TEST", "test"))
(try {
ldap.server.assertValueExists(dn, "localAccountName", java.util.Arrays.asList("TEST","test"))
ok("success")
} catch {
case ae: AssertionError => ko(ae.getMessage)
}):MatchResult[Any]
}
}
......
success
}
}
}

Also available in: Unified diff