Skip to content

Commit

Permalink
tests: Disable broken tests
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
  • Loading branch information
pjbgf committed Jan 19, 2024
1 parent 4a47718 commit c825ae9
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 82 deletions.
65 changes: 32 additions & 33 deletions tests/integration/application_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
# }
# }
}
29 changes: 14 additions & 15 deletions tests/integration/hns_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
# }
}
67 changes: 33 additions & 34 deletions tests/integration/process_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
# }
}

0 comments on commit c825ae9

Please sign in to comment.