-
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.
feat: add windows to integration tests (#45)
### Description - Adds Windows (2016/2019 Server) machines to observe-agent integration tests - Updates Readme - Renamed tests to match closer to our readme wording ### Checklist - [x] Created tests which fail without the change (if possible) - [x] Extended the README / documentation, if necessary
- Loading branch information
1 parent
61ea539
commit ab93dc5
Showing
16 changed files
with
588 additions
and
199 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
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
Binary file not shown.
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,42 @@ | ||
# This scripts take an $local_install parameter, unzips the observe-agent .zip file and | ||
# and copies the relevant files to C:\Program Files\Observe\observe-agent | ||
# It's intended to only install observe-agent on a windows machine and ensure no issues take place | ||
|
||
#$local_installer="C:\Users\Administrator\observe-agent_Windows_x86_64.zip" This is set from python | ||
|
||
param ( | ||
[Parameter(Mandatory=$true)] | ||
[string]$local_installer | ||
) | ||
#Parameter is local_installer .zip file (which should already exist on machine) | ||
Write-Output "Local installer path is located at: $local_installer" | ||
|
||
$program_data_filestorage="C:\ProgramData\Observe\observe-agent\filestorage" | ||
$observeagent_install_dir="$env:ProgramFiles\Observe\observe-agent" | ||
$temp_dir="C:\temp" | ||
|
||
#Create directories for temp & observe-agent installation ls | ||
New-Item -ItemType Directory -Force -Path $temp_dir | ||
New-Item -ItemType Directory -Force -Path $observeagent_install_dir | ||
New-Item -ItemType Directory -Force -Path $observeagent_install_dir\config | ||
New-Item -ItemType Directory -Force -Path $program_data_filestorage | ||
|
||
# Stop the observe agent if its running so that we can copy the new .exe | ||
if((Get-Service ObserveAgent -ErrorAction SilentlyContinue)){ | ||
Write-Output "Observe Agent is running, Stopping Observe Agent..." | ||
Stop-Service ObserveAgent | ||
} | ||
|
||
# Unzip the installer .zip to C:\temp\observe-agent_extract | ||
# Eg: Unzip C:\Users\Administrator\observe-agent_Windows_x86_64.zip to C:\temp\observe-agent_extract | ||
Write-Output "Unzipping installer $local_installer to $temp_dir\observe-agent_extract" | ||
Expand-Archive -Force -LiteralPath $local_installer -DestinationPath "$temp_dir\observe-agent_extract" | ||
|
||
# Copy relevant files from C:\temp\observe-agent_extract to C:\Program Files\Observe\observe-agent | ||
Write-Output "Copying files from $temp_dir\observe-agent_extract to $observeagent_install_dir" | ||
Copy-Item -Force -Path $temp_dir\observe-agent_extract\observe-agent.exe -Destination $observeagent_install_dir | ||
Copy-Item -Force -Path $temp_dir\observe-agent_extract\observe-agent.yaml -Destination $observeagent_install_dir | ||
Copy-Item -Force -Path $temp_dir\observe-agent_extract\otel-collector.yaml -Destination $observeagent_install_dir\config\otel-collector.yaml | ||
Copy-Item -Force -Path $temp_dir\observe-agent_extract\connections\ -Destination $observeagent_install_dir\connections -Recurse | ||
|
||
|
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,36 @@ | ||
##This script is responsible for creating & starting the observe agent service | ||
|
||
$observeagent_install_dir="$env:ProgramFiles\Observe\observe-agent" | ||
|
||
if(-not (Get-Service ObserveAgent -ErrorAction SilentlyContinue)){ | ||
Write-Output "Creating ObserveAgent Service...." | ||
$params = @{ | ||
Name = "ObserveAgent" | ||
BinaryPathName = "`"${observeagent_install_dir}\observe-agent.exe`" `"${observeagent_install_dir}\observe-agent.yaml`"" | ||
DisplayName = "Observe Agent" | ||
StartupType = "Automatic" | ||
Description = "Observe Agent based on OpenTelemetry collector" | ||
} | ||
|
||
New-Service @params | ||
Write-Output "Starting ObserveAgent Service..." | ||
Start-Service ObserveAgent | ||
} | ||
else{ | ||
Write-Output "ObserveAgent Service already exists, restarting service..." | ||
Stop-Service ObserveAgent | ||
Start-Service ObserveAgent | ||
} | ||
|
||
## Placeholder below for future use | ||
## Delete ObserveAgent service if needed | ||
|
||
# if (Get-Service "ObserveAgent" -ErrorAction 'SilentlyContinue') | ||
# { | ||
# $service = Get-WmiObject -Class Win32_Service -Filter "Name='ObserveAgent'" | ||
# $service.delete() | ||
# Write-Host "ObserveAgent service deleted" | ||
# } | ||
# else{ | ||
# write-host "No service found." | ||
# } |
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
Oops, something went wrong.