Merge pull request #3948 from inspec/snappj/improve-omnibus-test-scripts

Improve omnibus test scripts
This commit is contained in:
Miah Johnson 2019-04-16 12:25:26 -07:00 committed by GitHub
commit e76978cd67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -29,13 +29,15 @@ Start-Process "$package_file" /quiet -Wait
Write-Output "--- Testing $channel $product $version"
$Env:PATH = "C:\opscode\inspec\bin;${Env:PATH}"
Write-Output "Running verification for $product"
# reload Env:PATH to ensure it gets any changes that the install made (e.g. C:\opscode\inspec\bin\ )
$Env:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
# Set GEM_HOME and GEM_PATH to verify our appbundle inspec shim is correctly
# removing them from the environment while launching from our embedded ruby.
$Env:GEM_HOME = "C:\SHOULD_NOT_EXIST"
$Env:GEM_PATH = "C:\SHOULD_NOT_EXIST"
inspec version
If ($lastexitcode -ne 0) { Exit $lastexitcode }

View file

@ -13,11 +13,9 @@ check-omnibus-package-signed "$package_file"
echo "--- Testing $channel $product $version"
export INSTALL_DIR=/opt/inspec
export PATH="/opt/inspec/bin:$PATH"
echo "Verifying ownership of package files"
export INSTALL_DIR=/opt/inspec
NONROOT_FILES="$(find "$INSTALL_DIR" ! -uid 0 -print)"
if [[ "$NONROOT_FILES" == "" ]]; then
echo "Packages files are owned by root. Continuing verification."
@ -34,5 +32,4 @@ echo "Running verification for $product"
export GEM_HOME=/SHOULD_NOT_EXIST
export GEM_PATH=/SHOULD_NOT_EXIST
export PATH="$PATH:/usr/local/bin"
inspec version