diff options
author | Bryan McLellan <btm@chef.io> | 2015-12-16 12:49:47 -0800 |
---|---|---|
committer | Bryan McLellan <btm@chef.io> | 2015-12-16 12:54:35 -0800 |
commit | 287068733929d43052873d5bfde69ce85a967891 (patch) | |
tree | 71f9474c1ccca62a1d3979f6ba0de201e87f8825 | |
parent | 9cebfea9b4b280089cd438b3bc03886a212f6c08 (diff) | |
download | chef-287068733929d43052873d5bfde69ce85a967891.tar.gz |
Verify symlinks are created to the correct locations
-rwxr-xr-x | jenkins/verify-chef.sh | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/jenkins/verify-chef.sh b/jenkins/verify-chef.sh index 0170a3476e..b2c48651c2 100755 --- a/jenkins/verify-chef.sh +++ b/jenkins/verify-chef.sh @@ -19,26 +19,17 @@ else fi export USR_BIN_DIR -# sanity check that we're getting symlinks from the pre-install script -if [ ! -L $USR_BIN_DIR/chef-client ]; then - echo "$USR_BIN_DIR/chef-client symlink was not installed by pre-install script!" - exit 1 -fi - -if [ ! -L "$USR_BIN_DIR/knife" ]; then - echo "$USR_BIN_DIR/knife symlink was not installed by pre-install script!" - exit 1 -fi - -if [ ! -L "$USR_BIN_DIR/chef-solo" ]; then - echo "$USR_BIN_DIR/chef-solo symlink was not installed by pre-install script!" - exit 1 -fi +# sanity check that we're getting the correct symlinks from the pre-install script +linked_binaries=( "chef-client" "knife" "chef-solo" "ohai" ) -if [ ! -L "$USR_BIN_DIR/ohai" ]; then - echo "$USR_BIN_DIR/ohai symlink was not installed by pre-install script!" - exit 1 -fi +for i in "${linked_binaries[@]}" +do + LINK_TARGET=`readlink $USR_BIN_DIR/$i` + if [ "$LINK_TARGET" != "$EMBEDDED_BIN_DIR/$i" ]; then + echo "$USR_BIN_DIR/$i symlink to $EMBEDDED_BIN_DIR/$i was not correctly created by the pre-install script!" + exit 1 + fi +done # Ensure the calling environment (disapproval look Bundler) does not # infect our Ruby environment created by the `chef-client` cli. |