Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Use new omnibus-toolchain scripts in omnibus-test.sh #202

Merged
merged 1 commit into from
Jun 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 12 additions & 28 deletions omnibus/omnibus-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,23 @@ create_license_guard_file() {
sudo touch "/var/opt/$(basename $SERVER_INSTALL_DIR)/.license.accepted"
}

export PATH="/opt/opscode-push-jobs-server/bin:/opt/opscode-push-jobs-server/embedded/bin:$PATH"
export INSTALL_DIR="/opt/opscode-push-jobs-server"

echo "--- Installing $dep_channel chef-server latest"
install-omnibus-product -c "$dep_channel" -P chef-server -v latest
/opt/omnibus-toolchain/bin/install-omnibus-product -c "$dep_channel" -P chef-server -v latest

echo "--- Installing $channel $product $version"
package_file="$(install-omnibus-product -c "$channel" -P "$product" -v "$version" | tail -n 1)"
package_file="$(/opt/omnibus-toolchain/bin/install-omnibus-product -c "$channel" -P "$product" -v "$version" -i "$INSTALL_DIR" | tail -n 1)"

if [[ "$package_file" == *.rpm ]]; then
check-rpm-signed "$package_file"
fi
echo "--- Verifying omnibus package is signed"
/opt/omnibus-toolchain/bin/check-omnibus-package-signed "$package_file"

echo "--- Testing $channel $product $version"

export PATH="/opt/opscode-push-jobs-server/bin:/opt/opscode-push-jobs-server/embedded/bin:$PATH"
export INSTALL_DIR="/opt/opscode-push-jobs-server"
sudo rm -f "$package_file"

echo ""
echo ""
echo "============================================================"
echo "Verifying ownership of package files"
echo "============================================================"
echo ""
echo "--- Verifying ownership of package files"

NONROOT_FILES="$(find "$INSTALL_DIR" ! -uid 0 -print)"
NONROOT_FILES="$(find "$INSTALL_DIR" ! -user 0 -print)"
if [[ "$NONROOT_FILES" == "" ]]; then
echo "Packages files are owned by root. Continuing verification."
else
Expand All @@ -45,12 +39,7 @@ else
exit 1
fi

echo ""
echo ""
echo "============================================================"
echo "Reconfiguring $product"
echo "============================================================"
echo ""
echo "--- Reconfiguring $channel $product $version"

sudo mkdir -p /etc/opscode

Expand Down Expand Up @@ -82,11 +71,6 @@ create_license_guard_file /opt/opscode-push-jobs-server || true
sudo opscode-push-jobs-server-ctl reconfigure || true
sleep 120

echo ""
echo ""
echo "============================================================"
echo "Running verification for $product"
echo "============================================================"
echo ""
echo "--- Running verification for $channel $product $version"

sudo opscode-push-jobs-server-ctl test -J pedant.xml --all