From fd75d29628fa473e4455b8bee01ced87565f8750 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Tue, 11 Aug 2015 16:03:00 -0700 Subject: [PATCH 01/40] changed ParsePathCommand.cs to get Split-Path unit tests to pass --- src/monad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monad b/src/monad index df562ce7ec..1b1329dfaa 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit df562ce7ecd60fb42e30702116123c8a58bf04d4 +Subproject commit 1b1329dfaa038799d0a9de5f17b6d3737abd2319 From 5968e97eaa1015424a72bb2cfbc344f5698b77b2 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Thu, 13 Aug 2015 11:40:07 -0700 Subject: [PATCH 02/40] changed PowerShell code to get Split-Path -Qualifier working in linux --- src/monad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monad b/src/monad index 1b1329dfaa..9d5fa55fce 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 1b1329dfaa038799d0a9de5f17b6d3737abd2319 +Subproject commit 9d5fa55fceaff9514c5ffa26a0e1af01df05b7f3 From 4862e6cfd8cb77c6cb1440eb72431d8a729c453a Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Mon, 17 Aug 2015 15:03:14 -0700 Subject: [PATCH 03/40] added more tests to more thoroughly test split-path --- src/pester-tests/Test-Split-Path.Tests.ps1 | 48 ++++++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index c599b2382d..f4965bd0fe 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -1,36 +1,66 @@ Describe "Test-Split-Path" { <# Dependencies: + 1. Split-Path - FUT 2. ForEach 3. Object piping 4. ls/Get-ChildItem - filter output of ls + parent and Literal + #> It "Should return a string object when invoked" { - (Split-Path .).GetType().Name | Should Be "String" - (Split-Path . -Leaf).GetType().Name | Should Be "String" - (Split-Path . -Resolve).GetType().Name | Should Be "String" + ( Split-Path . ).GetType().Name | Should Be "String" + ( Split-Path . -Leaf ).GetType().Name | Should Be "String" + ( Split-Path . -Resolve ).GetType().Name | Should Be "String" } It "Should return the name of the drive when the qualifier switch is used" { - Split-Path / -Qualifier | Should Be "/" + Split-Path / -Qualifier | Should Be "/" + Split-Path /usr/bin -Qualifier | Should Be "/" + } + + It "Should error when using the qualifier switch for a windows path while on a nonwindows machine" { + Split-Path "C:\Users" -Qualifier -ErrorAction SilentlyContinue | Should Throw + } + + It "Should error when no directory separator characters are used with a qualifier" { + Split-Path "abadTest" -Qualifier -ErrorAction SilentlyContinue | Should Throw + } + + It "Should return the path minus the drive when the noqualifier switch is used" { + { Split-Path /usr/bin -NoQualifier } | Should Not Throw + Split-Path /usr/bin -NoQualifier | Should Be "usr/bin" } It "Should return the parent folder name when the leaf switch is used" { - Split-Path . -Leaf | Should be "pester-tests" + Split-Path /usr/bin -Leaf | Should be "bin" } It "Should be able to accept regular expression input and output an array for multiple objects" { - (Split-Path *Get*.ps1 -Leaf -Resolve).GetType().BaseType.Name | Should Be "Array" + ( Split-Path *Get*.ps1 -Leaf -Resolve ).GetType().BaseType.Name | Should Be "Array" } It "Should be able to tell if a given path is an absolute path" { - (Split-Path /usr/bin -IsAbsolute) | Should be $true - (Split-Path . -IsAbsolute) | Should be $false + ( Split-Path /usr/bin -IsAbsolute ) | Should be $true + ( Split-Path . -IsAbsolute ) | Should be $false } It "Should support piping" { - ("." | Split-Path -leaf) | Should Be "pester-tests" + ( "/usr/bin" | Split-Path ) | Should Be "/usr" } + + It "Should return the path up to the parent of the directory when Parent switch is used" { + Split-Path "/usr/bin" | Should Be ( Split-Path "/usr/bin" -Parent ) + } + + It "Should not throw if a parameterSetName is correct" { + { Split-Path "/usr/bin/" -Parent } | Should Not Throw + } + + It "Should throw if a parameterSetName is incorrect" { + { Split-Path "/usr/bin/" -Parentaoeu } | Should Throw + } + } From 2689741ddc6a3fe4bea7a20ae4c64f505e9adfb0 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Mon, 17 Aug 2015 15:07:00 -0700 Subject: [PATCH 04/40] added support for PSL to remove qualifiers correctly --- src/monad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monad b/src/monad index 9d5fa55fce..0a5744c8da 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 9d5fa55fceaff9514c5ffa26a0e1af01df05b7f3 +Subproject commit 0a5744c8da185fdde71fe7df7424978875476fb9 From 4f4cbbac2e072bf85d263a0829e6caa2fe96597c Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Thu, 20 Aug 2015 11:49:01 -0700 Subject: [PATCH 05/40] added tests to get working in linux --- src/pester-tests/Test-Remove-Item.Tests.ps1 | 152 ++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 src/pester-tests/Test-Remove-Item.Tests.ps1 diff --git a/src/pester-tests/Test-Remove-Item.Tests.ps1 b/src/pester-tests/Test-Remove-Item.Tests.ps1 new file mode 100644 index 0000000000..ef8244fd50 --- /dev/null +++ b/src/pester-tests/Test-Remove-Item.Tests.ps1 @@ -0,0 +1,152 @@ +Describe "Test-Remove-Item" { + $testpath = "/tmp/" + $testfile = "testfile.txt" + $testfilepath = $testpath + $testfile + Context "File removal Tests" { + BeforeEach { + # redundant code in case the AfterEach fails + if (Test-Path $testfilepath) + { + Remove-Item $testfilepath -Force + } + + New-Item -Name $testfile -Path $testpath -ItemType "file" -Value "lorem ipsum" + + Test-path $testfilepath | Should Be $true + } + + AfterEach { + if (Test-Path $testfilepath) + { + Remove-Item $testfilepath -Force + } + + Test-Path $testfilepath | Should Be $false + } + + It "Should be able to be called on a regular file without error using the Path switch" { + { Remove-Item -Path $testfilepath } | Should Not Throw + } + + It "Should be able to be called on a file without the Path switch" { + { Remove-Item $testfilepath } | Should Not Throw + } + + It "Should be able to call the rm alias" { + { rm $testfilepath } | Should Not Throw + } + + It "Should be able to call the del alias" { + { del $testfilepath } | Should Not Throw + } + + It "Should be able to call the erase alias" { + { erase $testfilepath } | Should Not Throw + } + + It "Should be able to call the ri alias" { + { ri $testfilepath } | Should Not Throw + } + + It "Should not be able to remove a read-only document without using the force switch" { + # Set to read only + Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $true + # attempt to remove the file + { Remove-Item $testfilepath -ErrorAction SilentlyContinue } | Should Not Throw + # validate + Test-Path $testfilepath | Should Be $true + + # set to not be read only + Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $false + # remove + Remove-Item $testfilepath -Force + # Validate + Test-Path $testfilepath | Should Be $false + } + + It "Should be able to remove all files matching a regular expression with the include switch" { + # Create multiple files with specific string + New-Item -Name file1.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file2.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file3.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + # Create a single file that does not match that string - already done in BeforeEach + + # Delete the specific string + Remove-Item /tmp/* -Include file*.txt + # validate that the string under test was deleted, and the nonmatching strings still exist + Test-path /tmp/file1.txt | Should Be $false + Test-path /tmp/file2.txt | Should Be $false + Test-path /tmp/file3.txt | Should Be $false + Test-Path $testfilepath | Should Be $true + + # Delete the non-matching strings + Remove-Item $testfilepath + } + + It "Should be able to not remove any files matching a regular expression with the exclude switch" { + # Create multiple files with specific string + New-Item -Name file1.wav -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file2.wav -Path $testpath -ItemType "file" -Value "lorem ipsum" + + # Create a single file that does not match that string + New-Item -Name file1.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file2.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + + # Delete the specific string + Remove-Item /tmp/file* -Exclude *.wav -Include *.txt + + # validate that the string under test was deleted, and the nonmatching strings still exist + Test-Path /tmp/file1.wav | Should Be $true + Test-Path /tmp/file2.wav | Should Be $true + Test-Path /tmp/file1.txt | Should Be $false + Test-path /tmp/file2.txt | Should Be $false + + # Delete the non-matching strings + Remove-Item /tmp/file1.wav + Remove-Item /tmp/file2.wav + + Test-Path /tmp/file1.wav | Should Be $false + Test-Path /tmp/file2.wav | Should Be $false + } + } + + Context "Directory Removal Tests" { + $testdirectory = "/tmp/testdir" + $testsubdirectory = $testdirectory + "/subd" + BeforeEach{ + if (Test-Path $testdirectory) + { + Remove-Item $testdirectory -Force + } + + test-path $testdirectory | Should Be $false + + New-Item -Name "testdir" -Path "/tmp/" -ItemType "directory" + + test-path $testdirectory | Should Be $true + } + + AfterEach { + if (Test-Path $testdirectory) + { + Remove-Item $testdirectory -Recurse -Force + } + + Test-Path $testdirectory | Should Be $false + } + + It "Should be able to remove a directory" { + { Remove-Item $testdirectory } | Should Not Throw + } + + It "Should be able to recursively delete subfolders" { + New-Item -Name "subd" -Path $testdirectory -ItemType "directory" + New-Item -Name $testfile -Path $testsubdirectory -ItemType "file" -Value "lorem ipsum" + + $complexDirectory = $testsubdirectory + "/" + $testfile + test-path $complexDirectory | Should Be $true + + { Remove-Item $testdirectory -Recurse} | Should Not Throw + } + } +} From 8458e5779e84ce5c1299b6e02cb3ffd5f8e6ab01 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 21 Aug 2015 14:34:00 -0700 Subject: [PATCH 06/40] brought in submodule changes and modded test to not expect the / to be removed in the path --- src/monad | 2 +- src/pester-tests/Test-Split-Path.Tests.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/monad b/src/monad index 0a5744c8da..4e2140b943 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 0a5744c8da185fdde71fe7df7424978875476fb9 +Subproject commit 4e2140b9436b5e5978752539ad06dbb0828f9b7e diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index f4965bd0fe..33c1f5a96c 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -29,9 +29,9 @@ Split-Path "abadTest" -Qualifier -ErrorAction SilentlyContinue | Should Throw } - It "Should return the path minus the drive when the noqualifier switch is used" { + It "Should return the path when the noqualifier switch is used on a linux system" { { Split-Path /usr/bin -NoQualifier } | Should Not Throw - Split-Path /usr/bin -NoQualifier | Should Be "usr/bin" + Split-Path /usr/bin -NoQualifier | Should Be "/usr/bin" } It "Should return the parent folder name when the leaf switch is used" { From 632a11a6c653393a83797aa517bb8ea372485ac2 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 21 Aug 2015 14:58:34 -0700 Subject: [PATCH 07/40] fixed typo using parent switch --- src/pester-tests/Test-Split-Path.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index 33c1f5a96c..c200f35d5a 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -52,7 +52,7 @@ } It "Should return the path up to the parent of the directory when Parent switch is used" { - Split-Path "/usr/bin" | Should Be ( Split-Path "/usr/bin" -Parent ) + Split-Path "/usr/bin" -Parent | Should Be ( Split-Path "/usr/bin" -Parent ) } It "Should not throw if a parameterSetName is correct" { From 95e932d6d0a55d7283450edf737cffc241b1a39d Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 21 Aug 2015 15:51:27 -0700 Subject: [PATCH 08/40] removed AfterEach block because it's not required --- src/pester-tests/Test-Remove-Item.Tests.ps1 | 27 ++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/pester-tests/Test-Remove-Item.Tests.ps1 b/src/pester-tests/Test-Remove-Item.Tests.ps1 index ef8244fd50..fb21fbd58c 100644 --- a/src/pester-tests/Test-Remove-Item.Tests.ps1 +++ b/src/pester-tests/Test-Remove-Item.Tests.ps1 @@ -11,55 +11,60 @@ } New-Item -Name $testfile -Path $testpath -ItemType "file" -Value "lorem ipsum" - - Test-path $testfilepath | Should Be $true - } - - AfterEach { - if (Test-Path $testfilepath) - { - Remove-Item $testfilepath -Force - } - - Test-Path $testfilepath | Should Be $false } It "Should be able to be called on a regular file without error using the Path switch" { { Remove-Item -Path $testfilepath } | Should Not Throw + + Test-Path $testfilepath | Should Be $false } It "Should be able to be called on a file without the Path switch" { { Remove-Item $testfilepath } | Should Not Throw + + Test-Path $testfilepath | Should Be $false } It "Should be able to call the rm alias" { { rm $testfilepath } | Should Not Throw + + Test-Path $testfilepath | Should Be $false } It "Should be able to call the del alias" { { del $testfilepath } | Should Not Throw + + Test-Path $testfilepath | Should Be $false } It "Should be able to call the erase alias" { { erase $testfilepath } | Should Not Throw + + Test-Path $testfilepath | Should Be $false } It "Should be able to call the ri alias" { { ri $testfilepath } | Should Not Throw + + Test-Path $testfilepath | Should Be $false } It "Should not be able to remove a read-only document without using the force switch" { # Set to read only Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $true + # attempt to remove the file { Remove-Item $testfilepath -ErrorAction SilentlyContinue } | Should Not Throw + # validate Test-Path $testfilepath | Should Be $true # set to not be read only Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $false + # remove Remove-Item $testfilepath -Force + # Validate Test-Path $testfilepath | Should Be $false } From 8091785240a61948441a666a8af9a56aae54f01f Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 21 Aug 2015 15:57:34 -0700 Subject: [PATCH 09/40] Fixed whitespace and directory test assertions --- src/pester-tests/Test-Remove-Item.Tests.ps1 | 105 ++++++++++---------- 1 file changed, 50 insertions(+), 55 deletions(-) diff --git a/src/pester-tests/Test-Remove-Item.Tests.ps1 b/src/pester-tests/Test-Remove-Item.Tests.ps1 index fb21fbd58c..754ed84b0d 100644 --- a/src/pester-tests/Test-Remove-Item.Tests.ps1 +++ b/src/pester-tests/Test-Remove-Item.Tests.ps1 @@ -50,68 +50,68 @@ } It "Should not be able to remove a read-only document without using the force switch" { - # Set to read only - Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $true + # Set to read only + Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $true - # attempt to remove the file - { Remove-Item $testfilepath -ErrorAction SilentlyContinue } | Should Not Throw + # attempt to remove the file + { Remove-Item $testfilepath -ErrorAction SilentlyContinue } | Should Not Throw - # validate - Test-Path $testfilepath | Should Be $true + # validate + Test-Path $testfilepath | Should Be $true - # set to not be read only - Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $false + # set to not be read only + Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $false - # remove - Remove-Item $testfilepath -Force + # remove + Remove-Item $testfilepath -Force - # Validate - Test-Path $testfilepath | Should Be $false - } + # Validate + Test-Path $testfilepath | Should Be $false + } It "Should be able to remove all files matching a regular expression with the include switch" { - # Create multiple files with specific string - New-Item -Name file1.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" - New-Item -Name file2.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" - New-Item -Name file3.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" - # Create a single file that does not match that string - already done in BeforeEach + # Create multiple files with specific string + New-Item -Name file1.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file2.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file3.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + # Create a single file that does not match that string - already done in BeforeEach - # Delete the specific string - Remove-Item /tmp/* -Include file*.txt - # validate that the string under test was deleted, and the nonmatching strings still exist - Test-path /tmp/file1.txt | Should Be $false - Test-path /tmp/file2.txt | Should Be $false - Test-path /tmp/file3.txt | Should Be $false - Test-Path $testfilepath | Should Be $true + # Delete the specific string + Remove-Item /tmp/* -Include file*.txt + # validate that the string under test was deleted, and the nonmatching strings still exist + Test-path /tmp/file1.txt | Should Be $false + Test-path /tmp/file2.txt | Should Be $false + Test-path /tmp/file3.txt | Should Be $false + Test-Path $testfilepath | Should Be $true - # Delete the non-matching strings - Remove-Item $testfilepath + # Delete the non-matching strings + Remove-Item $testfilepath } It "Should be able to not remove any files matching a regular expression with the exclude switch" { - # Create multiple files with specific string - New-Item -Name file1.wav -Path $testpath -ItemType "file" -Value "lorem ipsum" - New-Item -Name file2.wav -Path $testpath -ItemType "file" -Value "lorem ipsum" + # Create multiple files with specific string + New-Item -Name file1.wav -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file2.wav -Path $testpath -ItemType "file" -Value "lorem ipsum" - # Create a single file that does not match that string - New-Item -Name file1.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" - New-Item -Name file2.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + # Create a single file that does not match that string + New-Item -Name file1.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" + New-Item -Name file2.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" - # Delete the specific string - Remove-Item /tmp/file* -Exclude *.wav -Include *.txt + # Delete the specific string + Remove-Item /tmp/file* -Exclude *.wav -Include *.txt - # validate that the string under test was deleted, and the nonmatching strings still exist - Test-Path /tmp/file1.wav | Should Be $true - Test-Path /tmp/file2.wav | Should Be $true - Test-Path /tmp/file1.txt | Should Be $false - Test-path /tmp/file2.txt | Should Be $false + # validate that the string under test was deleted, and the nonmatching strings still exist + Test-Path /tmp/file1.wav | Should Be $true + Test-Path /tmp/file2.wav | Should Be $true + Test-Path /tmp/file1.txt | Should Be $false + Test-path /tmp/file2.txt | Should Be $false - # Delete the non-matching strings - Remove-Item /tmp/file1.wav - Remove-Item /tmp/file2.wav + # Delete the non-matching strings + Remove-Item /tmp/file1.wav + Remove-Item /tmp/file2.wav - Test-Path /tmp/file1.wav | Should Be $false - Test-Path /tmp/file2.wav | Should Be $false + Test-Path /tmp/file1.wav | Should Be $false + Test-Path /tmp/file2.wav | Should Be $false } } @@ -131,17 +131,10 @@ test-path $testdirectory | Should Be $true } - AfterEach { - if (Test-Path $testdirectory) - { - Remove-Item $testdirectory -Recurse -Force - } - - Test-Path $testdirectory | Should Be $false - } - It "Should be able to remove a directory" { { Remove-Item $testdirectory } | Should Not Throw + + Test-Path $testdirectory | Should Be $false } It "Should be able to recursively delete subfolders" { @@ -152,6 +145,8 @@ test-path $complexDirectory | Should Be $true { Remove-Item $testdirectory -Recurse} | Should Not Throw + + Test-Path $testdirectory | Should Be $false } } -} +} From df2a4939ed374ee19cd22982842553e0f9c433fb Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 26 Aug 2015 10:53:36 -0700 Subject: [PATCH 10/40] added code review changes --- src/pester-tests/Test-Split-Path.Tests.ps1 | 48 ++++++++++++++-------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index c200f35d5a..ec3283057b 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -1,15 +1,8 @@ Describe "Test-Split-Path" { -<# - Dependencies: + $testDir = "/tmp" + $testfile = "testfile.ps1" + $FullyQualifiedTestFile = $testDir + "/" + $testFile - 1. Split-Path - FUT - 2. ForEach - 3. Object piping - 4. ls/Get-ChildItem - filter output of ls - - parent and Literal - -#> It "Should return a string object when invoked" { ( Split-Path . ).GetType().Name | Should Be "String" ( Split-Path . -Leaf ).GetType().Name | Should Be "String" @@ -22,6 +15,9 @@ } It "Should error when using the qualifier switch for a windows path while on a nonwindows machine" { + # ErrorAction SilentlyContinue merely suppresses the error from the console. + # Throwing exceptions still seen by Pester. + Split-Path "C:\Users" -Qualifier -ErrorAction SilentlyContinue | Should Throw } @@ -31,7 +27,7 @@ It "Should return the path when the noqualifier switch is used on a linux system" { { Split-Path /usr/bin -NoQualifier } | Should Not Throw - Split-Path /usr/bin -NoQualifier | Should Be "/usr/bin" + Split-Path /usr/bin -NoQualifier | Should Be "/usr/bin" } It "Should return the parent folder name when the leaf switch is used" { @@ -39,12 +35,32 @@ } It "Should be able to accept regular expression input and output an array for multiple objects" { - ( Split-Path *Get*.ps1 -Leaf -Resolve ).GetType().BaseType.Name | Should Be "Array" + $testfile2 = "testfilenumber2.ps1" + $FullyQualifiedTestFile2 = $testDir + "/" + $testfile2 + + New-Item -ItemType file -Path $FullyQualifiedTestFile, $FullyQualifiedTestFile2 + + Test-Path $FullyQualifiedTestFile | Should Be $true + Test-Path $FullyQualifiedTestFile2 | Should Be $true + + ( Split-Path /tmp/*estf*.ps1 -Leaf -Resolve ).GetType().BaseType.Name | Should Be "Array" + ( Split-path /tmp/*estf*.ps1 -Leaf -Resolve )[0] | Should Be $testfile + ( Split-path /tmp/*estf*.ps1 -Leaf -Resolve )[1] | Should Be $testfile2 + + Remove-Item $FullyQualifiedTestFile, $FullyQualifiedTestFile2 } It "Should be able to tell if a given path is an absolute path" { ( Split-Path /usr/bin -IsAbsolute ) | Should be $true + ( Split-Path .. -IsAbsolute ) | Should be $false + ( Split-Path /usr/.. -IsAbsolute ) | Should be $true + ( Split-Path /usr/../ -IsAbsolute ) | Should be $true + ( Split-Path ../ -IsAbsolute ) | Should be $false ( Split-Path . -IsAbsolute ) | Should be $false + ( Split-Path ~/ -IsAbsolute ) | Should be $false + ( Split-Path ~/.. -IsAbsolute ) | Should be $false + ( Split-Path ~/../.. -IsAbsolute ) | Should be $false + } It "Should support piping" { @@ -52,15 +68,11 @@ } It "Should return the path up to the parent of the directory when Parent switch is used" { - Split-Path "/usr/bin" -Parent | Should Be ( Split-Path "/usr/bin" -Parent ) - } - - It "Should not throw if a parameterSetName is correct" { - { Split-Path "/usr/bin/" -Parent } | Should Not Throw + Split-Path "/usr/bin" -Parent | Should Be "/usr" } It "Should throw if a parameterSetName is incorrect" { - { Split-Path "/usr/bin/" -Parentaoeu } | Should Throw + { Split-Path "/usr/bin/" -Parentaoeu } | Should Throw "A parameter cannot be found that matches parameter name" } } From f4ea2ba4f844157a0f43a4398264b3391c324770 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 26 Aug 2015 11:17:52 -0700 Subject: [PATCH 11/40] added tests from CR --- src/pester-tests/Test-Split-Path.Tests.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index ec3283057b..cfd7ada3ed 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -31,7 +31,9 @@ } It "Should return the parent folder name when the leaf switch is used" { - Split-Path /usr/bin -Leaf | Should be "bin" + Split-Path /usr/bin -Leaf | Should be "bin" + Split-Path /usr/local/bin -Leaf | Should be "bin" + Split-Path usr/bin -Leaf | Should be "bin" } It "Should be able to accept regular expression input and output an array for multiple objects" { @@ -68,7 +70,9 @@ } It "Should return the path up to the parent of the directory when Parent switch is used" { - Split-Path "/usr/bin" -Parent | Should Be "/usr" + Split-Path "/usr/bin" -Parent | Should Be "/usr" + Split-Path "/usr/local/bin" -Parent | Should Be "/usr/local" + Split-Path "usr/local/bin" -Parent | Should Be "usr/local" } It "Should throw if a parameterSetName is incorrect" { From 38c1047ebaf265c562171257e1e7f19dc49dafef Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 26 Aug 2015 12:56:38 -0700 Subject: [PATCH 12/40] Added logic to handle failing jenkins test --- src/pester-tests/Test-Split-Path.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index cfd7ada3ed..e0c69c83c7 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -40,7 +40,7 @@ $testfile2 = "testfilenumber2.ps1" $FullyQualifiedTestFile2 = $testDir + "/" + $testfile2 - New-Item -ItemType file -Path $FullyQualifiedTestFile, $FullyQualifiedTestFile2 + New-Item -ItemType file -Path $FullyQualifiedTestFile, $FullyQualifiedTestFile2 -Force Test-Path $FullyQualifiedTestFile | Should Be $true Test-Path $FullyQualifiedTestFile2 | Should Be $true From f475db96cb5653dd0462a2598428538b8c8c4889 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 26 Aug 2015 14:30:02 -0700 Subject: [PATCH 13/40] using a created temp directory instead of the root temp directory. --- src/pester-tests/Test-Split-Path.Tests.ps1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index e0c69c83c7..5a50791b75 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -1,8 +1,9 @@ Describe "Test-Split-Path" { - $testDir = "/tmp" + # Use the local directory because it's renewed each time with the correct privileges + $testDir = "./tmp" $testfile = "testfile.ps1" $FullyQualifiedTestFile = $testDir + "/" + $testFile - +ls It "Should return a string object when invoked" { ( Split-Path . ).GetType().Name | Should Be "String" ( Split-Path . -Leaf ).GetType().Name | Should Be "String" @@ -45,11 +46,14 @@ Test-Path $FullyQualifiedTestFile | Should Be $true Test-Path $FullyQualifiedTestFile2 | Should Be $true - ( Split-Path /tmp/*estf*.ps1 -Leaf -Resolve ).GetType().BaseType.Name | Should Be "Array" - ( Split-path /tmp/*estf*.ps1 -Leaf -Resolve )[0] | Should Be $testfile - ( Split-path /tmp/*estf*.ps1 -Leaf -Resolve )[1] | Should Be $testfile2 + ( Split-Path ./tmp/*estf*.ps1 -Leaf -Resolve ).GetType().BaseType.Name | Should Be "Array" + ( Split-path ./tmp/*estf*.ps1 -Leaf -Resolve )[0] | Should Be $testfile + ( Split-path ./tmp/*estf*.ps1 -Leaf -Resolve )[1] | Should Be $testfile2 Remove-Item $FullyQualifiedTestFile, $FullyQualifiedTestFile2 + + Test-Path $FullyQualifiedTestFile | Should Be $false + Test-Path $FullyQualifiedTestFile2 | Should Be $false } It "Should be able to tell if a given path is an absolute path" { @@ -78,5 +82,4 @@ It "Should throw if a parameterSetName is incorrect" { { Split-Path "/usr/bin/" -Parentaoeu } | Should Throw "A parameter cannot be found that matches parameter name" } - } From f8179859b154d006c1b15a91c2b062b907e983d5 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 26 Aug 2015 14:34:44 -0700 Subject: [PATCH 14/40] bringing submodules up to date --- src/monad | 2 +- src/monad-ext | 2 +- src/monad-native | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/monad b/src/monad index df562ce7ec..2793b76e2d 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit df562ce7ecd60fb42e30702116123c8a58bf04d4 +Subproject commit 2793b76e2d48f012a82b8e9106b9e9f496d3b785 diff --git a/src/monad-ext b/src/monad-ext index 20468e65da..ea31eca622 160000 --- a/src/monad-ext +++ b/src/monad-ext @@ -1 +1 @@ -Subproject commit 20468e65dac6fa5a1b4cf6971ff490e548531822 +Subproject commit ea31eca6223992fa9729af67518930b6b45829d3 diff --git a/src/monad-native b/src/monad-native index a99c56eea3..440cf6a236 160000 --- a/src/monad-native +++ b/src/monad-native @@ -1 +1 @@ -Subproject commit a99c56eea3264b8c492bc0edf5e3a65102397af9 +Subproject commit 440cf6a236067eba2d5dcfd5e3707a36295cee97 From 8456bf9d4d1450c413a7a0c66890795688079096 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 26 Aug 2015 15:13:12 -0700 Subject: [PATCH 15/40] added modifications from code review. --- src/pester-tests/Test-Remove-Item.Tests.ps1 | 37 +++++++-------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/src/pester-tests/Test-Remove-Item.Tests.ps1 b/src/pester-tests/Test-Remove-Item.Tests.ps1 index 754ed84b0d..2c1c0d9947 100644 --- a/src/pester-tests/Test-Remove-Item.Tests.ps1 +++ b/src/pester-tests/Test-Remove-Item.Tests.ps1 @@ -4,13 +4,10 @@ $testfilepath = $testpath + $testfile Context "File removal Tests" { BeforeEach { - # redundant code in case the AfterEach fails - if (Test-Path $testfilepath) - { - Remove-Item $testfilepath -Force - } + New-Item -Name $testfile -Path $testpath -ItemType "file" -Value "lorem ipsum" -Force + + Test-Path $testfilepath | Should Be $true - New-Item -Name $testfile -Path $testpath -ItemType "file" -Value "lorem ipsum" } It "Should be able to be called on a regular file without error using the Path switch" { @@ -54,18 +51,15 @@ Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $true # attempt to remove the file - { Remove-Item $testfilepath -ErrorAction SilentlyContinue } | Should Not Throw + { Remove-Item $testfilepath } | Should Not Throw # validate Test-Path $testfilepath | Should Be $true - # set to not be read only - Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $false - - # remove + # remove using the -force switch on the readonly object Remove-Item $testfilepath -Force - # Validate + # Validate Test-Path $testfilepath | Should Be $false } @@ -82,10 +76,12 @@ Test-path /tmp/file1.txt | Should Be $false Test-path /tmp/file2.txt | Should Be $false Test-path /tmp/file3.txt | Should Be $false - Test-Path $testfilepath | Should Be $true + Test-Path $testfilepath | Should Be $true # Delete the non-matching strings Remove-Item $testfilepath + + Test-Path $testfilepath | Should Be $false } It "Should be able to not remove any files matching a regular expression with the exclude switch" { @@ -95,7 +91,6 @@ # Create a single file that does not match that string New-Item -Name file1.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" - New-Item -Name file2.txt -Path $testpath -ItemType "file" -Value "lorem ipsum" # Delete the specific string Remove-Item /tmp/file* -Exclude *.wav -Include *.txt @@ -104,7 +99,6 @@ Test-Path /tmp/file1.wav | Should Be $true Test-Path /tmp/file2.wav | Should Be $true Test-Path /tmp/file1.txt | Should Be $false - Test-path /tmp/file2.txt | Should Be $false # Delete the non-matching strings Remove-Item /tmp/file1.wav @@ -118,17 +112,10 @@ Context "Directory Removal Tests" { $testdirectory = "/tmp/testdir" $testsubdirectory = $testdirectory + "/subd" - BeforeEach{ - if (Test-Path $testdirectory) - { - Remove-Item $testdirectory -Force - } + BeforeEach { + New-Item -Name "testdir" -Path "/tmp/" -ItemType "directory" -Force - test-path $testdirectory | Should Be $false - - New-Item -Name "testdir" -Path "/tmp/" -ItemType "directory" - - test-path $testdirectory | Should Be $true + Test-Path $testdirectory | Should Be $true } It "Should be able to remove a directory" { From 8501e6e4abb63081a0ff2e3c2d1ab1866fc79f82 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 26 Aug 2015 15:55:44 -0700 Subject: [PATCH 16/40] fixing issue with errorAction not suppressed- produces false positives on the test logs --- src/pester-tests/Test-Remove-Item.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pester-tests/Test-Remove-Item.Tests.ps1 b/src/pester-tests/Test-Remove-Item.Tests.ps1 index 2c1c0d9947..017a461d7e 100644 --- a/src/pester-tests/Test-Remove-Item.Tests.ps1 +++ b/src/pester-tests/Test-Remove-Item.Tests.ps1 @@ -51,7 +51,7 @@ Set-ItemProperty -Path $testfilepath -Name IsReadOnly -Value $true # attempt to remove the file - { Remove-Item $testfilepath } | Should Not Throw + { Remove-Item $testfilepath -ErrorAction SilentlyContinue } | Should Not Throw # validate Test-Path $testfilepath | Should Be $true From 913b5a97d09d18104b934d24a2897cb38d207a44 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 28 Aug 2015 10:12:27 -0700 Subject: [PATCH 17/40] Pin src/monad to develop-2015-08-28 Build files updated. Patches squashed and rebased. --- scripts/gen/SYS_AUTO/ParserStrings.cs | 72 ++++++++++++++ scripts/gen/SYS_AUTO/ParserStrings.resources | Bin 58579 -> 59889 bytes .../gen/SYS_AUTO/RemotingErrorIdStrings.cs | 90 ++++++++++++++++++ .../SYS_AUTO/RemotingErrorIdStrings.resources | Bin 71102 -> 73027 bytes src/monad | 2 +- 5 files changed, 163 insertions(+), 1 deletion(-) diff --git a/scripts/gen/SYS_AUTO/ParserStrings.cs b/scripts/gen/SYS_AUTO/ParserStrings.cs index 5735d3e3c8..b8fe6662bc 100644 --- a/scripts/gen/SYS_AUTO/ParserStrings.cs +++ b/scripts/gen/SYS_AUTO/ParserStrings.cs @@ -595,6 +595,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to Failed to convert the value of CimProperty {0} to the property value of class {1}.. + /// + internal static string ConvertCimPropertyToObjectPropertyFailed { + get { + return ResourceManager.GetString("ConvertCimPropertyToObjectPropertyFailed", resourceCulture); + } + } + /// /// Looks up a localized string similar to Could not get dispatch ID for {0} (error: {1}).. /// @@ -838,6 +847,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to Keyword '{0}' already defined in the configuration.. + /// + internal static string DuplicateKeywordDefinition { + get { + return ResourceManager.GetString("DuplicateKeywordDefinition", resourceCulture); + } + } + /// /// Looks up a localized string similar to Duplicate named arguments '{0}' are not allowed.. /// @@ -1090,6 +1108,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to Property {0} of PowerShell class {1} is not declared as array type, but defined in its configuration instance as instance array type.. + /// + internal static string ExpectArrayTypeOfPropertyInPSClass { + get { + return ResourceManager.GetString("ExpectArrayTypeOfPropertyInPSClass", resourceCulture); + } + } + /// /// Looks up a localized string similar to An expression was expected after '('.. /// @@ -1430,6 +1457,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to Failed to create an object of PowerShell class {0}.. + /// + internal static string InstantiatePSClassObjectFailed { + get { + return ResourceManager.GetString("InstantiatePSClassObjectFailed", resourceCulture); + } + } + /// /// Looks up a localized string similar to '{0}': Interface name expected.. /// @@ -1538,6 +1574,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to The hashtable supplied to the Desired State Configuration resource {0} is not valid. The key or value cannot be null or empty.. + /// + internal static string InvalidHashtable { + get { + return ResourceManager.GetString("InvalidHashtable", resourceCulture); + } + } + /// /// Looks up a localized string similar to The member '{0}' is not valid. Valid members are ///'{1}'.. @@ -1602,6 +1647,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to The username supplied to the Desired State Configuration resource {0} is not valid. The username cannot be null or empty.. + /// + internal static string InvalidPassword { + get { + return ResourceManager.GetString("InvalidPassword", resourceCulture); + } + } + /// /// Looks up a localized string similar to The PowerShell data file '{0}' is invalid since it cannot be evaluated into a Hashtable object.. /// @@ -1665,6 +1719,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to The username supplied to the Desired State Configuration resource {0} is not valid. The username cannot be null or empty.. + /// + internal static string InvalidUserName { + get { + return ResourceManager.GetString("InvalidUserName", resourceCulture); + } + } + /// /// Looks up a localized string similar to Expression is not allowed in a Using expression.. /// @@ -2925,6 +2988,15 @@ internal class ParserStrings { } } + /// + /// Looks up a localized string similar to Property {0} is not declared in PowerShell class {1}, but defined in its configuration instance.. + /// + internal static string PropertyNotDeclaredInPSClass { + get { + return ResourceManager.GetString("PropertyNotDeclaredInPSClass", resourceCulture); + } + } + /// /// Looks up a localized string similar to The property '{0}' cannot be found on this object. Verify that the property exists and can be set.. /// diff --git a/scripts/gen/SYS_AUTO/ParserStrings.resources b/scripts/gen/SYS_AUTO/ParserStrings.resources index c0d703f77c91016be0c87e99811acff3dcb526b7..7efbef9ebfe374931e2a06132779e97807e587ca 100644 GIT binary patch delta 6170 zcmb7H33yahvaT+;f)ZoE5VLk}lFq(#cRE|AvvoS1z0=vr3h5-Bq?67cEK0=yPi%fA4#rg!|oFb#sU> zP9OTiqW2Fiy6i^H-pg-#bqIHG^ojhv?`sj4dH53M4w4iTalkomxzk6i4*C2%-ZfqQx#EZ6Z-dGf`9;QM`lb zWvuy20@1snwwdS>P-w)WXORE< z5bX{ya2KM#5GvS(Cy0oVu0o8x3!MibD(yrc!1;%W z_&R`XECNW>&SC`Vg8r372&@vUh9Un?f`-Z}80#b|K;fB_iC)C_zww=d_aO)J1f~o9GzW#DDSu&EH|;R21LS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NiXy@hT+wWwsg~E{`&yemR*$f{ zST!}EuFj@m4ft(cn3go)QeBYtHei3<97NRz>hT7Y*V~PF-aw=Ab)99#FBrSoA}geo z-fBeT2jWzHyzwlpG_-VhA*3NxZ&-xVh7hBhx62q*H1JB);BDMNtMIxNZ@fTj!I(95 zVU|v4MEOE)5Z+@ewl50C@rBX)_fcOMf)~YUViOiDa_RCW{3{>NHQ~&nOg-NO|HgEc zW-My7X;m}sXpGg(&3LgfNj(c z$)y`x5#1c6AGe~uIYhnNu)f)TU?~69T?YQ*ZvM9x8&#p9k{WjAfRLkOI*d`woy zeA*JL+6j+V0_{X{8TTdX#Ap`p#HYrAlBTaFHQ z;nlXxjL*Ax5><0=4oWG*4lwXP?mf$8b~h3H|KaNENR~@iH!|C8x}zHd?FGi~IW-hZ z+kNnJyPI)=R@`;VOSK2HJFM#4gOrYRP3*zij#zE(!R`*5(c3e+NB4GEaIM2b@9cs5 z61yJiLC%sWJ==q!C9yia7Y{FqFj9I)4~VNpKBHH6UD*r&&Qg7&7k!-}Q@s0l#*ab6 zQM<2EO*0<$EYApL`td-QQh2mn-;XD|Lo{Uo?{(X>W&oxhtDYM`aF0v92GQAL z*P8~hqbEf74&q=>k{%w!_p~k!BA_?Hm^MVEw)c6Vzt>$;hA`Y4t6f9b-&?GY4dKV$ z8Y5!q=x2LtUnq_@PSYEg;?6#&@d};Eqsu<+v*?6n7}xKZfMuLmgO);HYT~UQFT=|I zB%QS!d-|;!xB|!fBlNZv_czgcG + /// Looks up a localized string similar to Failed to find vmcompute.dll. The Hyper-V role may not be enabled on this machine.. + /// + internal static string CannotFindVmComputeDll { + get { + return ResourceManager.GetString("CannotFindVmComputeDll", resourceCulture); + } + } + /// /// Looks up a localized string similar to The call to Windows API GetStdHandle to get the Standard Error handle resulted in an error code: {0}.. /// @@ -538,6 +547,15 @@ internal class RemotingErrorIdStrings { } } + /// + /// Looks up a localized string similar to Could not find the toolkit, '{0}'. The toolkit must be a file named '{1}' within a 'Toolkits' directory in a module in the current module path.. + /// + internal static string CouldNotFindToolkit { + get { + return ResourceManager.GetString("CouldNotFindToolkit", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} is not a valid value for the parameter {1}. The value must be greater than or equal to 0.. /// @@ -767,6 +785,15 @@ internal class RemotingErrorIdStrings { } } + /// + /// Looks up a localized string similar to Could not parse visible command defintion for '{0}'. The visible command definition must be a hashtable with the keys of 'Name' and 'Parameters'. The value of the 'Parameters' key must be a collection of hashtables with the keys 'Name', and optionally either 'ValidateSet' or 'ValidatePattern'.. + /// + internal static string DISCCommandModificationSyntax { + get { + return ResourceManager.GetString("DISCCommandModificationSyntax", resourceCulture); + } + } + /// /// Looks up a localized string similar to Company associated with this session configuration. /// @@ -956,6 +983,15 @@ internal class RemotingErrorIdStrings { } } + /// + /// Looks up a localized string similar to User roles (security groups), and the additional configuration settings that should be applied to them. + /// + internal static string DISCRoleDefinitionsComment { + get { + return ResourceManager.GetString("DISCRoleDefinitionsComment", resourceCulture); + } + } + /// /// Looks up a localized string similar to Version number of the schema used for this configuration file. /// @@ -974,6 +1010,15 @@ internal class RemotingErrorIdStrings { } } + /// + /// Looks up a localized string similar to Toolkits to apply to this session configuration. This toolkit must be defined as a session configuration file named after that toolkit within a 'Toolkits' directory in a module in the current module path.. + /// + internal static string DISCToolkitsToLoadComment { + get { + return ResourceManager.GetString("DISCToolkitsToLoadComment", resourceCulture); + } + } + /// /// Looks up a localized string similar to Specifies the transport options for this session configuration. /// @@ -1629,6 +1674,33 @@ internal class RemotingErrorIdStrings { } } + /// + /// Looks up a localized string similar to The 'Roles' entry must be a hashtable, but was a {0}.. + /// + internal static string InvalidRoleEntry { + get { + return ResourceManager.GetString("InvalidRoleEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key '{0}' is not valid in a toolkit or role definition.. + /// + internal static string InvalidRoleToolkitKey { + get { + return ResourceManager.GetString("InvalidRoleToolkitKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not convert the value of the '{0}' role entry to a hashtable. The 'Roles' entry must be a hashtable with group names for keys, where the value associated with each key is another hashtable of session configuration properties for that role.. + /// + internal static string InvalidRoleValue { + get { + return ResourceManager.GetString("InvalidRoleValue", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} is not a valid schema value. Valid values are "http" and "https".. /// @@ -3053,6 +3125,15 @@ internal class RemotingErrorIdStrings { } } + /// + /// Looks up a localized string similar to Failed to create an instance of RemoteSessionHyperVSocketServer.. + /// + internal static string RemoteSessionHyperVSocketServerConstructorFailure { + get { + return ResourceManager.GetString("RemoteSessionHyperVSocketServerConstructorFailure", resourceCulture); + } + } + /// /// Looks up a localized string similar to Remote transport error: {0}. /// @@ -3837,6 +3918,15 @@ internal class RemotingErrorIdStrings { } } + /// + /// Looks up a localized string similar to WSMan Initialization failed with error code: {0}.. + /// + internal static string WSManInitFailed { + get { + return ResourceManager.GetString("WSManInitFailed", resourceCulture); + } + } + /// /// Looks up a localized string similar to The maximum number of WS-Man URI redirections to allow while connecting to a remote computer. /// diff --git a/scripts/gen/SYS_AUTO/RemotingErrorIdStrings.resources b/scripts/gen/SYS_AUTO/RemotingErrorIdStrings.resources index 7b771f8a5ad583b68e91c923db4e95fa57879e73..f3a113e04ac1b72a6186e7e803699fe47e4d7c54 100644 GIT binary patch delta 7701 zcmbVQ3wTu3wcfMH2@pbvkjLbGGI>lUnLH<9GI@u*$U7t=6zXT; zFMRJGi(M?lJ%K_j4H6=%Lx}5Bgm`7X5T!UlAp#JL1#*s6h_^F^*a-*w^+Fu& z6yi{w5Y9*;HsuSk3JWbpLID9ne4Q#p0TQz#kZ;3)*7yVo?5-E$j%*>$ri}^V zLR4Sm39%YKUk#$iKzWf6MqeR%Lxp&2nh5p>8bx2uiUFWtxvU9hlpRvVH)+7m-lGR3teI^*`PS zhs`jyqUP!7O*rp@gQI|aLxK?3qIE)4fD3SIQ15RwC_%CiO@QzLIDQagf5z_u=6w%H z2f+s;f*yj;-=c&U3WazRocacV96-?Fu=yE$tV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)P2L+l_0VyKnfcJxN$@#@D*Ry7|+YJSGPJjqM;qx6eQea z;Hx7N-c+U9aJ|g%Y`U!}N}Yq0>yb`1#jC?(zibGQYfVP=GNf4^+xF%R>1*~;)}_B{ zN_h5CLFNF5&OLTj#EE|{h! zpjq-C&GWMZ)br3RzOJcN-$KgwNG-FXRQQU2OZy--Lz)L$wRq3=<=?H4@Y${EJd|39 zYSEkptt4vmNT*%?>{=-Wa~x_7lqeQCwau9(2j=Mc$VxHJP2|s4O2yo4o_dSiKG)9e zx5&x4nSAsX`Fd_1-*T(i=4JB9Tjkw(mjB0R?^4B(#Y;E)B_2V+p=H#Ep<$Rl! zE7pp4yH)L9tDS%|+7o0^dk}xWR@SyVxN@ERvE9vE*U7bZD_>YA){b(89g@}6%2{{Hj;;#z=AGKnp3A`QtBc*9zaseO z4f3~c2Y8aq{%@Wd^$hU2lGCZE%EMvVk zp1wtn_Excbi+s~t%m=ne#sVvUzD0T$By#Ci*}1@>4sX>O*tIZ5zFOd~)Lp+yzLQhQ zewXAeY*mY)uErvloLlJ4Ki(x57H0C!yT!D~&a<{j<03adyiM+16 zeA^$*efLQ4k~qHq9&s&6_xk%i81H7Bl6?~C3iKVqLDKS{%R|r}Il82eGxx}h0h`*n zN4r5EABd6715y0i9(j16RMqX(k~uzLlz>4!Z`mu!gAVm4C|zP7#L7XV;(gj&Y0}w2 zgGz>!b6xTh8?MUb|l|4`uU%+9O2P3y1LJ8wQB6H90F(??GHxRkw4)Q|r#eNsy8kUYIP pNdCF$lM}kFo0NRJWA%xA8L^xQeQG@Y#QWb}2s`<`pRVSH{{xE-D0=_^ diff --git a/src/monad b/src/monad index 2793b76e2d..44427ec1f3 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 2793b76e2d48f012a82b8e9106b9e9f496d3b785 +Subproject commit 44427ec1f38f443a8b90a48e50a4d40beed0fa05 From 93199735d83449ef50303fb580bdb56625e8b140 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Thu, 27 Aug 2015 16:16:13 -0700 Subject: [PATCH 18/40] added unit test for getting the machine name from the p/invoke --- src/ps_test/test_CorePsPlatform.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index 99a3d8f3f2..0f937df3b2 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -65,5 +65,29 @@ namespace PSTests Assert.Equal(username, Platform.NonWindowsGetUserName()); } } + + [Fact] + public static void TestGetMachineName() + { + var startInfo = new ProcessStartInfo + { + FileName = @"/usr/hostname", + RedirectStandardOutput = true, + UseShellExecute = false + }; + using (Process process = Process.Start(startInfo)) + { + // Get output of call to hostname without trailing newline + string hostname = process.StandardOutput.ReadToEnd().Trim(); + process.WaitForExit(); + + // The process should return an exit code of 0 on success + Assert.Equal(0, process.ExitCode); + // It should be the same as what our platform code returns + Assert.Equal(hostname, Platform.NonWindowsGetMachineName()); + } + + + } } } From 6a88fe52aa81709656b40e18173c09e0271aa929 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 28 Aug 2015 14:45:56 -0700 Subject: [PATCH 19/40] Fix GetComputerName xUnit test and repin monad --- src/monad | 2 +- src/ps_test/test_CorePsPlatform.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/monad b/src/monad index 44427ec1f3..8e014f44d7 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 44427ec1f38f443a8b90a48e50a4d40beed0fa05 +Subproject commit 8e014f44d72765f086fe516e870602d5a476076e diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index 0f937df3b2..57e58bc32f 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -71,7 +71,8 @@ namespace PSTests { var startInfo = new ProcessStartInfo { - FileName = @"/usr/hostname", + FileName = @"/usr/bin/env", + Arguments = "hostname", RedirectStandardOutput = true, UseShellExecute = false }; From 10c772829dc7415de36f6c0971e55e4327d52532 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 28 Aug 2015 16:06:27 -0700 Subject: [PATCH 20/40] fixed unordering of files created during test --- src/monad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monad b/src/monad index 2793b76e2d..a1a05637eb 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 2793b76e2d48f012a82b8e9106b9e9f496d3b785 +Subproject commit a1a05637ebc40bdbfef51f8435e8592587a4eb5d From 534de9d15ffe3e1f3c48715f2871432fabfda2a4 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 28 Aug 2015 16:07:11 -0700 Subject: [PATCH 21/40] Match array instead of testing elements So that we can ignore the ordering from the regexp --- src/pester-tests/Test-Split-Path.Tests.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index 5a50791b75..64aae88114 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -46,9 +46,10 @@ ls Test-Path $FullyQualifiedTestFile | Should Be $true Test-Path $FullyQualifiedTestFile2 | Should Be $true - ( Split-Path ./tmp/*estf*.ps1 -Leaf -Resolve ).GetType().BaseType.Name | Should Be "Array" - ( Split-path ./tmp/*estf*.ps1 -Leaf -Resolve )[0] | Should Be $testfile - ( Split-path ./tmp/*estf*.ps1 -Leaf -Resolve )[1] | Should Be $testfile2 + $actual = ( Split-Path ./tmp/*estf*.ps1 -Leaf -Resolve ) + $actual.GetType().BaseType.Name | Should Be "Array" + $actual | Should Match $testfile + $actual | Should Match $testfile2 Remove-Item $FullyQualifiedTestFile, $FullyQualifiedTestFile2 From 7b1280eb2e44912640e823f3dd14c9e3407bed7c Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 28 Aug 2015 17:22:51 -0700 Subject: [PATCH 22/40] Refactor Split-Path regexp test Fix issues with ordering etc. --- src/pester-tests/Test-Split-Path.Tests.ps1 | 32 ++++++++++------------ 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index 64aae88114..6d33571913 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -1,9 +1,4 @@ Describe "Test-Split-Path" { - # Use the local directory because it's renewed each time with the correct privileges - $testDir = "./tmp" - $testfile = "testfile.ps1" - $FullyQualifiedTestFile = $testDir + "/" + $testFile -ls It "Should return a string object when invoked" { ( Split-Path . ).GetType().Name | Should Be "String" ( Split-Path . -Leaf ).GetType().Name | Should Be "String" @@ -38,23 +33,26 @@ ls } It "Should be able to accept regular expression input and output an array for multiple objects" { - $testfile2 = "testfilenumber2.ps1" - $FullyQualifiedTestFile2 = $testDir + "/" + $testfile2 + $testDir = "./tmp" + Remove-Item $testDir -Recurse -Force - New-Item -ItemType file -Path $FullyQualifiedTestFile, $FullyQualifiedTestFile2 -Force + $testFile1 = "testfile1.ps1" + $testFile2 = "testfile2.ps1" + $testFilePath1 = $testDir + "/" + $testFile1 + $testFilePath2 = $testDir + "/" + $testFile2 - Test-Path $FullyQualifiedTestFile | Should Be $true - Test-Path $FullyQualifiedTestFile2 | Should Be $true + New-Item -ItemType file -Path $testFilePath1, $testFilePath2 -Force - $actual = ( Split-Path ./tmp/*estf*.ps1 -Leaf -Resolve ) + Test-Path $testFilePath1 | Should Be $true + Test-Path $testFilePath2 | Should Be $true + + $actual = ( Split-Path $testDir/*file*.ps1 -Leaf -Resolve ) | Sort-Object $actual.GetType().BaseType.Name | Should Be "Array" - $actual | Should Match $testfile - $actual | Should Match $testfile2 + $actual[0] | Should Be $testFile1 + $actual[1] | Should Be $testFile2 - Remove-Item $FullyQualifiedTestFile, $FullyQualifiedTestFile2 - - Test-Path $FullyQualifiedTestFile | Should Be $false - Test-Path $FullyQualifiedTestFile2 | Should Be $false + Remove-Item $testDir -Recurse -Force + Test-Path $testDir | Should Be $false } It "Should be able to tell if a given path is an absolute path" { From 92cd86d3f205cf80c0ac3fc2ca7b552c1ae46a83 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 28 Aug 2015 20:13:10 -0700 Subject: [PATCH 23/40] Ignore Remove-Item errors in Split-Path setup --- src/pester-tests/Test-Split-Path.Tests.ps1 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index 6d33571913..47dc536a0d 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -14,27 +14,29 @@ # ErrorAction SilentlyContinue merely suppresses the error from the console. # Throwing exceptions still seen by Pester. - Split-Path "C:\Users" -Qualifier -ErrorAction SilentlyContinue | Should Throw + Split-Path "C:\Users" -Qualifier -ErrorAction SilentlyContinue | Should Throw } It "Should error when no directory separator characters are used with a qualifier" { - Split-Path "abadTest" -Qualifier -ErrorAction SilentlyContinue | Should Throw + Split-Path "abadTest" -Qualifier -ErrorAction SilentlyContinue | Should Throw } - It "Should return the path when the noqualifier switch is used on a linux system" { + It "Should return the path when the noqualifier switch is used on a Linux system" { { Split-Path /usr/bin -NoQualifier } | Should Not Throw Split-Path /usr/bin -NoQualifier | Should Be "/usr/bin" } - It "Should return the parent folder name when the leaf switch is used" { + It "Should return the base name when the leaf switch is used" { Split-Path /usr/bin -Leaf | Should be "bin" Split-Path /usr/local/bin -Leaf | Should be "bin" Split-Path usr/bin -Leaf | Should be "bin" + Split-Path ./bin -Leaf | Should be "bin" + Split-Path bin -Leaf | Should be "bin" } It "Should be able to accept regular expression input and output an array for multiple objects" { $testDir = "./tmp" - Remove-Item $testDir -Recurse -Force + Remove-Item $testDir -Recurse -Force -ErrorAction Ignore $testFile1 = "testfile1.ps1" $testFile2 = "testfile2.ps1" @@ -51,7 +53,7 @@ $actual[0] | Should Be $testFile1 $actual[1] | Should Be $testFile2 - Remove-Item $testDir -Recurse -Force + Remove-Item $testDir -Recurse -Force -ErrorAction Ignore Test-Path $testDir | Should Be $false } From f648656cc12e270e8ac350ebe2036161f91481c7 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 28 Aug 2015 21:18:58 -0700 Subject: [PATCH 24/40] Refactor test targets --- scripts/Makefile | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 1f49d7d91b..723e453f30 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -181,20 +181,27 @@ run-interactive: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-relea run-file: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr exec_env/app_base/runps.sh --file $(PSSCRIPT) -pester-tests: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr - # execute the pester tests, pester needs a TEMP environment variable to be set - exec_env/app_base/runps-simple.sh 'cd ../../../src/pester-tests; $$env:TEMP="/tmp"; invoke-pester' - -test: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr $(addprefix $(TESTRUN_FOLDER)/, ps_test.dll xunit.console.netcore.exe xunit.runner.utility.dll xunit.abstractions.dll xunit.execution.dll) pester-tests dotnetlibs/monad_native - cd exec_env/app_base && PSMODULEPATH=$(shell pwd)/exec_env/app_base/Modules LD_LIBRARY_PATH=../coreclr:. ../coreclr/corerun xunit.console.netcore.exe ps_test.dll -xml ../../xunittests.xml - # run the c++ tests - cd dotnetlibs && ./monad_native - # test the 3rdparty/hashbang sample - PATH=$(PATH):$(shell pwd)/exec_env/app_base $(shell pwd)/3rdparty/hashbang/script.ps1 - run-debugclr: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-debug-clr PAL_DBG_CHANNELS="+LOADER.TRACE" exec_env/app_base/runps-simple.sh get-location +native-tests: dotnetlibs/monad_native + # execute the native C++ tests + cd dotnetlibs && ./monad_native + +xunit-tests: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr $(addprefix $(TESTRUN_FOLDER)/, ps_test.dll xunit.console.netcore.exe xunit.runner.utility.dll xunit.abstractions.dll xunit.execution.dll) + # execute the xUnit runner, with XML output + cd exec_env/app_base && PSMODULEPATH=$(shell pwd)/exec_env/app_base/Modules LD_LIBRARY_PATH=../coreclr:. ../coreclr/corerun xunit.console.netcore.exe ps_test.dll -xml ../../xunittests.xml + +pester-tests: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr + # execute the Pester tests, which needs a TEMP environment variable to be set + exec_env/app_base/runps-simple.sh 'cd ../../../src/pester-tests; $$env:TEMP="/tmp"; invoke-pester' + +hashbang-tests: + # execute the 3rdparty/hashbang example + PATH=$(PATH):$(shell pwd)/exec_env/app_base $(shell pwd)/3rdparty/hashbang/script.ps1 + +test: native-tests xunit-tests pester-tests hashbang-tests + trace: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr exec_env/app_base/runps-simple-trace.sh get-location From 70466f963c95ba7e1da79178a16e512685890831 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 31 Aug 2015 12:55:43 -0700 Subject: [PATCH 25/40] Repin monad and monad-native - GetCpInfo fixes monad-native compiler warning - monad has more fixes --- src/monad | 2 +- src/monad-native | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monad b/src/monad index 8e014f44d7..d541b07343 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 8e014f44d72765f086fe516e870602d5a476076e +Subproject commit d541b073435e55fd96771697e5549cc9a188fa54 diff --git a/src/monad-native b/src/monad-native index 440cf6a236..5693da6a46 160000 --- a/src/monad-native +++ b/src/monad-native @@ -1 +1 @@ -Subproject commit 440cf6a236067eba2d5dcfd5e3707a36295cee97 +Subproject commit 5693da6a46e8c4d63a49a6dbc6be3081ce7d0d08 From a7010cd742b7cc49f2cd6db8bb1d5b4d57b47c61 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 1 Sep 2015 13:55:54 -0700 Subject: [PATCH 26/40] Add `make script.ps1` target for easy testing Use like `make src/pester-tests/Test-Split-Path.Tests.ps1` --- scripts/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Makefile b/scripts/Makefile index 723e453f30..a92147ba97 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -181,6 +181,10 @@ run-interactive: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-relea run-file: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr exec_env/app_base/runps.sh --file $(PSSCRIPT) +# easy way to run individual PowerShell scripts, `make script.ps1` where the path is relative from monad-linux +%.ps1: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr + TEMP=/tmp exec_env/app_base/runps.sh --file ../../../$@ + run-debugclr: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-debug-clr PAL_DBG_CHANNELS="+LOADER.TRACE" exec_env/app_base/runps-simple.sh get-location From 8c80840d69cfdd693b425e397b7179c220a5fdf8 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 1 Sep 2015 14:08:04 -0700 Subject: [PATCH 27/40] Make path relative to monad-linux/scripts Since that's where the Makefile lives --- scripts/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index a92147ba97..174a68bd0e 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -181,9 +181,9 @@ run-interactive: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-relea run-file: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr exec_env/app_base/runps.sh --file $(PSSCRIPT) -# easy way to run individual PowerShell scripts, `make script.ps1` where the path is relative from monad-linux +# easy way to run individual PowerShell scripts, `make script.ps1` where the path is relative to monad-linux/scripts (with TEMP set for Pester) %.ps1: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr - TEMP=/tmp exec_env/app_base/runps.sh --file ../../../$@ + TEMP=/tmp exec_env/app_base/runps.sh --file ../../$@ run-debugclr: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-debug-clr PAL_DBG_CHANNELS="+LOADER.TRACE" exec_env/app_base/runps-simple.sh get-location From 4ff63410342634e9153c24b79d7f78d70a32a1f6 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Tue, 1 Sep 2015 16:57:16 -0700 Subject: [PATCH 28/40] implemented xunit tests for testing isHardLink using a fileSystem object --- src/ps_test/test_CorePsPlatform.cs | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index 57e58bc32f..b761c234b9 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -1,5 +1,6 @@ using Xunit; using System; +using System.IO; using System.Diagnostics; using System.Management.Automation; @@ -90,5 +91,38 @@ namespace PSTests } + + [Fact] + public static void TestIsHardLink() + { + // a file that should exist on every *nix distro + + string path = @"/tmp/MyTest"; + if (!File.Exists(path)) + { + File.Create(path); + } + + // Create a file to write to using StreamWriter. + // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. + byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); + MemoryStream stream = new MemoryStream(byteArray); + + using (StreamWriter sw = new StreamWriter(stream)) + { + sw.Write("Hello"); + } + + // Convert `path` string to FileSystemInfo data type. And now, it should return true + FileSystemInfo fd = new FileInfo(path); + Assert.True(Platform.NonWindowsIsHardLink(fd)); + } + + [Fact] + public static void TestIsHardLinkFailsWithDirectory() + { + + } + } } From 73b1a714208e03eacba185dda2bfc25c33d50d7b Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Tue, 1 Sep 2015 16:58:16 -0700 Subject: [PATCH 29/40] bringing implementation code up-to-date with the test code --- src/monad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monad b/src/monad index d541b07343..01ff8a3f79 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit d541b073435e55fd96771697e5549cc9a188fa54 +Subproject commit 01ff8a3f7967503f805933d17b90ddb23402b866 From 080c734dfb93c0aa2cfd3b765b26d1affb245137 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 2 Sep 2015 11:02:09 -0700 Subject: [PATCH 30/40] added fail under directory as input unit test --- src/ps_test/test_CorePsPlatform.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index b761c234b9..bc62134ca0 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -93,7 +93,7 @@ namespace PSTests } [Fact] - public static void TestIsHardLink() + public static void TestIsHardLinkWithFileSystemInfo() { // a file that should exist on every *nix distro @@ -102,7 +102,6 @@ namespace PSTests { File.Create(path); } - // Create a file to write to using StreamWriter. // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); @@ -119,9 +118,20 @@ namespace PSTests } [Fact] - public static void TestIsHardLinkFailsWithDirectory() + public static void TestIsHardLinkFailsWithDirectoryWithFileSystemInfo() { - + // A folder that should exist on every *nix system + string path = @"/tmp"; + + // Create a file to write to using StreamWriter. + // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. + byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); + MemoryStream stream = new MemoryStream(byteArray); + + // Convert `path` string to FileSystemInfo data type. And now, it should return true + FileSystemInfo fd = new FileInfo(path); + Assert.False(Platform.NonWindowsIsHardLink(fd)); + } } From 9b02eea58dca19af87ac117b3840ab27f4a01157 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Wed, 2 Sep 2015 11:15:31 -0700 Subject: [PATCH 31/40] added unit test for additional failure cases and removed unneeded code from existing unit tests --- src/ps_test/test_CorePsPlatform.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index bc62134ca0..a8bf60eb91 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -102,6 +102,7 @@ namespace PSTests { File.Create(path); } + // Create a file to write to using StreamWriter. // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); @@ -123,16 +124,23 @@ namespace PSTests // A folder that should exist on every *nix system string path = @"/tmp"; - // Create a file to write to using StreamWriter. - // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. - byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); - MemoryStream stream = new MemoryStream(byteArray); + // Convert `path` string to FileSystemInfo data type. And now, it should return true + FileSystemInfo fd = new FileInfo(path); + Assert.False(Platform.NonWindowsIsHardLink(fd)); + } + + [Fact] + public static void TestIsHardLinkFailsWithNonexistantFileWithFileSystemInfo() + { + // A file that should *never* exist on a test machine: + string path = @"/tmp/ThisFileShouldNotExistOnTestMachines"; + + // If the file exists, then there's a larger issue that needs to be looked at + Assert.False(File.Exists(path)); // Convert `path` string to FileSystemInfo data type. And now, it should return true FileSystemInfo fd = new FileInfo(path); Assert.False(Platform.NonWindowsIsHardLink(fd)); - } - } } From 74f0a893c1dda04f2cccdcdb52968e19525baeb7 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 2 Sep 2015 15:17:35 -0700 Subject: [PATCH 32/40] Repin monad --- src/monad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monad b/src/monad index 01ff8a3f79..d0697c432c 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 01ff8a3f7967503f805933d17b90ddb23402b866 +Subproject commit d0697c432c1d678e59af3ebd6320e5bc3a432b2f From 94be33afe14b3fc67a52de997365a9db4acbc11e Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 3 Sep 2015 11:10:49 -0700 Subject: [PATCH 33/40] Generate $COREREF in Makefile automatically Previously generated by hand and saved. Now will update itself automatically when monad-ext/coreclr is updated. --- scripts/coreref.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/coreref.mk b/scripts/coreref.mk index 042499f06a..775b928220 100644 --- a/scripts/coreref.mk +++ b/scripts/coreref.mk @@ -2,9 +2,9 @@ # this depends on the MONAD_EXT variable to be correctly set TARGETING_PACK=$(MONAD_EXT)/coreclr/TargetingPack -COREREF=-r:$(TARGETING_PACK)/Microsoft.CSharp.dll -r:$(TARGETING_PACK)/Microsoft.VisualBasic.dll -r:$(TARGETING_PACK)/Microsoft.Win32.Primitives.dll -r:$(TARGETING_PACK)/Microsoft.Win32.Registry.AccessControl.dll -r:$(TARGETING_PACK)/Microsoft.Win32.Registry.dll -r:$(TARGETING_PACK)/System.AppContext.dll -r:$(TARGETING_PACK)/System.Collections.Concurrent.dll -r:$(TARGETING_PACK)/System.Collections.dll -r:$(TARGETING_PACK)/System.Collections.NonGeneric.dll -r:$(TARGETING_PACK)/System.Collections.Specialized.dll -r:$(TARGETING_PACK)/System.ComponentModel.Annotations.dll -r:$(TARGETING_PACK)/System.ComponentModel.dll -r:$(TARGETING_PACK)/System.ComponentModel.EventBasedAsync.dll -r:$(TARGETING_PACK)/System.ComponentModel.Primitives.dll -r:$(TARGETING_PACK)/System.ComponentModel.TypeConverter.dll -r:$(TARGETING_PACK)/System.Console.dll -r:$(TARGETING_PACK)/System.Data.Common.dll -r:$(TARGETING_PACK)/System.Data.SqlClient.dll -r:$(TARGETING_PACK)/System.Diagnostics.Contracts.dll -r:$(TARGETING_PACK)/System.Diagnostics.Debug.dll -r:$(TARGETING_PACK)/System.Diagnostics.FileVersionInfo.dll -r:$(TARGETING_PACK)/System.Diagnostics.Process.dll -r:$(TARGETING_PACK)/System.Diagnostics.TextWriterTraceListener.dll -r:$(TARGETING_PACK)/System.Diagnostics.Tools.dll -r:$(TARGETING_PACK)/System.Diagnostics.TraceSource.dll -r:$(TARGETING_PACK)/System.Diagnostics.Tracing.dll -r:$(TARGETING_PACK)/System.Dynamic.Runtime.dll -r:$(TARGETING_PACK)/System.Globalization.Calendars.dll -r:$(TARGETING_PACK)/System.Globalization.dll -r:$(TARGETING_PACK)/System.Globalization.Extensions.dll -r:$(TARGETING_PACK)/System.IO.Compression.dll -r:$(TARGETING_PACK)/System.IO.Compression.ZipFile.dll -r:$(TARGETING_PACK)/System.IO.dll -r:$(TARGETING_PACK)/System.IO.FileSystem.AccessControl.dll -r:$(TARGETING_PACK)/System.IO.FileSystem.dll -r:$(TARGETING_PACK)/System.IO.FileSystem.DriveInfo.dll -r:$(TARGETING_PACK)/System.IO.FileSystem.Primitives.dll -r:$(TARGETING_PACK)/System.IO.FileSystem.Watcher.dll -r:$(TARGETING_PACK)/System.IO.MemoryMappedFiles.dll -r:$(TARGETING_PACK)/System.IO.Pipes.dll -r:$(TARGETING_PACK)/System.IO.UnmanagedMemoryStream.dll -r:$(TARGETING_PACK)/System.Linq.dll -r:$(TARGETING_PACK)/System.Linq.Expressions.dll -r:$(TARGETING_PACK)/System.Linq.Parallel.dll -r:$(TARGETING_PACK)/System.Linq.Queryable.dll -r:$(TARGETING_PACK)/System.Net.Http.dll -r:$(TARGETING_PACK)/System.Net.Http.WinHttpHandler.dll -r:$(TARGETING_PACK)/System.Net.NameResolution.dll -r:$(TARGETING_PACK)/System.Net.NetworkInformation.dll -r:$(TARGETING_PACK)/System.Net.Primitives.dll -r:$(TARGETING_PACK)/System.Net.Security.dll -r:$(TARGETING_PACK)/System.Net.Sockets.dll -r:$(TARGETING_PACK)/System.Net.Utilities.dll -r:$(TARGETING_PACK)/System.Net.WebHeaderCollection.dll -r:$(TARGETING_PACK)/System.Net.WebSockets.Client.dll -r:$(TARGETING_PACK)/System.Net.WebSockets.dll -r:$(TARGETING_PACK)/System.ObjectModel.dll -r:$(TARGETING_PACK)/System.Reflection.DispatchProxy.dll -r:$(TARGETING_PACK)/System.Reflection.dll -r:$(TARGETING_PACK)/System.Reflection.Emit.dll -r:$(TARGETING_PACK)/System.Reflection.Emit.ILGeneration.dll -r:$(TARGETING_PACK)/System.Reflection.Emit.Lightweight.dll -r:$(TARGETING_PACK)/System.Reflection.Extensions.dll -r:$(TARGETING_PACK)/System.Reflection.Primitives.dll -r:$(TARGETING_PACK)/System.Reflection.TypeExtensions.dll -r:$(TARGETING_PACK)/System.Resources.ReaderWriter.dll -r:$(TARGETING_PACK)/System.Resources.ResourceManager.dll -r:$(TARGETING_PACK)/System.Runtime.CompilerServices.VisualC.dll -r:$(TARGETING_PACK)/System.Runtime.dll -r:$(TARGETING_PACK)/System.Runtime.Extensions.dll -r:$(TARGETING_PACK)/System.Runtime.Handles.dll -r:$(TARGETING_PACK)/System.Runtime.InteropServices.dll -r:$(TARGETING_PACK)/System.Runtime.InteropServices.WindowsRuntime.dll -r:$(TARGETING_PACK)/System.Runtime.Loader.dll -r:$(TARGETING_PACK)/System.Runtime.Numerics.dll -r:$(TARGETING_PACK)/System.Runtime.Serialization.Json.dll -r:$(TARGETING_PACK)/System.Runtime.Serialization.Primitives.dll -r:$(TARGETING_PACK)/System.Runtime.Serialization.Xml.dll -r:$(TARGETING_PACK)/System.Security.AccessControl.dll -r:$(TARGETING_PACK)/System.Security.Claims.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.DeriveBytes.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.Encoding.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.Encryption.Aes.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.Encryption.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.Hashing.Algorithms.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.Hashing.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.RandomNumberGenerator.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.RSA.dll -r:$(TARGETING_PACK)/System.Security.Cryptography.X509Certificates.dll -r:$(TARGETING_PACK)/System.Security.Principal.dll -r:$(TARGETING_PACK)/System.Security.Principal.Windows.dll -r:$(TARGETING_PACK)/System.Security.SecureString.dll -r:$(TARGETING_PACK)/System.ServiceModel.Duplex.dll -r:$(TARGETING_PACK)/System.ServiceModel.Http.dll -r:$(TARGETING_PACK)/System.ServiceModel.NetTcp.dll -r:$(TARGETING_PACK)/System.ServiceModel.Primitives.dll -r:$(TARGETING_PACK)/System.ServiceModel.Security.dll -r:$(TARGETING_PACK)/System.ServiceProcess.ServiceController.dll -r:$(TARGETING_PACK)/System.Text.Encoding.CodePages.dll -r:$(TARGETING_PACK)/System.Text.Encoding.dll -r:$(TARGETING_PACK)/System.Text.Encoding.Extensions.dll -r:$(TARGETING_PACK)/System.Text.RegularExpressions.dll -r:$(TARGETING_PACK)/System.Threading.AccessControl.dll -r:$(TARGETING_PACK)/System.Threading.dll -r:$(TARGETING_PACK)/System.Threading.Overlapped.dll -r:$(TARGETING_PACK)/System.Threading.Tasks.dll -r:$(TARGETING_PACK)/System.Threading.Tasks.Parallel.dll -r:$(TARGETING_PACK)/System.Threading.Thread.dll -r:$(TARGETING_PACK)/System.Threading.ThreadPool.dll -r:$(TARGETING_PACK)/System.Threading.Timer.dll -r:$(TARGETING_PACK)/System.Xml.ReaderWriter.dll -r:$(TARGETING_PACK)/System.Xml.XDocument.dll -r:$(TARGETING_PACK)/System.Xml.XmlDocument.dll -r:$(TARGETING_PACK)/System.Xml.XmlSerializer.dll -r:$(TARGETING_PACK)/System.Xml.XPath.dll -r:$(TARGETING_PACK)/System.Xml.XPath.XDocument.dll -r:$(TARGETING_PACK)/System.Xml.XPath.XmlDocument.dll +COREREF=$(addprefix -r:, $(shell ls $(TARGETING_PACK)/*.dll)) # COREREF_2 is here for dev/testing purposes, it should not be used anywhere (instead use the reference assemblies stored in COREREF) CORECLR_ASSEMBLY_BASE=$(MONAD_EXT)/coreclr/Release -COREREF_2= -r:$(CORECLR_ASSEMBLY_BASE)/Microsoft.CSharp.dll -r:$(CORECLR_ASSEMBLY_BASE)/Microsoft.VisualBasic.dll -r:$(CORECLR_ASSEMBLY_BASE)/Microsoft.Win32.Primitives.dll -r:$(CORECLR_ASSEMBLY_BASE)/Microsoft.Win32.Registry.AccessControl.dll -r:$(CORECLR_ASSEMBLY_BASE)/Microsoft.Win32.Registry.dll -r:$(CORECLR_ASSEMBLY_BASE)/mscorlib.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.AppContext.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Collections.Concurrent.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Collections.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Collections.NonGeneric.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Collections.Specialized.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ComponentModel.Annotations.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ComponentModel.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ComponentModel.EventBasedAsync.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ComponentModel.Primitives.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ComponentModel.TypeConverter.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Console.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Core.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Data.Common.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Data.SqlClient.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.Contracts.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.Debug.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.FileVersionInfo.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.Process.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.StackTrace.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.TextWriterTraceListener.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.Tools.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.TraceSource.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Diagnostics.Tracing.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Dynamic.Runtime.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Globalization.Calendars.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Globalization.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Globalization.Extensions.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.Compression.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.Compression.ZipFile.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.FileSystem.AccessControl.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.FileSystem.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.FileSystem.DriveInfo.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.FileSystem.Primitives.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.FileSystem.Watcher.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.MemoryMappedFiles.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.Pipes.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.IO.UnmanagedMemoryStream.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Linq.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Linq.Expressions.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Linq.Parallel.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Linq.Queryable.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.Http.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.Http.WinHttpHandler.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.NameResolution.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.NetworkInformation.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.Primitives.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.Requests.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.Security.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.Sockets.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.Utilities.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.WebHeaderCollection.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.WebSockets.Client.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Net.WebSockets.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ObjectModel.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Private.CompilerServices.ICastable.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Private.CoreLib.InteropServices.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Private.DataContractSerialization.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Private.Interop.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Private.Networking.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Private.ServiceModel.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Private.Uri.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.DispatchProxy.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.Emit.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.Emit.ILGeneration.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.Emit.Lightweight.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.Extensions.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.Primitives.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Reflection.TypeExtensions.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Resources.ReaderWriter.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Resources.ResourceManager.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.CompilerServices.VisualC.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.Extensions.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.Handles.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.InteropServices.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.InteropServices.WindowsRuntime.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.Loader.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.Numerics.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.Serialization.Json.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.Serialization.Primitives.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Runtime.Serialization.Xml.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.AccessControl.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Claims.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.DeriveBytes.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.Encoding.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.Encryption.Aes.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.Encryption.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.Hashing.Algorithms.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.Hashing.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.RandomNumberGenerator.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.RSA.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Cryptography.X509Certificates.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Principal.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.Principal.Windows.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Security.SecureString.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ServiceModel.Duplex.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ServiceModel.Http.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ServiceModel.NetTcp.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ServiceModel.Primitives.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ServiceModel.Security.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.ServiceProcess.ServiceController.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Text.Encoding.CodePages.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Text.Encoding.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Text.Encoding.Extensions.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Text.RegularExpressions.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.AccessControl.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.Overlapped.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.Tasks.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.Tasks.Parallel.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.Thread.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.ThreadPool.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Threading.Timer.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Xml.ReaderWriter.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Xml.XDocument.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Xml.XmlDocument.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Xml.XmlSerializer.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Xml.XPath.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Xml.XPath.XDocument.dll -r:$(CORECLR_ASSEMBLY_BASE)/System.Xml.XPath.XmlDocument.dll +COREREF_2=$(addprefix -r:, $(shell ls $(CORECLR_ASSEMBLY_BASE)/*.dll)) From 84d58714fc2afdb3bf3c2475887f38206ecc0c11 Mon Sep 17 00:00:00 2001 From: Peter Honeder Date: Thu, 3 Sep 2015 21:43:17 +0200 Subject: [PATCH 34/40] added a simple test that creates a full PS Runspace and executes a script --- scripts/Makefile | 2 +- scripts/runps-test.sh | 7 ++++++ src/ps_test/test_Runspace.cs | 48 ++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100755 scripts/runps-test.sh create mode 100644 src/ps_test/test_Runspace.cs diff --git a/scripts/Makefile b/scripts/Makefile index 174a68bd0e..1bd25a0994 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -194,7 +194,7 @@ native-tests: dotnetlibs/monad_native xunit-tests: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr $(addprefix $(TESTRUN_FOLDER)/, ps_test.dll xunit.console.netcore.exe xunit.runner.utility.dll xunit.abstractions.dll xunit.execution.dll) # execute the xUnit runner, with XML output - cd exec_env/app_base && PSMODULEPATH=$(shell pwd)/exec_env/app_base/Modules LD_LIBRARY_PATH=../coreclr:. ../coreclr/corerun xunit.console.netcore.exe ps_test.dll -xml ../../xunittests.xml + exec_env/app_base/runps-test.sh ps_test.dll -xml ../../xunittests.xml pester-tests: $(RUN_TARGETS) internal-prepare-exec_env internal-prepare-release-clr # execute the Pester tests, which needs a TEMP environment variable to be set diff --git a/scripts/runps-test.sh b/scripts/runps-test.sh new file mode 100755 index 0000000000..5196f708be --- /dev/null +++ b/scripts/runps-test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +CWD=$(pwd) +SCRIPTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) + +cd "$SCRIPTDIR" +PSMODULEPATH="$SCRIPTDIR/Modules" LD_LIBRARY_PATH="$SCRIPTDIR" ./host_cmdline -c ../coreclr -alc Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll -tpa xunit.console.netcore.exe xunit.console.netcore.exe "$@" diff --git a/src/ps_test/test_Runspace.cs b/src/ps_test/test_Runspace.cs new file mode 100644 index 0000000000..f9b4745eb9 --- /dev/null +++ b/src/ps_test/test_Runspace.cs @@ -0,0 +1,48 @@ +using Xunit; +using System; +using System.Management.Automation; +using System.Management.Automation.Runspaces; + +namespace PSTests +{ + public static class RunspaceTests + { + [Fact] + public static void TestMethod() + { + InitialSessionState iss = InitialSessionState.CreateDefault2(); + + // NOTE: instantiate custom host myHost for the next line to capture stdout and stderr output + // in addition to just the PSObjects + using (Runspace rs = RunspaceFactory.CreateRunspace(/*myHost,*/iss)) + { + rs.Open(); + using (PowerShell ps = PowerShell.Create()) + { + ps.Runspace = rs; + + string script = "get-process | select-object -first 3"; + ps.AddScript(script); + + // IMPORTANT NOTE: do not call AddCommand("out-host") here or + // MergeMyResults, otherwise Invoke will not return any objects + + var results = ps.Invoke(); + + // check that there are 3 captured objects + int objCount = 0; + foreach (var result in results) + { + // this is how an object would be captured here and looked at, + // each result is a PSObject with the data from the pipeline + ++objCount; + Assert.NotNull(result); + } + Assert.Equal(3,objCount); + ps.Dispose(); + } + } + } + } +} + From 562a9bb35b3467af8803812806ea3a019165ea7b Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 3 Sep 2015 14:31:46 -0700 Subject: [PATCH 35/40] Add Security.dll reference for Commands.Management.dll While enabling previously disabled code in `cimConverter.cs`, it was revealed that `Microsoft.PowerShell.Commands.Management.dll` has a dependency on `Microsoft.PowerShell.Security.dll` for the type `SecurityDescriptorCommandsBase`. --- scripts/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 174a68bd0e..7882c64579 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -72,13 +72,13 @@ dotnetlibs/Microsoft.Management.Infrastructure.dll: ${MAN_INFRA_SRCS} dotnetlibs # Commands -dotnetlibs/Microsoft.PowerShell.Commands.Management.dll: ${COMMANDS_MANAGEMENT_SRCS} dotnetlibs/System.Management.Automation.dll ${COMMANDS_MANAGEMENT_RES_SRCS} ${COMMANDS_MANAGEMENT_RES_CS_SRCS} $(MI_ASSEMBLY) - $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_COMMANDS_REFS} ${COMMANDS_MANAGEMENT_SRCS} ${COMMANDS_MANAGEMENT_RES_CS_SRCS} $(COMMANDS_MANAGEMENT_RES_REF) $(MI_REF) +dotnetlibs/Microsoft.PowerShell.Commands.Management.dll: ${COMMANDS_MANAGEMENT_SRCS} dotnetlibs/System.Management.Automation.dll dotnetlibs/Microsoft.PowerShell.Security.dll ${COMMANDS_MANAGEMENT_RES_SRCS} ${COMMANDS_MANAGEMENT_RES_CS_SRCS} $(MI_ASSEMBLY) + $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_COMMANDS_REFS} ${COMMANDS_MANAGEMENT_SRCS} ${COMMANDS_MANAGEMENT_RES_CS_SRCS} $(COMMANDS_MANAGEMENT_RES_REF) $(MI_REF) -r:dotnetlibs/Microsoft.PowerShell.Security.dll dotnetlibs/Microsoft.PowerShell.Commands.Utility.dll: ${COMMANDS_UTILITY_SRCS} dotnetlibs/System.Management.Automation.dll ${COMMANDS_UTILITY_RES_SRCS} ${COMMANDS_UTILITY_RES_CS_SRCS} $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_COMMANDS_REFS} ${COMMANDS_UTILITY_SRCS} ${COMMANDS_UTILITY_RES_CS_SRCS} $(COMMANDS_UTILITY_RES_REF) -dotnetlibs/Microsoft.PowerShell.Security.dll: ${SECURITY_SRCS} dotnetlibs/System.Management.Automation.dll ${SECURITY_RES_SRCS} ${SECURITY_RES_CS_SRCS} +dotnetlibs/Microsoft.PowerShell.Security.dll: ${SECURITY_SRCS} ${SECURITY_RES_SRCS} ${SECURITY_RES_CS_SRCS} $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_COMMANDS_REFS} ${SECURITY_SRCS} ${SECURITY_RES_CS_SRCS} $(SECURITY_RES_REF) # assembly load context From f163808eac8c6dfee5be7fd42a02962225aef050 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 3 Sep 2015 14:55:21 -0700 Subject: [PATCH 36/40] Swap {} for () in Makefile Parentheses are more portable. There was an inconsistent mix of parentheses and curly braces. --- scripts/Makefile | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 3e4d51e148..00d0874c3d 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -41,16 +41,16 @@ MI_REF_ASSEMBLY=-r:$(MONAD_EXT)/PS/PS_refs_modil/microsoft.management.infrastruc MI_ASSEMBLY=dotnetlibs/Microsoft.Management.Infrastructure.dll MI_REF=-r:$(MI_ASSEMBLY) -PRODUCT_BASE_REFS=${COREREF} -PRODUCT_MI_REFS=${COREREF} ${MI_NATIVE_REF} -PRODUCT_PS_REFS=${COREREF} ${MI_REF} -r:dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET) -PRODUCT_COMMANDS_REFS=${COREREF} -r:dotnetlibs/System.Management.Automation.dll +PRODUCT_BASE_REFS=$(COREREF) +PRODUCT_MI_REFS=$(COREREF) $(MI_NATIVE_REF) +PRODUCT_PS_REFS=$(COREREF) $(MI_REF) -r:dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET) +PRODUCT_COMMANDS_REFS=$(COREREF) -r:dotnetlibs/System.Management.Automation.dll MCSOPTS_BASE=-unsafe -nostdlib -noconfig -define:CORECLR -define:_CORECLR -MCSOPTS_MI=${MCSOPTS_BASE} -target:library -MCSOPTS_LIB=${MCSOPTS_BASE} -target:library -MCSOPTS_PS=${STRING_RESOURCES_ORIG} ${MCSOPTS_BASE} -target:library -SRCS_ALL=${STRING_RESOURCES} ${SRCS} +MCSOPTS_MI=$(MCSOPTS_BASE) -target:library +MCSOPTS_LIB=$(MCSOPTS_BASE) -target:library +MCSOPTS_PS=$(STRING_RESOURCES_ORIG) $(MCSOPTS_BASE) -target:library +SRCS_ALL=$(STRING_RESOURCES) $(SRCS) # compilers # - Roslyn's csc is used for all the PS code @@ -63,28 +63,28 @@ RUN_TARGETS=$(POWERSHELL_RUN_TARGETS) dotnetlibs/Microsoft.PowerShell.Commands.M all: dotnetlibs/System.Management.Automation.dll $(RUN_TARGETS) dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET) # this is the build rule for SMA.dll -dotnetlibs/System.Management.Automation.dll: ${SYS_AUTO_SRCS} dotnetlibs/Microsoft.Management.Infrastructure.dll ../src/assembly-info/System.Management.Automation.assembly-info.cs dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET) $(PLATFORM_SRCS) ${SYS_AUTO_RES_SRCS} ${SYS_AUTO_RES_CS_SRCS} - $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_PS_REFS} ${SYS_AUTO_SRCS} ${SYS_AUTO_RES_REF} ${SYS_AUTO_RES_CS_SRCS} $(PLATFORM_SRCS) ../src/assembly-info/System.Management.Automation.assembly-info.cs +dotnetlibs/System.Management.Automation.dll: $(SYS_AUTO_SRCS) dotnetlibs/Microsoft.Management.Infrastructure.dll ../src/assembly-info/System.Management.Automation.assembly-info.cs dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET) $(PLATFORM_SRCS) $(SYS_AUTO_RES_SRCS) $(SYS_AUTO_RES_CS_SRCS) + $(CSC) -out:$@ $(MCSOPTS_LIB) $(PRODUCT_PS_REFS) $(SYS_AUTO_SRCS) $(SYS_AUTO_RES_REF) $(SYS_AUTO_RES_CS_SRCS) $(PLATFORM_SRCS) ../src/assembly-info/System.Management.Automation.assembly-info.cs # this is the build rule for MMI.dll -dotnetlibs/Microsoft.Management.Infrastructure.dll: ${MAN_INFRA_SRCS} dotnetlibs/Microsoft.Management.Infrastructure.Native.dll ../src/assembly-info/Microsoft.Management.Infrastructure.assembly-info.cs $(MAN_INFRA_RES_SRCS) $(MAN_INFRA_RES_CS_SRCS) +dotnetlibs/Microsoft.Management.Infrastructure.dll: $(MAN_INFRA_SRCS) dotnetlibs/Microsoft.Management.Infrastructure.Native.dll ../src/assembly-info/Microsoft.Management.Infrastructure.assembly-info.cs $(MAN_INFRA_RES_SRCS) $(MAN_INFRA_RES_CS_SRCS) $(CSC) -out:$@ $(MCSOPTS_MI) $(PRODUCT_MI_REFS) $(MAN_INFRA_SRCS) $(MAN_INFRA_RES_REF) $(MAN_INFRA_RES_CS_SRCS) ../src/assembly-info/Microsoft.Management.Infrastructure.assembly-info.cs # Commands -dotnetlibs/Microsoft.PowerShell.Commands.Management.dll: ${COMMANDS_MANAGEMENT_SRCS} dotnetlibs/System.Management.Automation.dll dotnetlibs/Microsoft.PowerShell.Security.dll ${COMMANDS_MANAGEMENT_RES_SRCS} ${COMMANDS_MANAGEMENT_RES_CS_SRCS} $(MI_ASSEMBLY) - $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_COMMANDS_REFS} ${COMMANDS_MANAGEMENT_SRCS} ${COMMANDS_MANAGEMENT_RES_CS_SRCS} $(COMMANDS_MANAGEMENT_RES_REF) $(MI_REF) -r:dotnetlibs/Microsoft.PowerShell.Security.dll +dotnetlibs/Microsoft.PowerShell.Commands.Management.dll: $(COMMANDS_MANAGEMENT_SRCS) dotnetlibs/System.Management.Automation.dll dotnetlibs/Microsoft.PowerShell.Security.dll $(COMMANDS_MANAGEMENT_RES_SRCS) $(COMMANDS_MANAGEMENT_RES_CS_SRCS) $(MI_ASSEMBLY) + $(CSC) -out:$@ $(MCSOPTS_LIB) $(PRODUCT_COMMANDS_REFS) $(COMMANDS_MANAGEMENT_SRCS) $(COMMANDS_MANAGEMENT_RES_CS_SRCS) $(COMMANDS_MANAGEMENT_RES_REF) $(MI_REF) -r:dotnetlibs/Microsoft.PowerShell.Security.dll -dotnetlibs/Microsoft.PowerShell.Commands.Utility.dll: ${COMMANDS_UTILITY_SRCS} dotnetlibs/System.Management.Automation.dll ${COMMANDS_UTILITY_RES_SRCS} ${COMMANDS_UTILITY_RES_CS_SRCS} - $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_COMMANDS_REFS} ${COMMANDS_UTILITY_SRCS} ${COMMANDS_UTILITY_RES_CS_SRCS} $(COMMANDS_UTILITY_RES_REF) +dotnetlibs/Microsoft.PowerShell.Commands.Utility.dll: $(COMMANDS_UTILITY_SRCS) dotnetlibs/System.Management.Automation.dll $(COMMANDS_UTILITY_RES_SRCS) $(COMMANDS_UTILITY_RES_CS_SRCS) + $(CSC) -out:$@ $(MCSOPTS_LIB) $(PRODUCT_COMMANDS_REFS) $(COMMANDS_UTILITY_SRCS) $(COMMANDS_UTILITY_RES_CS_SRCS) $(COMMANDS_UTILITY_RES_REF) -dotnetlibs/Microsoft.PowerShell.Security.dll: ${SECURITY_SRCS} ${SECURITY_RES_SRCS} ${SECURITY_RES_CS_SRCS} - $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_COMMANDS_REFS} ${SECURITY_SRCS} ${SECURITY_RES_CS_SRCS} $(SECURITY_RES_REF) +dotnetlibs/Microsoft.PowerShell.Security.dll: $(SECURITY_SRCS) $(SECURITY_RES_SRCS) $(SECURITY_RES_CS_SRCS) + $(CSC) -out:$@ $(MCSOPTS_LIB) $(PRODUCT_COMMANDS_REFS) $(SECURITY_SRCS) $(SECURITY_RES_CS_SRCS) $(SECURITY_RES_REF) # assembly load context dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET): $(ASSEMBLY_LOAD_CONTEXT_SRCS) - $(CSC) -out:$@ ${MCSOPTS_LIB} ${PRODUCT_BASE_REFS} $(ASSEMBLY_LOAD_CONTEXT_SRCS) + $(CSC) -out:$@ $(MCSOPTS_LIB) $(PRODUCT_BASE_REFS) $(ASSEMBLY_LOAD_CONTEXT_SRCS) # this will copy whatever the first version of the dll in the globber is buildtemp/System.Reflection.Metadata.dll: buildtemp/System.Reflection.Metadata.*/lib/portable-net45+win8/System.Reflection.Metadata.dll @@ -101,7 +101,7 @@ dotnetlibs/Microsoft.Management.Infrastructure.Native.dll: ../src/stubs/Microsof MPATH=/usr/lib/mono/4.5/Facades buildtemp/TypeCatalogGen.exe: ../src/monad/monad/nttargets/assemblies/core/PSAssemblyLoadContext/TypeCatalogGen/TypeCatalogGen.cs buildtemp/System.Reflection.Metadata.dll buildtemp/System.Collections.Immutable.dll - $(MCS) -out:$@ -target:exe ${NUGETREF} -pkg:dotnet -r:${MPATH}/System.Runtime.dll -r:${MPATH}/System.Reflection.Primitives.dll -r:${MPATH}/System.IO.dll $< + $(MCS) -out:$@ -target:exe $(NUGETREF) -pkg:dotnet -r:$(MPATH)/System.Runtime.dll -r:$(MPATH)/System.Reflection.Primitives.dll -r:$(MPATH)/System.IO.dll $< # generate the Core PS type catalog # this comes from: ../src/monad/monad/nttargets/assemblies/core/PSAssemblyLoadContext/makefile.inc From f70f004238eff0612cee175001fb80b6b27eca02 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 3 Sep 2015 15:23:16 -0700 Subject: [PATCH 37/40] Missed a pair --- scripts/tests.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests.mk b/scripts/tests.mk index 8a7c312a2a..4f9963828a 100644 --- a/scripts/tests.mk +++ b/scripts/tests.mk @@ -6,4 +6,4 @@ $(TESTRUN_FOLDER)/xunit%: $(MONAD_EXT)/xunit/xunit% cp -f $^ $@ $(TESTRUN_FOLDER)/ps_test.dll: $(TEST_SRCS) $(addprefix $(TESTRUN_FOLDER)/, xunit.core.dll xunit.assert.dll) $(addprefix dotnetlibs/, System.Management.Automation.dll Microsoft.PowerShell.Commands.Management.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET)) - $(CSC) -out:$@ -noconfig -nostdlib -target:library $(addprefix -r:$(TESTRUN_FOLDER)/, xunit.core.dll xunit.assert.dll) $(addprefix -r:dotnetlibs/, System.Management.Automation.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET)) ${COREREF} $(TEST_SRCS) + $(CSC) -out:$@ -noconfig -nostdlib -target:library $(addprefix -r:$(TESTRUN_FOLDER)/, xunit.core.dll xunit.assert.dll) $(addprefix -r:dotnetlibs/, System.Management.Automation.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET)) $(COREREF) $(TEST_SRCS) From f6e255310b3765ce4f15b13837bd59678bc58e2a Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Thu, 3 Sep 2015 16:40:30 -0700 Subject: [PATCH 38/40] merged upstream changes inside monad --- src/monad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monad b/src/monad index 01ff8a3f79..d0697c432c 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 01ff8a3f7967503f805933d17b90ddb23402b866 +Subproject commit d0697c432c1d678e59af3ebd6320e5bc3a432b2f From d4f08a971d1822c64f266c3ddccbcdb1e66044df Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Thu, 3 Sep 2015 16:41:14 -0700 Subject: [PATCH 39/40] changed according to code review --- src/ps_test/test_CorePsPlatform.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index a8bf60eb91..f2fcef4560 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -93,35 +93,26 @@ namespace PSTests } [Fact] - public static void TestIsHardLinkWithFileSystemInfo() + public static void TestExistantFileIsHardLink() { - // a file that should exist on every *nix distro - string path = @"/tmp/MyTest"; if (!File.Exists(path)) { File.Create(path); } - // Create a file to write to using StreamWriter. // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); MemoryStream stream = new MemoryStream(byteArray); - using (StreamWriter sw = new StreamWriter(stream)) - { - sw.Write("Hello"); - } - // Convert `path` string to FileSystemInfo data type. And now, it should return true FileSystemInfo fd = new FileInfo(path); Assert.True(Platform.NonWindowsIsHardLink(fd)); } [Fact] - public static void TestIsHardLinkFailsWithDirectoryWithFileSystemInfo() + public static void TestDirectoryIsHardLink() { - // A folder that should exist on every *nix system string path = @"/tmp"; // Convert `path` string to FileSystemInfo data type. And now, it should return true @@ -130,7 +121,7 @@ namespace PSTests } [Fact] - public static void TestIsHardLinkFailsWithNonexistantFileWithFileSystemInfo() + public static void TestNonExistantIsHardLink() { // A file that should *never* exist on a test machine: string path = @"/tmp/ThisFileShouldNotExistOnTestMachines"; From bd6e4ef88511b80ae1860460bed2a3234aef7ea5 Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Thu, 3 Sep 2015 16:42:28 -0700 Subject: [PATCH 40/40] fixed typo --- src/ps_test/test_CorePsPlatform.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index f2fcef4560..e11826091e 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -101,7 +101,8 @@ namespace PSTests File.Create(path); } // Create a file to write to using StreamWriter. - // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. + // convert string to stream. On Windows, this appears to be handled, but on *nix, + // we apparently need to convert to UTF8. byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); MemoryStream stream = new MemoryStream(byteArray);