-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DirectoryServices tests #22114
Comments
@WinCPP was interested to help, esp. by end of July. [1] and [2] should be prep work earlier. |
Thanks @karelz for looping me onto this. I am still going through #14734 , a lot of threads there... But as a start, I think I need to have an AD setup on my local machine to simulate the reconfigurable client-server setup? I enabled virtualization on my Win10 pro box, activated hyper-V. But then I realized I need to have a Windows installer... 😄 Am I on correct path...? |
I'm looking in to writing some unit style tests for System.DirectoryServices.Protocols (I don't think this should clash with your work).
Does anyone know why this happens? |
@hughbe it's for reason 3. :) there is no coverage matching the I added |
I guess that makes sense - was thrown off by the missing PDBs stuff, thought it was a configuration issue. Cheers! |
There are a number of different options available for LDAP servers. Active Directory - Available only as a windows server role Each of the namespaces in S.DS.* has different directory server requirements. S.DS -Requires any LDAP v3 compliant server. As long as we keep the configuration out of the code we should be able to write generic tests for S.DS and S.DS.P which work against any server type. Starting with AD LDS or Open LDAP is probably the easiest route unless you already have a Windows Server license. To install AD LDS on Windows 10 client
|
@tquerec I'm trying to find "Active Directory Lightweight Directory Services" but can't seem to find anything in the panel |
@hughbe It's perhaps no help to you other than to save you wasting more time scrolling up and down, but this is what it looks like here: (Windows 10 Pro 10.0.14393) Are you using Pro or Home? |
I don't get that unfortunately... I have home edition |
Hmm.. so what's the status here? Is anyone currently working on the DirectoryServices tests ? |
@karelz I think I can start on this now. To start with I have created an instance of AD LDS on my Win 10 Pro machine at home as mentioned by @tquerec in one of the previous posts. From here, I think there are two things to be done predominantly - write tests using local instance and then wrap up whole thing using scripts to setup and tear down the instances (may be per build job run), including execution of the test cases. But I think for second to be done, basic tests need to be in place... Hope I'm thinking in right direction. The second part itself being an area of its own - automation infra as already discussed in this thread... So if I were to do some quick stuff for part 1 i.e. creating test cases, can someone please point me to the API set that I can use to begin with. Or if I need to do something else, please let me know. I'll make them generic enough in terms of the server and instance to be used, as mentioned in this thread. I think do I sound as if I've suddenly woken out of sleep 😄 ? |
@tarekgh is it done? Can you please assign it to yourself and update appropriately? Thanks! |
assigned it to me. |
Relocating my query from the merged PR dotnet/corefx#24533 to this thread... Hi @tarekgh, I have got ADLDS instance installed on my Windows 10 desktop. I am trying to get correct configuration of the same. I have edited the configuration.xml. But with this the tests are failing. Is this correct config? Please note that my home PC is a Windows 10 machine in work group; essentially no domain. Appreciate your inputs and if there are some steps to get this working on a desktop. (Background: as we discussed on the PR, I wanted to get tests running on my local machine before starting to contribute. But since OpenDJ is asking for signing up with company name, etc. I switched over to ADLDS). localhost 389 cn=Directory Manager password ServerBind,None Also are there any specific steps to create a particularly named instance using ADSI Edit?Thanks, |
@WinCPP I I believe you have to have a Windows Server installed with Active Directory. ADLDS you have installed on the client is just to manage the AD on the server. CC @tquerec who is the expert here and can advise better regarding the needed configuration. |
Just to give background about what I have done... I installed ADLDS on Windows 10 as per discussion in this thread (ref. this comment). I think that has resulted into installation of active directory (lightweight) on my windows 10 machine; please refer to the image towards end of this comment. Between OpenDJ is proving to be a problem because it asks me to register to be able to download OpenDJ and that registration requires Company name. I tried with company name as "home" (can't give my real employer's name ... legal restrictions) and I never got the email to confirm my account with ForgeRock!!! So kind of stuck... |
I didn't try this scenario but you may try the following configuration and let me know what you'll get: <?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<ServerName>localhost</ServerName>
<Domain>o=dotnetfoundation</Domain>
<Port>389</Port>
<User>Directory Manager</User>
<Password>password</Password>
<AuthenticationTypes>ServerBind,None</AuthenticationTypes>
</Configuration> does "Directory Manager" is your admin user account on your machine? if it is not, please try to use your admin user-name and password. |
forgot to mention, I'll try your scenario too early next week too to ensure this work. |
@WinCPP I have installed LDS and tried it. what you need to do is use the configuration <?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<ServerName>localhost</ServerName>
<Domain>o=dotnetfoundation</Domain>
<Port>389</Port>
<User>Directory Manager</User>
<Password>password</Password>
<AuthenticationTypes>Secure</AuthenticationTypes>
</Configuration> note that, the user and password should be your machine user account which installed LDS. Also, the domain value "o=dotnetfoundation" should be the DN you used to create a partition when installing LDS. AuthenticationTypes has to be Secure. After that, you'll be able to bind to LDS but some tests will still fail. the reason is the schema used in LDS is different than the schema in the AD servers. one example is, the organizionalRole class is not defined at all on LDS. to fix that, either we try to import such schema data from the server or we fix the test to use classes defined in both LDS and AD server (and LDAP services). Is this something can be interesting to you to look at? Please let me know, otherwise, I'll try to look at this issue later and fix it. Thank you. |
@tarekgh Thank you. I will try this out to have the local setup working with LDS. After that I am interested in fixing the test classes to make it work with LDS and AD Server as you mentioned above. |
Hi @tarekgh I got the tests working on my AD LDS setup with the credentials related changes that you mentioned. Just like you mentioned, the tests that make use of "OrganizationalRole" class are failing. I searched the internet to get the ldif files for OrganizationalRole, but looks like I will not find them, probably because they are proprietary...? Don't know. Also I don't have AD Server setup as my machine at home is not server class. So not sure how to proceed. Between, ADLDS appears to have "Roles" container at the "Organization" level and same are not supported at "Organizational Unit" levels. So are we alternatively looking to make the tests work with ADLDS by having function overloads depending on the Active Directory installation type? |
@WinCPP thank you for looking at this issue. It is better we look for the classes which are common between the server and LDS schema. and then we can update the tests to use these classes instead. we need to ensure. can you do this search? I may be able to help in that early next week too if you get stuck. |
@WinCPP I am closing this issue as we already added the needed tests. feel free to open a new issue to track support running the tests against LDS. Thank you. |
DirectoryServices has been ported without any test cases (see #14734). The tests require client-server setup (server running on Windows "Desktop" .NET Framework), which we do not support in our CI/test infrastructure.
Moreover the AD test server cannot run as public-internet-facing Azure server for the tests (it is not recommended by AD server team) :(
Idea: Create schema for adding tests, which will run only manually. Write the tests in such way that once we have client-server setup in CI/test infra, it will be easy to wrap them/migrate them into that structure.
Execution plan
@tquerec @jay98014 can you please help us /guide us to create [1]. How to install AD test server locally / in a VM? Can you give us one Desktop test for DirectoryServices as example?
We should be able to make progress on [2] and [3] without your direct help.
The text was updated successfully, but these errors were encountered: