-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #912 from rallytime/merge-stable
[stable] Merge develop into stable branch
- Loading branch information
Showing
8 changed files
with
210 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,8 @@ Denys Havrysh vutny [email protected] | |
deployboy deployboy | ||
Diego Woitasen diegows [email protected] | ||
Elias Probst eliasp | ||
eliezerlp eliezerlp | ||
Emiel Kollof ekollof | ||
Erik Ankrom erikankrom | ||
Erik Johnson terminalmage [email protected] | ||
EYJ eyj | ||
|
@@ -66,6 +68,7 @@ markgaylard markgaylard | |
Matt Black mafrosis | ||
Matthew Garrett cingeyedog [email protected] | ||
Matthew Mead-Briggs mattmb | ||
Matthew Richardson mrichar1 | ||
Matthew Willson ixela | ||
Matthieu Guegan mguegan | ||
Michael A. Smith kojiromike [email protected] | ||
|
@@ -84,6 +87,7 @@ Pavel Snagovsky paha | |
Pedro Algarvio s0undt3ch [email protected] | ||
Pedro Paulo pedropaulovc | ||
Peter Tripp notpeter | ||
Petr Michalec epcim | ||
Prayag Verma pra85 [email protected] | ||
ptonelli ptonelli | ||
Randy Thompson beardedeagle [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
platform: Any CPU | ||
|
||
environment: | ||
matrix: | ||
- bootstrap_args: | ||
test_args: -master salt -runservice | ||
|
||
- bootstrap_args: -runservice false | ||
test_args: -master salt -noservice | ||
|
||
- bootstrap_args: -minion a-minion | ||
test_args: -minion a-minion -master salt -runservice | ||
|
||
- bootstrap_args: -minion a-minion -master a-master | ||
test_args: -minion a-minion -master a-master -runservice | ||
|
||
build_script: | ||
- ps: | | ||
$Path = (Get-Location).Path | Join-Path -ChildPath bootstrap-salt.ps1 | ||
Invoke-Expression "$Path -verbose $env:bootstrap_args" | ||
before_test: | ||
- SET PATH=%PATH%;C:\salt | ||
- salt-call --version | ||
|
||
test_script: | ||
- ps: | | ||
$Path = (Get-Location).Path | Join-Path -ChildPath tests\runtests.ps1 | ||
Invoke-Expression "$Path -verbose $env:test_args" | ||
matrix: | ||
fast_finish: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<# | ||
.SYNOPSIS | ||
A simple Powershell script to test installed salt minion on windows. | ||
.PARAMETER version | ||
Salt version installed. | ||
.PARAMETER runservice | ||
Boolean flag whenever to test if service is running. | ||
.PARAMETER noservice | ||
Boolean flag whenever to test if service is not running. | ||
.PARAMETER minion | ||
Name of the minion installed on this host. | ||
.PARAMETER master | ||
Name of the master configured on this host. | ||
.EXAMPLE | ||
./runtests.ps1 | ||
Runs without any parameters. Uses all the default values/settings. | ||
#> | ||
|
||
#=============================================================================== | ||
# Commandlet Binding | ||
#=============================================================================== | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$False,ValueFromPipeline=$True)] | ||
[string]$version = $null, | ||
|
||
[Parameter(Mandatory=$False,ValueFromPipeline=$True)] | ||
[switch]$runservice, | ||
|
||
[Parameter(Mandatory=$False,ValueFromPipeline=$True)] | ||
[switch]$noservice, | ||
|
||
[Parameter(Mandatory=$False,ValueFromPipeline=$True)] | ||
[string]$minion = $null, | ||
|
||
[Parameter(Mandatory=$False,ValueFromPipeline=$True)] | ||
[string]$master = $null | ||
) | ||
|
||
#=============================================================================== | ||
# Script Functions | ||
#=============================================================================== | ||
function Get-Grains ([string]$Name) { | ||
$Command = "salt-call --local --out json --out-indent -1 grains.get $Name" | ||
$Result = iex $Command | Out-String | ConvertFrom-Json | ||
|
||
Write-Verbose "salt-call grains.get ${Name}:`n${Result}" | ||
return $Result."local" | ||
} | ||
|
||
function Get-Service-Status([string]$Name) { | ||
$Service = Get-Service $Name -ErrorAction Stop | ||
$Status = $Service.Status | ||
|
||
Write-Verbose "${Name}: ${Status}" | ||
return $Status | ||
} | ||
|
||
function Assert-Equal { | ||
[CmdletBinding()] | ||
Param ( | ||
[Parameter(Mandatory=$True,ValueFromPipeline=$True)] | ||
[string]$Actual, | ||
|
||
[Parameter(Mandatory=$True,ValueFromPipeline=$True)] | ||
[string]$Expected | ||
) | ||
|
||
If ($Actual -ne $Expected) { | ||
throw "Assert: $Actual != $Expected" | ||
} | ||
} | ||
|
||
#=============================================================================== | ||
# Do enabled checks | ||
#=============================================================================== | ||
if ($True) { | ||
Get-Grains -Name os_family | Assert-Equal -Expected "Windows" | ||
} | ||
|
||
if ($version) { | ||
Get-Grains -Name saltversion | Assert-Equal -Expected $version | ||
} | ||
|
||
if ($master) { | ||
Get-Grains -Name master | Assert-Equal -Expected $master | ||
} | ||
|
||
if ($minion) { | ||
Get-Grains -Name id | Assert-Equal -Expected $minion | ||
} | ||
|
||
if ($runservice) { | ||
Get-Service-Status salt-minion | Assert-Equal -Expected "Running" | ||
} | ||
|
||
if ($noservice) { | ||
Get-Service-Status salt-minion | Assert-Equal -Expected "Stopped" | ||
} |