8000 Test failures on Linux under Admin account · Issue #3659 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Test failures on Linux under Admin account #3659

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

Closed
anmenaga opened this issue Apr 27, 2017 · 2 comments
Closed

Test failures on Linux under Admin account #3659

anmenaga opened this issue Apr 27, 2017 · 2 comments
Labels
Resolution-Duplicate The issue is a duplicate. WG-Quality-Test issues in a test or in test infrastructure

Comments

@anmenaga
Copy link

A couple of tests fail during a test run under 'sudo'ed PowerShell or 'su'.

Steps to reproduce

sudo /home/andrew/PowerShell/src/powershell-unix/bin/Linux/netcoreapp2.0/debian.8-x64/publish/powershell
Invoke-Pester /home/andrew/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1
sudo /home/andrew/PowerShell/src/powershell-unix/bin/Linux/netcoreapp2.0/debian.8-x64/publish/powershell
Invoke-Pester /home/andrew/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1

Expected behavior

100% test pass

Actual behavior

 [-] Export-Alias for Force ReadOnly Test 587ms
   Expected string length 64 but was 13. Strings differ at index 0.
   Expected: {FileOpenFailure,Microsoft.PowerShell.Commands.ExportAliasCommand}
   But was:  {No Exception!}
   -----------^
   at line: 124 in /home/andrew/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1
   124: 			$_.FullyQualifiedErrorId | Should be "FileOpenFailure,Microsoft.PowerShell.Commands.ExportAliasCommand"
 [-] Should error correctly when failing to create a symbolic link 385ms
   Expected string length 81 but was 59. Strings differ at index 7.
   Expected: {NewItemSymbolicLinkElevationRequired,Microsoft.PowerShell.Commands.NewItemCommand}
   But was:  {NewItemIOError,Microsoft.PowerShell.Commands.NewItemCommand}
   ------------------^
   at line: 186 in /home/andrew/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1
   186:             $_.FullyQualifiedErrorId | Should Be "NewItemSymbolicLinkElevationRequired,Microsoft.PowerShell.Commands.NewItemCommand"

Environment data

$psversiontable

Name                           Value
----                           -----
BuildVersion                   3.0.0.0
CLRVersion
GitCommitId                    v6.0.0-alpha.18-36-ga2268ab3ecb6c1addffbedba0606aa6c95809dd4-dirty
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSEdition                      Core
PSRemotingProtocolVersion      2.3
PSVersion                      6.0.0-alpha
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Get-Content /etc/os-release -Raw
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
@anmenaga anmenaga added the WG-Quality-Test issues in a test or in test infrastructure label Apr 27, 2017
@JamesWTruher
Copy link
Collaborator
JamesWTruher commented Apr 27, 2017

it's probable that #1 above should be skipped in this context. When running in an elevated sudo context you pretty much have permissions to override anything, including creating files. It should be possible to run these tests correctly in a lowered context. (sudo -u underpowereduser ...)
essentially, when you're root, you've got power to do anything. It looks like $IsElevated may be the issue here as this test should be skipped when you're elevated.

@TravisEz13
Copy link
Member

This is basically a duplicate of #5645 which says we should tag the tests that are supposed to run as sudo

@iSazonov iSazonov added the Resolution-Duplicate The issue is a duplicate. label Mar 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate The issue is a duplicate. WG-Quality-Test issues in a test or in test infrastructure
Projects
None yet
Development

No branches or pull requests

4 participants
0