dotnet/runtime

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

Open

#112,146 建立於 2025年2月4日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)C# (5,445 fork)batch import
area-System.DirectoryServiceshelp wantedtest-bug

倉庫指標

Star
 (17,886 star)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

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.

貢獻者指南