mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Don't start windows service in tests
This commit is contained in:
parent
f36c2c06a3
commit
7c350c4f48
2 changed files with 22 additions and 28 deletions
31
.github/workflows/test-windows.yml
vendored
31
.github/workflows/test-windows.yml
vendored
|
@ -48,24 +48,23 @@ jobs:
|
||||||
|
|
||||||
- name: Install Pytest
|
- name: Install Pytest
|
||||||
run: |
|
run: |
|
||||||
pip install -U pytest
|
pip install -r tests\requirements.txt
|
||||||
|
|
||||||
|
- name: Get Version
|
||||||
|
run: |
|
||||||
|
# We need to get the version here and make it an environment variable
|
||||||
|
# It is used to install via bootstrap and in the test
|
||||||
|
# The version is in the instance name
|
||||||
|
$instance = "${{ matrix.instance }}"
|
||||||
|
$version = $instance -split "-",2
|
||||||
|
if ( $version.Count -gt 1 ) {
|
||||||
|
$version = $version[1].Replace("-", ".")
|
||||||
|
}
|
||||||
|
Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
|
||||||
- name: Bootstrap Salt
|
- name: Bootstrap Salt
|
||||||
run: |
|
run: |
|
||||||
. ./bootstrap-salt.ps1 -RunService $false
|
. .\bootstrap-salt.ps1 -RunService $false -Version $env:SaltVersion
|
||||||
|
|
||||||
- name: Set Environment Variables
|
|
||||||
run: |
|
|
||||||
$env:Path = "$env:Path;C:\Program Files\Salt Project\Salt"
|
|
||||||
$env:Instance = ${{ matrix.instance }}
|
|
||||||
Write-Output "Path:"
|
|
||||||
Write-Output $env:Path
|
|
||||||
Write-Output "Environment Variables"
|
|
||||||
Get-ChildItem Env:
|
|
||||||
|
|
||||||
- name: Add Salt to Path
|
|
||||||
run: |
|
|
||||||
$env:Path = "$env:Path;C:\Program Files\Salt Project\Salt"
|
|
||||||
|
|
||||||
- name: Test Bootstrap
|
- name: Test Bootstrap
|
||||||
run: |
|
run: |
|
||||||
|
@ -82,4 +81,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: exitstatus-${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
|
name: exitstatus-${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
|
||||||
path: exitstatus/
|
path: exitstatus/
|
|
@ -18,7 +18,7 @@
|
||||||
Specifies a particular version of the installer.
|
Specifies a particular version of the installer.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
./bootstrap-salt.ps1 -RunService false
|
./bootstrap-salt.ps1 -RunService $false
|
||||||
Specifies the salt-minion service to stop and be set to manual. Useful for
|
Specifies the salt-minion service to stop and be set to manual. Useful for
|
||||||
testing locally from the command line with the --local switch
|
testing locally from the command line with the --local switch
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
installer values of host name for the minion id and "salt" for the master.
|
installer values of host name for the minion id and "salt" for the master.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
./bootstrap-salt.ps1 -Minion minion-box -Master master-box -Version 3006.7 -RunService false
|
./bootstrap-salt.ps1 -Minion minion-box -Master master-box -Version 3006.7 -RunService $false
|
||||||
Specifies all the optional parameters in no particular order.
|
Specifies all the optional parameters in no particular order.
|
||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
|
@ -56,12 +56,11 @@ param(
|
||||||
[String]$Version = "latest",
|
[String]$Version = "latest",
|
||||||
|
|
||||||
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
||||||
[ValidateSet("true","false")]
|
|
||||||
[Alias("s")]
|
[Alias("s")]
|
||||||
# Boolean flag to start or stop the minion service. True will start the
|
# Boolean flag to start or stop the minion service. $true will start the
|
||||||
# minion service. False will stop the minion service and set it to "manual".
|
# minion service. $false will stop the minion service and set it to "manual".
|
||||||
# The installer starts it by default.
|
# The installer starts it by default.
|
||||||
[String]$RunService = "true",
|
[Bool]$RunService = $true,
|
||||||
|
|
||||||
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
[Parameter(Mandatory=$false, ValueFromPipeline=$True)]
|
||||||
[Alias("m")]
|
[Alias("m")]
|
||||||
|
@ -331,16 +330,12 @@ Write-Verbose "apiurl: $ApiUrl"
|
||||||
Write-Verbose "ConfDir: $ConfDir"
|
Write-Verbose "ConfDir: $ConfDir"
|
||||||
Write-Verbose "RootDir: $RootDir"
|
Write-Verbose "RootDir: $RootDir"
|
||||||
|
|
||||||
if ($RunService.ToLower() -eq "true") {
|
if ($RunService) {
|
||||||
Write-Verbose "Windows service will be set to run"
|
Write-Verbose "Windows service will be set to run"
|
||||||
[bool]$RunService = $True
|
[bool]$RunService = $True
|
||||||
} elseif ($RunService.ToLower() -eq "false") {
|
} else {
|
||||||
Write-Verbose "Windows service will be stopped and set to manual"
|
Write-Verbose "Windows service will be stopped and set to manual"
|
||||||
[bool]$RunService = $False
|
[bool]$RunService = $False
|
||||||
} else {
|
|
||||||
# Param passed in wasn't clear so defaulting to true.
|
|
||||||
Write-Verbose "Windows service defaulting to run automatically"
|
|
||||||
[bool]$RunService = $True
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue