mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
Merge pull request #3948 from inspec/snappj/improve-omnibus-test-scripts
Improve omnibus test scripts
This commit is contained in:
commit
e76978cd67
2 changed files with 5 additions and 6 deletions
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue