forked from chocolatey/chocolatey-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chocolatey#74) Add test for bootstrap script
Made sense to move the test package files into a subfolder, so did that in order to keep test files a bit more organised.
- Loading branch information
Showing
7 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
chocolatey/tests/integration/targets/setup_win_chocolatey/defaults/main.yml
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
25 changes: 25 additions & 0 deletions
25
chocolatey/tests/integration/targets/setup_win_chocolatey/files/bootstrap.ps1
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,25 @@ | ||
# This is a minimal bootstrap script which simply pulls the default bootstrap | ||
# script from community.chocolatey.org and then uses that to install Chocolatey. | ||
# Afterwards, a file is created so we can confirm this bootstrap script was | ||
# indeed used to install Chocolatey. | ||
|
||
$protocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 | ||
[System.Net.ServicePointManager]::SecurityProtocol = $protocol | ||
|
||
$client = New-Object System.Net.WebClient | ||
$scriptContent = $client.DownloadString("https://community.chocolatey.org/install.ps1") | ||
$filePath = "$PSScriptRoot/install.ps1" | ||
|
||
$scriptContent | Set-Content -Path $filePath | ||
|
||
$ErrorActionPreference = 'Stop' | ||
|
||
# Parameters aren't needed; our Ansible installation process sets all the parameters | ||
# with environment variables before running the bootstrap script. | ||
& $filePath | ||
|
||
$temp = "C:\temp" | ||
if (-not (Test-Path $temp)) { | ||
New-Item -ItemType Directory -Path $temp -Force > $null | ||
} | ||
[pscustomobject]@{ bootstrap = $true } | Set-Content -Path "$temp\confirm-bootstrap.txt" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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