Skip to content

Conversation

@adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Jan 15, 2021

Fixes #46619

this is to try to make TestUserCredentialsPropertiesOnWindows stable on Windows Server Core
@adamsitnik adamsitnik added area-System.Diagnostics.Process test-bug Problem in test source code (most likely) labels Jan 15, 2021
@adamsitnik adamsitnik added this to the 6.0.0 milestone Jan 15, 2021
@ghost
Copy link

ghost commented Jan 15, 2021

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details
Author: adamsitnik
Assignees: -
Labels:

area-System.Diagnostics.Process, test bug

Milestone: 6.0.0

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

What if we don't give the user rigts to execute it at all?
@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik adamsitnik marked this pull request as ready for review January 15, 2021 12:23
@adamsitnik
Copy link
Member Author

@eiriktsarpalis it's now properly passing


// ensure the new user can access the .exe (otherwise you get Access is denied exception)
SetAccessControl(username, p.StartInfo.FileName, add: true);
if (PlatformDetection.IsNotWindowsServerCore) // for this particular Windows version it fails with Attempted to perform an unauthorized operation (#46619)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is still valid without this? If the test succeeds without this on Windows Server Core, why is it needed on other Windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this recently when I was working on re-enabling this test and it was mandatory on my machine to make it work (#46083)

I have no idea why it does not work on machines from this certain pool. Is it a thing related to Windows Server? Some custom helix machine setup?

The test is restricted to admin accounts only:

[ConditionalFact(nameof(IsAdmin_IsNotNano_RemoteExecutorIsSupported))] // Nano has no "netapi32.dll", Admin rights are required

private static bool IsAdmin_IsNotNano_RemoteExecutorIsSupported
=> PlatformDetection.IsWindowsAndElevated && PlatformDetection.IsNotWindowsNanoServer && RemoteExecutor.IsSupported;

Which makes it even more confusing (I would assume that Admin accounts which can create other user accounts can also add permissions to files?)

Copy link
Member

@danmoseley danmoseley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to know the answer too, but merging this gets us into a better state.

@danmoseley
Copy link
Member

Hit this again -- so I'm merging!

@danmoseley
Copy link
Member

unrelated failures.

@danmoseley danmoseley merged commit 8241168 into dotnet:master Feb 4, 2021
@adamsitnik adamsitnik deleted the test46619 branch February 5, 2021 08:49
@ghost ghost locked as resolved and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Diagnostics.Process test-bug Problem in test source code (most likely)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure: System.Diagnostics.Tests.ProcessStartInfoTests.TestUserCredentialsPropertiesOnWindows

3 participants