diff --git a/dockerfiles/dockerfile.galasactl b/dockerfiles/dockerfile.galasactl index e13195e2..a556aa19 100644 --- a/dockerfiles/dockerfile.galasactl +++ b/dockerfiles/dockerfile.galasactl @@ -1,7 +1,29 @@ FROM harbor.galasa.dev/docker_proxy_cache/library/ubuntu:20.04 -RUN apt-get update \ - && apt-get install -y ca-certificates +# Install Java and Gradle as they are pre-reqs for galasactl +ENV GRADLE_VERSION=8.9 +ENV GRADLE_HOME=/opt/gradle + +RUN apt-get update && \ + apt-get install -y \ + ca-certificates \ + openjdk-17-jdk \ + wget \ + unzip \ + tar && \ + # Install Gradle + wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -O /tmp/gradle.zip && \ + mkdir -p ${GRADLE_HOME} && \ + unzip /tmp/gradle.zip -d ${GRADLE_HOME} && \ + rm /tmp/gradle.zip && \ + ln -s ${GRADLE_HOME}/gradle-${GRADLE_VERSION} ${GRADLE_HOME}/latest && \ + ln -s ${GRADLE_HOME}/latest/bin/gradle /usr/local/bin/gradle && \ + # Clean up + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN java -version && \ + gradle --version ARG platform diff --git a/test-galasactl-ecosystem.sh b/test-galasactl-ecosystem.sh index 4aa9872d..2b139c14 100755 --- a/test-galasactl-ecosystem.sh +++ b/test-galasactl-ecosystem.sh @@ -8,8 +8,8 @@ echo "Running script test-galasactl-ecosystem.sh" # This script can be ran locally or executed in a pipeline to test the various built binaries of galasactl +# This script can also be ran in a pipeline to test a published binary of galasactl in GHCR built by the GitHub workflow # This script tests the 'galasactl' commands against the ecosystem -# Pre-requesite: the CLI must have been built first so the binaries are present in the /bin directory # Where is this script executing from ? @@ -101,6 +101,7 @@ export GALASA_TEST_RUN_GET_EXPECTED_NUMBER_ARTIFACT_RUNNING_COUNT="10" CALLED_BY_MAIN="true" # Bootstrap is in the $bootstrap variable. + source ${BASEDIR}/test-scripts/calculate-galasactl-executables.sh calculate_galasactl_executable diff --git a/test-scripts/calculate-galasactl-executables.sh b/test-scripts/calculate-galasactl-executables.sh old mode 100644 new mode 100755 index ad35ec56..0ea94bfe --- a/test-scripts/calculate-galasactl-executables.sh +++ b/test-scripts/calculate-galasactl-executables.sh @@ -6,6 +6,10 @@ # SPDX-License-Identifier: EPL-2.0 # +# Where is this script executing from ? +BASEDIR=$(dirname "$0");pushd $BASEDIR 2>&1 >> /dev/null ;BASEDIR=$(pwd);popd 2>&1 >> /dev/null +export ORIGINAL_DIR=$(pwd) +cd "${BASEDIR}" #-------------------------------------------------------------------------- # @@ -82,25 +86,45 @@ function calculate_galasactl_executable { h2 "Calculate the name of the galasactl executable for this machine/os" raw_os=$(uname -s) # eg: "Darwin" - os="" - case $raw_os in - Darwin*) - os="darwin" - ;; - Windows*) - os="windows" - ;; - Linux*) - os="linux" - ;; - *) - error "Failed to recognise which operating system is in use. $raw_os" - exit 1 - esac - - architecture=$(uname -m) + os="" + case $raw_os in + Darwin*) + os="darwin" + ;; + Windows*) + os="windows" + ;; + Linux*) + os="linux" + ;; + *) + error "Failed to recognise which operating system is in use. $raw_os" + exit 1 + esac + + architecture=$(uname -m) + + export binary="galasactl-${os}-${architecture}" + info "galasactl binary is ${binary}" + + # Determine if the /bin directory exists i.e. if the script is testing + # a built binary or if it is testing a published Docker image in GHCR + # If testing a built binary, it will use it from the /bin, otherwise + # `galasactl` will be used as it is installed on the path within the image. + path_to_bin="${BASEDIR}/bin" + echo $path_to_bin + + # Check if the /bin directory exists + if [ -d "$path_to_bin" ]; then + echo "The /bin directory exists so assume the script is testing a locally built binary." + + export BINARY_LOCATION="${ORIGINAL_DIR}/bin/${binary}" + info "binary location is ${BINARY_LOCATION}" + else + echo "The /bin directory does not exist so assume the script is testing a published image in GHCR." + + export BINARY_LOCATION="galasactl" + fi - export binary="galasactl-${os}-${architecture}" - info "galasactl binary is ${binary}" success "OK" } \ No newline at end of file diff --git a/test-scripts/properties-tests.sh b/test-scripts/properties-tests.sh index d9e5600d..dd21c289 100755 --- a/test-scripts/properties-tests.sh +++ b/test-scripts/properties-tests.sh @@ -105,7 +105,7 @@ function properties_create { prop_name="properties.test.name.value.$PROP_NUM" - cmd="$ORIGINAL_DIR/bin/${binary} properties set --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties set --namespace ecosystemtest \ --name $prop_name \ --value test-value \ --bootstrap $bootstrap \ @@ -122,7 +122,7 @@ function properties_create { fi # check that property has been created - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -167,7 +167,7 @@ function properties_update { prop_name="properties.test.name.value.$PROP_NUM" - cmd="$ORIGINAL_DIR/bin/${binary} properties set --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties set --namespace ecosystemtest \ --name $prop_name \ --value updated-value \ --bootstrap $bootstrap \ @@ -184,7 +184,7 @@ function properties_update { fi # check that property has been updated - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -219,7 +219,7 @@ function properties_delete { prop_name="properties.test.name.value.$PROP_NUM" - cmd="$ORIGINAL_DIR/bin/${binary} properties delete --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties delete --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -235,7 +235,7 @@ function properties_delete { fi # check that property has been deleted - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -268,7 +268,7 @@ function properties_delete_invalid_property { set -o pipefail # Fail everything if anything in the pipeline fails. Else we are just checking the 'tee' return code. - cmd="$ORIGINAL_DIR/bin/${binary} properties delete --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties delete --namespace ecosystemtest \ --name this.property.shouldnt.exist \ --bootstrap $bootstrap \ --log -" @@ -292,7 +292,7 @@ function properties_delete_without_name { set -o pipefail # Fail everything if anything in the pipeline fails. Else we are just checking the 'tee' return code. - cmd="$ORIGINAL_DIR/bin/${binary} properties delete --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties delete --namespace ecosystemtest \ --bootstrap $bootstrap \ --log -" @@ -314,7 +314,7 @@ function properties_set_with_name_without_value { prop_name="properties.test.name.$PROP_NUM" - cmd="$ORIGINAL_DIR/bin/${binary} properties set --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties set --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -335,7 +335,7 @@ function properties_set_with_name_without_value { function properties_set_without_name_with_value { h2 "Performing properties set without name parameter and with value parameter..." - cmd="$ORIGINAL_DIR/bin/${binary} properties set --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties set --namespace ecosystemtest \ --value random-arbitrary-value \ --bootstrap $bootstrap \ --log -" @@ -359,7 +359,7 @@ function properties_set_without_name_and_value { prop_name="properties.test.name.value.$PROP_NUM" - cmd="$ORIGINAL_DIR/bin/${binary} properties set --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties set --namespace ecosystemtest \ --bootstrap $bootstrap \ --log -" @@ -378,7 +378,7 @@ function properties_set_without_name_and_value { #-------------------------------------------------------------------------- function properties_get_setup { h2 "Performing setup for subsequent properties get commands." - cmd="$ORIGINAL_DIR/bin/${binary} properties set --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties set --namespace ecosystemtest \ --name get.test.property \ --value this-shouldnt-be-deleted \ --bootstrap $bootstrap \ @@ -390,7 +390,7 @@ function properties_get_setup { function properties_get_with_namespace { h2 "Performing properties get with only namespace used, expecting list of properties..." - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --bootstrap $bootstrap \ --log -" @@ -420,7 +420,7 @@ function properties_get_with_namespace { function properties_get_with_name { h2 "Performing properties get with only name used, expecting list of properties..." - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --name get.test.property \ --bootstrap $bootstrap \ --log -" @@ -451,7 +451,7 @@ function properties_get_with_name { function properties_get_with_prefix { h2 "Performing properties get with prefix used, expecting list of properties..." - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --prefix get \ --bootstrap $bootstrap \ --log -" @@ -482,7 +482,7 @@ function properties_get_with_prefix { function properties_get_with_suffix { h2 "Performing properties get with suffix used, expecting list of properties..." - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --suffix property \ --bootstrap $bootstrap \ --log -" @@ -513,7 +513,7 @@ function properties_get_with_suffix { function properties_get_with_infix { h2 "Performing properties get with infix used, expecting list of properties..." - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --infix test \ --bootstrap $bootstrap \ --log -" @@ -544,7 +544,7 @@ function properties_get_with_infix { function properties_get_with_prefix_infix_and_suffix { h2 "Performing properties get with prefix, infix, and suffix used, expecting list of properties..." - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --prefix get \ --suffix property \ --infix test \ @@ -577,7 +577,7 @@ function properties_get_with_prefix_infix_and_suffix { function properties_get_with_namespace_raw_format { h2 "Performing properties get with only namespace used, expecting list of properties..." - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --bootstrap $bootstrap \ --format raw \ --log -" @@ -610,7 +610,7 @@ function properties_secure_namespace_set { prop_name="properties.secure.namespace" - cmd="$ORIGINAL_DIR/bin/${binary} properties set --namespace secure \ + cmd="${BINARY_LOCATION} properties set --namespace secure \ --name $prop_name \ --value dummy.value --bootstrap $bootstrap \ @@ -626,7 +626,7 @@ function properties_secure_namespace_set { fi # check that property resource has been created - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace secure \ + cmd="${BINARY_LOCATION} properties get --namespace secure \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -665,7 +665,7 @@ function properties_secure_namespace_delete { prop_name="properties.secure.namespace.test" - cmd="$ORIGINAL_DIR/bin/${binary} properties delete --namespace secure \ + cmd="${BINARY_LOCATION} properties delete --namespace secure \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -681,7 +681,7 @@ function properties_secure_namespace_delete { fi # check that property has been deleted - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace secure \ + cmd="${BINARY_LOCATION} properties get --namespace secure \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -719,7 +719,7 @@ function properties_secure_namespace_non_existent_prop_delete { prop_name="properties.test.name.value.$PROP_NUM" - cmd="$ORIGINAL_DIR/bin/${binary} properties delete --namespace secure \ + cmd="${BINARY_LOCATION} properties delete --namespace secure \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -735,7 +735,7 @@ function properties_secure_namespace_non_existent_prop_delete { fi # check that property has been deleted - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace secure \ + cmd="${BINARY_LOCATION} properties get --namespace secure \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -769,7 +769,7 @@ function properties_secure_namespace_non_existent_prop_delete { function properties_namespaces_get { h2 "Performing namespaces get, expecting a list of all namespaces in the cps..." - cmd="$ORIGINAL_DIR/bin/${binary} properties namespaces get \ + cmd="${BINARY_LOCATION} properties namespaces get \ --bootstrap $bootstrap \ --log -" diff --git a/test-scripts/resources-tests.sh b/test-scripts/resources-tests.sh index ba5c9ac3..eaa78fe2 100755 --- a/test-scripts/resources-tests.sh +++ b/test-scripts/resources-tests.sh @@ -118,7 +118,7 @@ data: value: $prop_value EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources create \ + cmd="${BINARY_LOCATION} resources create \ --bootstrap $bootstrap \ -f $input_file \ --log -" @@ -133,7 +133,7 @@ EOF fi # check that property resource has been created - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -187,7 +187,7 @@ data: value: $prop_value EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources update \ + cmd="${BINARY_LOCATION} resources update \ --bootstrap $bootstrap \ -f $input_file \ --log -" @@ -202,7 +202,7 @@ EOF fi # check that property resource has been updated - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -267,7 +267,7 @@ data: value: $prop_value_to_create EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources apply \ + cmd="${BINARY_LOCATION} resources apply \ --bootstrap $bootstrap \ -f $input_file \ --log -" @@ -282,7 +282,7 @@ EOF fi # check that property resource has been applied - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --infix properties.test \ --bootstrap $bootstrap \ --log -" @@ -347,7 +347,7 @@ data: value: $prop_value_to_create EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources delete \ + cmd="${BINARY_LOCATION} resources delete \ --bootstrap $bootstrap \ -f $input_file \ --log -" @@ -363,7 +363,7 @@ EOF fi # check that property has been deleted - cmd="$ORIGINAL_DIR/bin/${binary} properties get --namespace ecosystemtest \ + cmd="${BINARY_LOCATION} properties get --namespace ecosystemtest \ --name $prop_name \ --bootstrap $bootstrap \ --log -" @@ -414,7 +414,7 @@ data: value: inexistent EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources delete \ + cmd="${BINARY_LOCATION} resources delete \ --bootstrap $bootstrap \ -f $input_file \ --log -" @@ -453,7 +453,7 @@ data: value: EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources create \ + cmd="${BINARY_LOCATION} resources create \ --bootstrap $bootstrap \ -f $input_file \ --log -" @@ -491,7 +491,7 @@ data: value: value EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources create \ + cmd="${BINARY_LOCATION} resources create \ --bootstrap $bootstrap \ -f $input_file \ --log -" @@ -527,7 +527,7 @@ data: value: value EOF - cmd="$ORIGINAL_DIR/bin/${binary} resources create \ + cmd="${BINARY_LOCATION} resources create \ --bootstrap $bootstrap \ -f $input_file \ --log -" diff --git a/test-scripts/runs-tests.sh b/test-scripts/runs-tests.sh index 104b21ac..85b6c0cc 100755 --- a/test-scripts/runs-tests.sh +++ b/test-scripts/runs-tests.sh @@ -105,7 +105,7 @@ function launch_test_on_ecosystem_with_portfolio { mkdir -p ${BASEDIR}/temp cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs prepare \ + cmd="${BINARY_LOCATION} runs prepare \ --bootstrap $bootstrap \ --stream inttests \ --portfolio portfolio.yaml \ @@ -127,7 +127,7 @@ function launch_test_on_ecosystem_with_portfolio { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs submit \ + cmd="${BINARY_LOCATION} runs submit \ --bootstrap ${bootstrap} \ --portfolio portfolio.yaml \ --throttle 1 \ @@ -162,7 +162,7 @@ function runs_download_check_folder_names_during_test_run { cd ${BASEDIR}/temp # Create the portfolio. - cmd="${ORIGINAL_DIR}/bin/${binary} runs prepare \ + cmd="${BINARY_LOCATION} runs prepare \ --bootstrap $bootstrap \ --stream inttests \ --portfolio portfolio.yaml \ @@ -186,7 +186,7 @@ function runs_download_check_folder_names_during_test_run { log_file="runs-submit-output-for-download.txt" - cmd="${ORIGINAL_DIR}/bin/${binary} runs submit \ + cmd="${BINARY_LOCATION} runs submit \ --bootstrap ${bootstrap} \ --portfolio portfolio.yaml \ --throttle 1 \ @@ -229,7 +229,7 @@ function runs_download_check_folder_names_during_test_run { info "Run name is $run_name" # Now download the test results which are available from the test which is being submitted in the background process. - cmd="${ORIGINAL_DIR}/bin/${binary} runs download \ + cmd="${BINARY_LOCATION} runs download \ --name ${run_name} \ --bootstrap ${bootstrap} \ --force" @@ -314,7 +314,7 @@ function runs_reset_check_retry_present { runs_submit_log_file="runs-submit-output-for-reset.txt" - cmd="${ORIGINAL_DIR}/bin/${binary} runs submit \ + cmd="${BINARY_LOCATION} runs submit \ --bootstrap $bootstrap \ --class dev.galasa.inttests/dev.galasa.inttests.core.local.CoreLocalJava11Ubuntu \ --stream inttests @@ -361,7 +361,7 @@ function runs_reset_check_retry_present { h2 "Now attempting to reset the run while it's running in the background process." - cmd="${ORIGINAL_DIR}/bin/${binary} runs reset \ + cmd="${BINARY_LOCATION} runs reset \ --name ${run_name} \ --bootstrap ${bootstrap}" @@ -373,7 +373,7 @@ function runs_reset_check_retry_present { runs_get_log_file="runs-get-output-for-reset.txt" # Now poll runs get to check when the test is finished - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --name ${run_name} \ --bootstrap ${bootstrap}" @@ -424,7 +424,7 @@ function runs_cancel_check_test_is_finished_and_cancelled { runs_submit_log_file="runs-submit-output-for-cancel.txt" - cmd="${ORIGINAL_DIR}/bin/${binary} runs submit \ + cmd="${BINARY_LOCATION} runs submit \ --bootstrap $bootstrap \ --class dev.galasa.inttests/dev.galasa.inttests.core.local.CoreLocalJava11Ubuntu \ --stream inttests @@ -471,7 +471,7 @@ function runs_cancel_check_test_is_finished_and_cancelled { h2 "Now attempting to cancel the run while it's running in the background process." - cmd="${ORIGINAL_DIR}/bin/${binary} runs cancel \ + cmd="${BINARY_LOCATION} runs cancel \ --name ${run_name} \ --bootstrap ${bootstrap}" @@ -538,7 +538,7 @@ function get_result_with_runname { info "Run name is: ${runname}" - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --name ${runname} \ --bootstrap ${bootstrap} \ --log -" @@ -567,7 +567,7 @@ function runs_get_check_summary_format_output { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --name ${run_name} \ --format summary \ --bootstrap ${bootstrap} " @@ -619,7 +619,7 @@ function runs_get_check_details_format_output { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --name ${run_name} \ --format details \ --bootstrap ${bootstrap} " @@ -673,7 +673,7 @@ function runs_get_check_raw_format_output { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --name ${run_name} \ --format raw \ --bootstrap ${bootstrap} " @@ -711,7 +711,7 @@ function runs_get_check_raw_format_output_with_from_and_to { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --age 1h:0h \ --format raw \ --bootstrap ${bootstrap}" @@ -742,7 +742,7 @@ function runs_get_check_raw_format_output_with_just_from { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --age 1d \ --format raw \ --bootstrap ${bootstrap}" @@ -769,7 +769,7 @@ function runs_get_check_raw_format_output_with_just_from { function runs_get_check_raw_format_output_with_no_runname_and_no_age_param { h2 "Performing runs get with raw format providing no run name and no age..." - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --format raw \ --bootstrap ${bootstrap}" @@ -791,7 +791,7 @@ function runs_get_check_raw_format_output_with_invalid_age_param { h2 "Performing runs get with raw format providing an age parameter with an invalid value..." - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --age 1y:1m \ --format raw \ --bootstrap ${bootstrap}" @@ -814,7 +814,7 @@ function runs_get_check_raw_format_output_with_older_to_than_from_age { h2 "Performing runs get with raw format providing an age parameter with an older to than from age..." - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --age 1h:1d \ --format raw \ --bootstrap ${bootstrap}" @@ -839,7 +839,7 @@ function runs_get_check_requestor_parameter { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --age 1d \ --requestor $requestor \ --format details \ @@ -869,7 +869,7 @@ function runs_get_check_result_parameter { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --age 1d \ --result ${result} \ --format details \ @@ -898,7 +898,7 @@ function launch_test_on_ecosystem_without_portfolio { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs submit \ + cmd="${BINARY_LOCATION} runs submit \ --bootstrap $bootstrap \ --class dev.galasa.inttests/dev.galasa.inttests.core.local.CoreLocalJava11Ubuntu \ --stream inttests @@ -928,7 +928,7 @@ function create_portfolio_with_unknown_test { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs prepare \ + cmd="${BINARY_LOCATION} runs prepare \ --bootstrap $bootstrap \ --stream inttests \ --portfolio unknown-portfolio.yaml \ @@ -953,7 +953,7 @@ function launch_test_from_unknown_portfolio { cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs submit \ + cmd="${BINARY_LOCATION} runs submit \ --bootstrap $bootstrap \ --portfolio unknown-portfolio.yaml \ --throttle 1 \ @@ -983,7 +983,7 @@ function runs_delete_check_run_can_be_deleted { mkdir -p ${BASEDIR}/temp cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs delete \ + cmd="${BINARY_LOCATION} runs delete \ --name ${run_name} \ --bootstrap ${bootstrap}" @@ -999,7 +999,7 @@ function runs_delete_check_run_can_be_deleted { h2 "Checking that the run '${run_name}' no longer exists" - cmd="${ORIGINAL_DIR}/bin/${binary} runs get \ + cmd="${BINARY_LOCATION} runs get \ --name ${run_name} \ --bootstrap ${bootstrap}" @@ -1026,7 +1026,7 @@ function runs_delete_non_existant_run_returns_error { mkdir -p ${BASEDIR}/temp cd ${BASEDIR}/temp - cmd="${ORIGINAL_DIR}/bin/${binary} runs delete \ + cmd="${BINARY_LOCATION} runs delete \ --name ${run_name} \ --bootstrap ${bootstrap}" diff --git a/test-scripts/test-local-run-remote-cps.sh b/test-scripts/test-local-run-remote-cps.sh index 19d8a617..3d0d2d93 100755 --- a/test-scripts/test-local-run-remote-cps.sh +++ b/test-scripts/test-local-run-remote-cps.sh @@ -127,7 +127,7 @@ function remote_cps_run_tests { export REMOTE_MAVEN=https://development.galasa.dev/main/maven-repo/obr/ baseName="dev.galasa.cps.rest.test" - cmd="${PROJECT_DIR}/bin/${binary} runs submit local --obr mvn:${baseName}/${baseName}.obr/0.0.1-SNAPSHOT/obr \ + cmd="${BINARY_LOCATION} runs submit local --obr mvn:${baseName}/${baseName}.obr/0.0.1-SNAPSHOT/obr \ --class ${baseName}.http/${baseName}.http.TestHttp \ --bootstrap file://$TEMP_DIR/home/bootstrap.properties \ --remoteMaven ${REMOTE_MAVEN} \ @@ -157,7 +157,7 @@ function build_galasa_home { info "GALASA_HOME is $GALASA_HOME" - cmd="${PROJECT_DIR}/bin/${binary} local init --development" + cmd="${BINARY_LOCATION} local init --development" info "Command is $cmd" $cmd rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to build galasa home. Return code: ${rc}" ; exit 1 ; fi @@ -185,7 +185,7 @@ EOF function login_to_ecosystem { h2 "Logging into the ecosystem" info "GALASA_BOOTSTRAP is $GALASA_BOOTSTRAP" - cmd="${PROJECT_DIR}/bin/${binary} auth login --log -" + cmd="${BINARY_LOCATION} auth login --log -" info "Command is $cmd" $cmd rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to login to the galasa server. Return code: ${rc}" ; exit 1 ; fi @@ -195,7 +195,7 @@ function login_to_ecosystem { function logout_of_ecosystem { h2 "Logging out of the ecosystem" info "GALASA_BOOTSTRAP is $GALASA_BOOTSTRAP" - cmd="${PROJECT_DIR}/bin/${binary} auth logout" + cmd="${BINARY_LOCATION} auth logout" info "Command is $cmd" $cmd rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to logout to the galasa server. Return code: ${rc}" ; exit 1 ; fi @@ -205,7 +205,7 @@ function logout_of_ecosystem { function generating_galasa_test_project { h2 "Generating galasa test project code..." cd $TEMP_DIR - cmd="${PROJECT_DIR}/bin/${binary} project create --package dev.galasa.cps.rest.test --features http --obr --gradle --force --development " + cmd="${BINARY_LOCATION} project create --package dev.galasa.cps.rest.test --features http --obr --gradle --force --development " info "Command is $cmd" $cmd rc=$? ; if [[ "${rc}" != "0" ]]; then error "Failed to generate galasa test project. Return code: ${rc}" ; exit 1 ; fi