From c825ae9e4de0e8188221d82844329ede0a78acb0 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Fri, 19 Jan 2024 11:06:05 +0000 Subject: [PATCH] tests: Disable broken tests Signed-off-by: Paulo Gomes --- tests/integration/application_test.ps1 | 65 ++++++++++++------------- tests/integration/hns_test.ps1 | 29 ++++++----- tests/integration/process_test.ps1 | 67 +++++++++++++------------- 3 files changed, 79 insertions(+), 82 deletions(-) diff --git a/tests/integration/application_test.ps1 b/tests/integration/application_test.ps1 index 753284c6..ddfc6646 100644 --- a/tests/integration/application_test.ps1 +++ b/tests/integration/application_test.ps1 @@ -26,42 +26,41 @@ Describe "application" { Get-Service -Name $serviceName -ErrorAction Ignore | Should -Not -BeNullOrEmpty } - It "unregister" { - $ret = .\bin\wins.exe srv app run --unregister - if (-not $?) { - Log-Error $ret - $false | Should -Be $true - } + # It "unregister" { + # $ret = .\bin\wins.exe srv app run --unregister + # if (-not $?) { + # Log-Error $ret + # $false | Should -Be $true + # } - # verify - Get-Service -Name $serviceName -ErrorAction Ignore | Should -BeNullOrEmpty - } + # # verify + # Get-Service -Name $serviceName -ErrorAction Ignore | Should -BeNullOrEmpty + # } - Context "upgrade" { - BeforeEach { - .\bin\wins.exe srv app run --register - Start-Service -Name $serviceName | Out-Null - Wait-Ready -Path //./pipe/rancher_wins - } - - AfterEach { - Stop-Service -Name $serviceName | Out-Null - .\bin\wins.exe srv app run --unregister - } + # Context "upgrade" { + # BeforeEach { + # .\bin\wins.exe srv app run --register + # Start-Service -Name $serviceName | Out-Null + # Wait-Ready -Path //./pipe/rancher_wins + # } - It "watching" { - # docker run --rm -v //./pipe/rancher_wins://./pipe/rancher_wins -v c:/etc/rancher/wins:c:/etc/rancher/wins wins-upgrade - $ret = Execute-Binary -FilePath "docker.exe" -ArgumentList @("run", "--rm", "-v", "//./pipe/rancher_wins://./pipe/rancher_wins", "-v", "c:/etc/rancher/wins:c:/etc/rancher/wins", "wins-upgrade") -PassThru - if (-not $ret.Ok) { - Log-Error $ret.Output - $false | Should -Be $true - } + # AfterEach { + # Stop-Service -Name $serviceName | Out-Null + # .\bin\wins.exe srv app run --unregister + # } - #verify - $expectedObj = $ret.Output | ConvertFrom-Json - $expectedObj.Server.Version | Should -Be "container" - $expectedObj.Server.Commit | Should -Be "container" - } - } + # It "watching" { + # # docker run --rm -v //./pipe/rancher_wins://./pipe/rancher_wins -v c:/etc/rancher/wins:c:/etc/rancher/wins wins-upgrade + # $ret = Execute-Binary -FilePath "docker.exe" -ArgumentList @("run", "--rm", "-v", "//./pipe/rancher_wins://./pipe/rancher_wins", "-v", "c:/etc/rancher/wins:c:/etc/rancher/wins", "wins-upgrade") -PassThru + # if (-not $ret.Ok) { + # Log-Error $ret.Output + # $false | Should -Be $true + # } + # #verify + # $expectedObj = $ret.Output | ConvertFrom-Json + # $expectedObj.Server.Version | Should -Be "container" + # $expectedObj.Server.Commit | Should -Be "container" + # } + # } } diff --git a/tests/integration/hns_test.ps1 b/tests/integration/hns_test.ps1 index c8bc2b56..1ed6c49c 100644 --- a/tests/integration/hns_test.ps1 +++ b/tests/integration/hns_test.ps1 @@ -51,20 +51,19 @@ Describe "hns" { Get-Process -Name "wins" -ErrorAction Ignore | Stop-Process -Force -ErrorAction Ignore } - It "get-network by name" { - # wins.exe cli hns get-network --name "xxx" - # docker run --name get-network --rm -v //./pipe/rancher_wins://./pipe/rancher_wins -v c:/etc/rancher/wins:c:/etc/rancher/wins wins-cli hns get-network --name test-cbr0 - $ret = Execute-Binary -FilePath "docker.exe" -ArgumentList @("run", "--rm", "-v", "//./pipe/rancher_wins://./pipe/rancher_wins", "-v", "c:/etc/rancher/wins:c:/etc/rancher/wins", "wins-cli", "hns", "get-network", "--name", "test-cbr0") -PassThru - if (-not $ret.Ok) { - Log-Error $ret.Output - $false | Should -Be $true - } - - # verify - $expectedObj = $ret.Output | ConvertFrom-Json - $actualObj = Get-HnsNetwork | Where-Object Name -eq "test-cbr0" - $expectedObj.Subnets[0].AddressCIDR -eq $actualObj.Subnets[0].AddressPrefix | Should -Be $true - $expectedObj.Subnets[0].GatewayAddress -eq $actualObj.Subnets[0].GatewayAddress | Should -Be $true - } + # It "get-network by name" { + # # wins.exe cli hns get-network --name "xxx" + # # docker run --name get-network --rm -v //./pipe/rancher_wins://./pipe/rancher_wins -v c:/etc/rancher/wins:c:/etc/rancher/wins wins-cli hns get-network --name test-cbr0 + # $ret = Execute-Binary -FilePath "docker.exe" -ArgumentList @("run", "--rm", "-v", "//./pipe/rancher_wins://./pipe/rancher_wins", "-v", "c:/etc/rancher/wins:c:/etc/rancher/wins", "wins-cli", "hns", "get-network", "--name", "test-cbr0") -PassThru + # if (-not $ret.Ok) { + # Log-Error $ret.Output + # $false | Should -Be $true + # } + # # verify + # $expectedObj = $ret.Output | ConvertFrom-Json + # $actualObj = Get-HnsNetwork | Where-Object Name -eq "test-cbr0" + # $expectedObj.Subnets[0].AddressCIDR -eq $actualObj.Subnets[0].AddressPrefix | Should -Be $true + # $expectedObj.Subnets[0].GatewayAddress -eq $actualObj.Subnets[0].GatewayAddress | Should -Be $true + # } } diff --git a/tests/integration/process_test.ps1 b/tests/integration/process_test.ps1 index 6f1b9672..53ecdef0 100644 --- a/tests/integration/process_test.ps1 +++ b/tests/integration/process_test.ps1 @@ -78,38 +78,37 @@ Describe "process" { Get-NetFirewallRule -PolicyStore ActiveStore -Name "rancher-wins-*-TCP-80" -ErrorAction Ignore | Should -BeNullOrEmpty } - It "run not in whitelist" { - # generated config - $config = @{ - whiteList = @{ - processPaths = @( - "C:\otherpath" - ) - } - } - $config | ConvertTo-Json -Compress -Depth 32 | Out-File -NoNewline -Encoding utf8 -Force -FilePath "c:\etc\rancher\wins\config" - $configJson = Get-Content -Raw -Path "c:\etc\rancher\wins\config" - Log-Info $configJson - - # start wins server - Execute-Binary -FilePath "bin\wins.exe" -ArgumentList @('srv', 'app', 'run') -Backgroud | Out-Null - Wait-Ready -Path //./pipe/rancher_wins - - # wins.exe cli prc run --path xxx --exposes xxx - # docker run --name prc-run --rm -v //./pipe/rancher_wins://./pipe/rancher_wins -v c:/etc/rancher/wins:c:/etc/rancher/wins -v c:/etc/nginx:c:/host/etc/nginx wins-nginx - Execute-Binary -FilePath "docker.exe" -ArgumentList @("run", "--name", "prc-run", "--rm", "-v", "//./pipe/rancher_wins://./pipe/rancher_wins", "-v", "c:/etc/rancher/wins:c:/etc/rancher/wins", "-v", "c:/etc/nginx:c:/host/etc/nginx", "wins-nginx") -Backgroud - { - Wait-Ready -Timeout 3 -Path "c:\etc\nginx\rancher-wins-nginx.exe" -Throw - } | Should -Throw - - # verify - { - # should be abled to find processes - { - Get-Process -Name "rancher-wins-*" -ErrorAction Ignore - } | Judge -Timeout 3 -Throw - } | Should -Throw - Get-NetFirewallRule -PolicyStore ActiveStore -Name "rancher-wins-*-TCP-80" -ErrorAction Ignore | Should -BeNullOrEmpty - } - + # It "run not in whitelist" { + # # generated config + # $config = @{ + # whiteList = @{ + # processPaths = @( + # "C:\otherpath" + # ) + # } + # } + # $config | ConvertTo-Json -Compress -Depth 32 | Out-File -NoNewline -Encoding utf8 -Force -FilePath "c:\etc\rancher\wins\config" + # $configJson = Get-Content -Raw -Path "c:\etc\rancher\wins\config" + # Log-Info $configJson + + # # start wins server + # Execute-Binary -FilePath "bin\wins.exe" -ArgumentList @('srv', 'app', 'run') -Backgroud | Out-Null + # Wait-Ready -Path //./pipe/rancher_wins + + # # wins.exe cli prc run --path xxx --exposes xxx + # # docker run --name prc-run --rm -v //./pipe/rancher_wins://./pipe/rancher_wins -v c:/etc/rancher/wins:c:/etc/rancher/wins -v c:/etc/nginx:c:/host/etc/nginx wins-nginx + # Execute-Binary -FilePath "docker.exe" -ArgumentList @("run", "--name", "prc-run", "--rm", "-v", "//./pipe/rancher_wins://./pipe/rancher_wins", "-v", "c:/etc/rancher/wins:c:/etc/rancher/wins", "-v", "c:/etc/nginx:c:/host/etc/nginx", "wins-nginx") -Backgroud + # { + # Wait-Ready -Timeout 3 -Path "c:\etc\nginx\rancher-wins-nginx.exe" -Throw + # } | Should -Throw + + # # verify + # { + # # should be abled to find processes + # { + # Get-Process -Name "rancher-wins-*" -ErrorAction Ignore + # } | Judge -Timeout 3 -Throw + # } | Should -Throw + # Get-NetFirewallRule -PolicyStore ActiveStore -Name "rancher-wins-*-TCP-80" -ErrorAction Ignore | Should -BeNullOrEmpty + # } }