LdapSessionOptions.ReferralChasing property setter doesn't work on all Linux platforms

Open
#112,146 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
40/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start with src/libraries/System.DirectoryServices.Protocols/tests/LdapSessionOptionsTests.cs, especially ReferralChasing_Set_GetReturnsExpected_On_Linux, and inspect the Linux ReferralChasing setter shown in the issue. Reproduce the failure on CentOS, Debian, or the listed Ubuntu Mono configuration, then determine whether the setter or the test should account for unsupported None behavior. Done means the intended behavior is established and the relevant test passes on affected platforms.

Written by the indexing model from the issue text.

Description

area-System.DirectoryServices help wanted test-bug

These tests were recently re-enabled for Linux (all tests were disabled) and a recent DI test run for https://github.com/dotnet/runtime/pull/111877 had failures for:

[Centos.9.Amd64.Open]
[Debian.13.Amd64.Open]
[net10.0-linux-Debug-x64-Mono_Interpreter_Debug-Ubuntu.2204.Amd64.Open]

with test failure:

   at System.DirectoryServices.Protocols.Tests.LdapSessionOptionsTests.ReferralChasing_Set_GetReturnsExpected_On_Linux(ReferralChasingOptions value) in /_/src/libraries/System.DirectoryServices.Protocols/tests/LdapSessionOptionsTests.cs:line 43

Assert.Equal() Failure: Values differ
Expected: None
Actual:   All

Apparently, setting the value for None, which converts to 0 \ false for Linux when setting that bool property doesn't stick and the getter always returns All. Here's the current source for the Linux version of the setter for public ReferralChasingOptions ReferralChasing:

 SetBoolValueHelper(LdapOption.LDAP_OPT_REFERRALS, value == ReferralChasingOptions.All);

This tests past locally for me on Ubuntu.

Flagging as potential test bug, since these other platforms may not support a None options.

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.