diff --git a/.gitignore b/.gitignore index ec58526e1aefbf49f3a643e8683cda8c29ff12cb..a6a9e075618a4b9601e8c194379a4c11282f1274 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,7 @@ # Executables *.exe -*.out +#*.out *.app # ---> C @@ -53,7 +53,7 @@ # Executables *.exe -*.out +#*.out *.app *.i*86 *.x86_64 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dab8f7edd13c2f840959127de1165b096703e230..93d64cc3f5e1ab2282abff5e74df5fcfd4f21f2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,7 @@ variables: INTEGRATION_TESTS_BIN_PATH: "${CI_PROJECT_DIR}/gkfs/install/share/gkfs/tests/integration" COVERAGE_PATH: "${CI_PROJECT_DIR}/gkfs/build/.coverage" PYTEST: "${CI_PROJECT_DIR}/gkfs/install/share/gkfs/tests/integration/pytest-venv/bin/py.test" + BATS: "${CI_PROJECT_DIR}/tests/scripts/bats/bin/bats" LD_LIBRARY_PATH: "${CI_PROJECT_DIR}/deps/install/lib:${CI_PROJECT_DIR}/deps/install/lib64" # Configuration variables GKFS_LOG_LEVEL: "100" @@ -97,6 +98,24 @@ gkfwd: ## Testing ################################################################################ +## == tests for scripts ==================== +scripts: + stage: test + image: gekkofs/testing:0.8.0 + needs: [] + parallel: + matrix: + - SUBTEST: [ dl_dep.sh, compile_dep.sh ] + script: + - mkdir -p ${BUILD_PATH}/tests/scripts + - cd ${BUILD_PATH}/tests/scripts + - ${BATS} -r ${CI_PROJECT_DIR}/tests/scripts/${SUBTEST} --formatter junit > report.xml + artifacts: + expire_in: 1 week + reports: + junit: ${BUILD_PATH}/tests/scripts/report.xml + + ## == integration tests for gkfs =========== gkfs:integration: stage: test diff --git a/.gitmodules b/.gitmodules index 30e601bf23046bd8a41c69076845999c863b9f96..bb7c8ebc30f93692607374b41aced403b2eea649 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,15 @@ [submodule "external/fmt"] path = external/fmt url = https://github.com/fmtlib/fmt +[submodule "tests/scripts/bats"] + path = tests/scripts/bats + url = https://github.com/bats-core/bats-core.git +[submodule "tests/scripts/helpers/bats-assert"] + path = tests/scripts/helpers/bats-assert + url = https://github.com/bats-core/bats-assert.git +[submodule "tests/scripts/helpers/bats-support"] + path = tests/scripts/helpers/bats-support + url = https://github.com/bats-core/bats-support.git +[submodule "tests/scripts/helpers/bats-file"] + path = tests/scripts/helpers/bats-file + url = https://github.com/bats-core/bats-file.git diff --git a/scripts/compile_dep.sh b/scripts/compile_dep.sh index 798ea6ecf5f5248c4a78dbd8218ddcda498377d2..cba79229b4c151102fcf8a1d2a30ddac00b08ebf 100755 --- a/scripts/compile_dep.sh +++ b/scripts/compile_dep.sh @@ -27,19 +27,21 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ################################################################################ -PATCH_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -PATCH_DIR="${PATCH_DIR}/patches" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DEPENDENCY="" CORES="" SOURCE_DIR="" INSTALL_DIR="" PERFORM_TEST= +EXECUTION_MODE= +DRY_RUN=false + DEFAULT_PROFILE="default" DEFAULT_VERSION="latest" PROFILE_NAME=${DEFAULT_PROFILE} PROFILE_VERSION=${DEFAULT_VERSION} -PROFILES_DIR="${PWD}/profiles" +PROFILES_DIR="${SCRIPT_DIR}/profiles" declare -a PROFILE_DEP_LIST declare -A PROFILE_DEP_NAMES declare -A PROFILE_WGETDEPS PROFILE_CLONEDEPS PROFILE_SOURCES PROFILE_EXTRA_INSTALL_ARGS @@ -47,11 +49,12 @@ declare -A PROFILE_CLONEDEPS_ARGS PROFILE_CLONEDEPS_PATCHES usage_short() { echo " -usage: compile_dep.sh [-h] - [-l [PROFILE_NAME:[VERSION]]] - [-p PROFILE_NAME[:VERSION]] - [-d DEPENDENCY_NAME[[@PROFILE_NAME][:VERSION]] - [-j COMPILE_CORES] +usage: compile_dep.sh -h | + -p PROFILE_NAME[:PROFILE_VERSION] | + -d DEPENDENCY_NAME[[@PROFILE_NAME][:PROFILE_VERSION]] | + -l [PROFILE_NAME:[PROFILE_VERSION]] | + -h + [ -P PROFILES_DIR ] [ -j COMPILE_CORES] [ -n ] SOURCES_PATH INSTALL_PATH " } @@ -68,30 +71,43 @@ positional arguments: optional arguments: - -h, --help shows this help message and exits - -l, --list-dependencies - list dependencies available for building and installation - -p, --profile PROFILE_NAME[:VERSION] - allows installing a pre-defined set of dependencies as defined - in ${PROFILES_DIR}/PROFILE_NAME.specs. This is useful to + -h, --help Shows this help message and exits + -l, --list-dependencies [[PROFILE_NAME:]PROFILE_VERSION] + List dependencies available for building and installation + -p, --profile PROFILE_NAME[:PROFILE_VERSION] + Allows installing a pre-defined set of dependencies as defined + in \${PROFILES_DIR}/PROFILE_NAME.specs. This is useful to deploy specific library versions and/or configurations, using a recognizable name. Optionally, PROFILE_NAME may include a specific version for the profile, e.g. 'mogon2:latest' or 'ngio:0.8.0', which will download the dependencies defined for that specific version. If unspecified, the 'default:latest' profile will be used, which should include all the possible dependencies. - -d, --dependency DEPENDENCY_NAME[[@PROFILE_NAME][:VERSION]] - build and install a specific dependency, ignoring any --profile + -d, --dependency DEPENDENCY_NAME[[@PROFILE_NAME][:PROFILE_VERSION]] + Build and install a specific dependency, ignoring any --profile option provided. If PROFILE_NAME is unspecified, the 'default' - profile will be used. Similarly, if VERSION is unspecified, the - 'latest' version of the specified profile will be used. + profile will be used. Similarly, if PROFILE_VERSION is + unspecified, the 'latest' version of the specified profile will + be used. -j, --compilecores COMPILE_CORES - number of cores that are used to compile the dependencies - defaults to number of available cores + Set the number of cores that will be used to compile the + dependencies. If unspecified, defaults to the number of + available cores. -t, --test Perform libraries tests. + -P, --profiles-dir PROFILES_DIR + Choose the directory to be used when searching for profiles. + If unspecified, PROFILES_DIR defaults to \${PWD}/profiles. + -n, --dry-run + Do not actually run, print only what would be done. " } +exec_mode_error() { + echo "ERROR: --profile and --dependency options are mutually exclusive" + usage_short + exit 1 +} + list_versions() { if [[ ! -d "${PROFILES_DIR}" ]]; then @@ -267,6 +283,88 @@ find_cmake() { echo "${CMAKE}" } +determine_compiler() { + + compiler_is_gnu() { + COMPILER_NAME="g++" + + if ! COMPILER_FULL_VERSION="$(g++ -dumpfullversion 2>&1)"; then + echo -e "ERROR: Failed to determine compiler version." + echo -e ">> ${COMPILER_FULL_VERSION}" + exit 1 + fi + + COMPILER_MAJOR_VERSION="${COMPILER_FULL_VERSION%%.*}" + } + + compiler_is_clang() { + COMPILER_NAME="clang" + + if ! COMPILER_FULL_VERSION="$(clang -dumpversion 2>&1)"; then + echo -e "ERROR: Failed to determine compiler version." + echo -e ">> ${COMPILER_FULL_VERSION}" + exit 1 + fi + + COMPILER_MAJOR_VERSION="${COMPILER_FULL_VERSION%%.*}" + } + + # We honor the CXX environment variable if defined. + # Otherwise, we try to find the compiler by using `command -v`. + if [[ -n "${CXX}" && ! "${CXX}" =~ ^(g\+\+|clang)$ ]]; then + echo "ERROR: Unknown compiler '${CXX}'" + exit 1 + fi + + if [[ -n "${CXX}" && "${CXX}" =~ ^g\+\+$ ]]; then + compiler_is_gnu + elif [[ -n "${CXX}" && "$CXX" =~ ^clang$ ]]; then + compiler_is_clang + elif [[ $(command -v g++) ]]; then + compiler_is_gnu + elif [[ $(command -v clang) ]]; then + compiler_is_clang + else + echo "ERROR: Unable to determine compiler." + exit 1 + fi +} + +# Check whether the loaded profile defines a particular dependency name. +# The function requires a valid bash regex argument to do the search. The +# function is meant to be used in a conditional context. +# +# Examples: +# 1. Check whether any flavor of 'libfabric' is defined by the profile: +# +# if profile_has_dependency "^libfabric%.*$"; then +# echo "libfabric found" +# fi +# +# 2. Check whether a specific flavor of 'libfabric' is defined by the profile: +# +# if profile_has_dependency "^libfabric%experimental$"; then +# echo "libfabric.experimental found" +# fi +profile_has_dependency() { + + if [[ "$#" -ne 1 ]]; then + >&2 echo "FATAL: Missing argument in profile_has_dependency()" + exit 1 + fi + + regex="$1" + + for name in "${PROFILE_DEP_LIST[@]}"; do + + if [[ "${name}" =~ ${regex} ]]; then + return 0 + fi + done + + return 1 +} + POSITIONAL=() while [[ $# -gt 0 ]]; do @@ -274,6 +372,9 @@ while [[ $# -gt 0 ]]; do case ${key} in -p | --profile) + + [ -n "${EXECUTION_MODE}" ] && exec_mode_error || EXECUTION_MODE='profile' + if [[ -z "$2" ]]; then echo "ERROR: Missing argument for -p/--profile option" exit 1 @@ -292,6 +393,8 @@ while [[ $# -gt 0 ]]; do ;; -d | --dependency) + [ -n "${EXECUTION_MODE}" ] && exec_mode_error || EXECUTION_MODE='dependency' + if [[ -z "$2" ]]; then echo "ERROR: Missing argument for -d/--dependency option" exit @@ -345,6 +448,16 @@ while [[ $# -gt 0 ]]; do PERFORM_TEST=true shift ;; + -P | --profiles-dir) + + if [[ ! -d "$2" ]]; then + echo "ERROR: PROFILES_DIR '$2' does not exist or is not a directory." + exit 1 + fi + + PROFILES_DIR="$2" + shift + ;; -l | --list-dependencies) if [[ -z "$2" ]]; then list_versions @@ -358,6 +471,10 @@ while [[ $# -gt 0 ]]; do exit #shift # past argument ;; + -n | --dry-run) + DRY_RUN=true + shift + ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument @@ -398,9 +515,11 @@ CMAKE="${CMAKE} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" echo "Sources download path = ${SOURCE_DIR}" echo "Installation path = ${INSTALL_DIR}" +echo "Profile name: ${PROFILE_NAME}" +echo "Profile version: ${PROFILE_VERSION}" echo "------------------------------------" -mkdir -p "${SOURCE_DIR}" +mkdir -p "${SOURCE_DIR}" || exit 1 ######### From now on exits on any error ######## set -e @@ -411,29 +530,33 @@ export PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}" if [[ -n "${DEPENDENCY}" && ! -n "${PROFILE_DEP_NAMES[${DEPENDENCY}]}" ]]; then echo "Dependency '${DEPENDENCY}' not found in '${PROFILE_NAME}:${PROFILE_VERSION}'" - exit + exit 1 fi -for dep in "${PROFILE_DEP_LIST[@]}"; do +for dep_name in "${PROFILE_DEP_LIST[@]}"; do - if [[ -n "${DEPENDENCY}" && "${dep}" != "${DEPENDENCY}" ]]; then + # in dependency mode, skip any dependencies != DEPENDENCY + if [[ -n "${DEPENDENCY}" && "${dep_name}" != "${DEPENDENCY}" ]]; then continue fi - install_script="${PROFILES_DIR}/${PROFILE_VERSION}/install/${dep}.install" + install_script="${PROFILES_DIR}/${PROFILE_VERSION}/install/${dep_name}.install" - echo -e "\n\n######## Installing: ${dep} ###############################\n" + echo -e "\n\n######## Installing: ${dep_name} ###############################\n" if [[ -f "${install_script}" ]]; then - source "${install_script}" + [[ "$DRY_RUN" == true ]] || source "${install_script}" else - echo "WARNING: Install script for '${dep}' not found. Skipping." + echo "WARNING: Install script for '${dep_name}' not found. Skipping." continue fi - pkg_install + if [[ "$DRY_RUN" == false ]]; then + determine_compiler + pkg_install - [ "${PERFORM_TEST}" ] && pkg_check + [ "${PERFORM_TEST}" ] && pkg_check + fi done diff --git a/scripts/dl_dep.sh b/scripts/dl_dep.sh index 14274ef8dfdea2277aad2d1d8bbe95703e9e0ad9..26e9caba926a3372cda8757c73bea49bf7aedbab 100755 --- a/scripts/dl_dep.sh +++ b/scripts/dl_dep.sh @@ -29,16 +29,22 @@ COMMON_CURL_FLAGS="--silent --fail --show-error --location -O" COMMON_GIT_FLAGS="--quiet --single-branch -c advice.detachedHead=false" -PATCH_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -PATCH_DIR="${PATCH_DIR}/patches" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PATCH_DIR="${SCRIPT_DIR}/patches" DEPENDENCY="" + +EXECUTION_MODE= VERBOSE=false +DRY_RUN=false DEFAULT_PROFILE="default" DEFAULT_VERSION="latest" -PROFILES_DIR="${PWD}/profiles" +PROFILE_NAME=${DEFAULT_PROFILE} +PROFILE_VERSION=${DEFAULT_VERSION} +PROFILES_DIR="${SCRIPT_DIR}/profiles" SOURCES_FILE="${PROFILES_DIR}/sources.list" -declare -a PROFILE_DEP_NAMES +declare -a PROFILE_DEP_LIST +declare -A PROFILE_DEP_NAMES declare -A PROFILE_WGETDEPS PROFILE_CLONEDEPS PROFILE_SOURCES declare -A PROFILE_CLONEDEPS_ARGS PROFILE_CLONEDEPS_PATCHES @@ -161,6 +167,7 @@ load_profile() { # make sure we are in a known state PROFILE_DEP_NAMES=() + PROFILE_DEP_LIST=() PROFILE_CLONEDEPS=() PROFILE_CLONEDEPS_ARGS=() PROFILE_CLONEDEPS_PATCHES=() @@ -193,7 +200,8 @@ load_profile() { # propagate results outside of function for i in "${!order[@]}"; do - PROFILE_DEP_NAMES[$i]="${order[${i}]}" + PROFILE_DEP_LIST[$i]="${order[${i}]}" + PROFILE_DEP_NAMES["${order[$i]}"]="$i" done for k in "${!clonedeps[@]}"; do @@ -211,6 +219,9 @@ load_profile() { for k in "${!wgetdeps[@]}"; do PROFILE_WGETDEPS["${k}"]="${wgetdeps[${k}]}" done + + # load source URLs for dependencies + load_sources } load_sources() { @@ -236,28 +247,29 @@ clonedeps() { fi trap exit_child EXIT - local FOLDER=$1 - local REPO=$2 - local COMMIT=$3 - local GIT_FLAGS=$4 - local PATCH=$5 + local FOLDER="$1" + local REPO="$2" + local COMMIT="$3" + local PATCH="$4" + shift 4 + local GIT_FLAGS=("$@") local ACTION if [[ -d "${SOURCE_DIR}/${FOLDER}/.git" ]]; then - cd "${SOURCE_DIR}/${FOLDER}" && git fetch -q + [[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git fetch -q) ACTION="Pulled" else - git clone ${COMMON_GIT_FLAGS} ${GIT_FLAGS} -- "${REPO}" "${SOURCE_DIR}/${FOLDER}" + [[ "$DRY_RUN" == true ]] || (git clone ${COMMON_GIT_FLAGS} "${GIT_FLAGS[@]}" -- "${REPO}" "${SOURCE_DIR}/${FOLDER}") ACTION="Cloned" fi # fix the version - cd "${SOURCE_DIR}/${FOLDER}" && git checkout -qf "${COMMIT}" - echo "${ACTION} '${REPO}' to '${FOLDER}' with commit '[${COMMIT}]' and flags '${GIT_FLAGS}'" + [[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git checkout -qf "${COMMIT}") + echo "${ACTION} '${REPO}' to '${FOLDER}' with commit '[${COMMIT}]' and flags '${GIT_FLAGS[@]}'" # apply patch if provided if [[ -n "${PATCH}" ]]; then - git apply --verbose "${PATCH_DIR}/${PATCH}" + [[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git apply --verbose "${PATCH_DIR}/${PATCH}" ) fi } @@ -271,28 +283,32 @@ wgetdeps() { FOLDER=$1 URL=$2 - if [[ -d "${SOURCE_DIR}/${FOLDER}" ]]; then - # SC2115 Use "${var:?}" to ensure this never expands to /* . - rm -rf "${SOURCE_DIR:?}/${FOLDER:?}" - fi - mkdir -p "${SOURCE_DIR}/${FOLDER}" - cd "${SOURCE_DIR}" - FILENAME="$(basename $URL)" - if [[ -f "${SOURCE_DIR}/$FILENAME" ]]; then - rm -f "${SOURCE_DIR}/$FILENAME" + + if [[ "$DRY_RUN" == false ]]; then + if [[ -d "${SOURCE_DIR}/${FOLDER}" ]]; then + # SC2115 Use "${var:?}" to ensure this never expands to /* . + rm -rf "${SOURCE_DIR:?}/${FOLDER:?}" + fi + mkdir -p "${SOURCE_DIR}/${FOLDER}" + cd "${SOURCE_DIR}" + FILENAME="$(basename $URL)" + if [[ -f "${SOURCE_DIR}/$FILENAME" ]]; then + rm -f "${SOURCE_DIR}/$FILENAME" + fi + curl ${COMMON_CURL_FLAGS} "$URL" || error_exit "Failed to download ${URL}" $? + tar -xf "$FILENAME" --directory "${SOURCE_DIR}/${FOLDER}" --strip-components=1 + rm -f "$FILENAME" fi - curl ${COMMON_CURL_FLAGS} "$URL" || error_exit "Failed to download ${URL}" $? - tar -xf "$FILENAME" --directory "${SOURCE_DIR}/${FOLDER}" --strip-components=1 - rm -f "$FILENAME" echo "Downloaded '${URL}' to '${FOLDER}'" } usage_short() { echo " -usage: dl_dep.sh [-h] - [-l [[PROFILE_NAME:]VERSION]] - [-p PROFILE_NAME[:VERSION]] - [-d DEPENDENCY_NAME[[@PROFILE_NAME][:VERSION]] +usage: dl_dep.sh -p PROFILE_NAME[:PROFILE_VERSION] | + -d DEPENDENCY_NAME[[@PROFILE_NAME][:PROFILE_VERSION]] | + -l [[PROFILE_NAME:]PROFILE_VERSION] | + -h + [ -P PROFILES_DIR ] [ -n ] DESTINATION_PATH " } @@ -304,43 +320,53 @@ help_msg() { This script gets all GekkoFS dependency sources (excluding the fs itself) positional arguments: - DESTINATION_PATH path where dependencies should be downloaded + DESTINATION_PATH Path where dependencies should be downloaded optional arguments: - -h, --help shows this help message and exits - -l, --list-dependencies [[PROFILE_NAME:]VERSION] - list dependency configuration profiles available for download - -p, --profile PROFILE_NAME[:VERSION] - allows downloading a pre-defined set of dependencies as defined - in ${PROFILES_DIR}/PROFILE_NAME.specs. This is useful to + -h, --help Shows this help message and exits + -l, --list-dependencies [[PROFILE_NAME:]PROFILE_VERSION] + List dependency configuration profiles available for download + -p, --profile PROFILE_NAME[:PROFILE_VERSION] + Allows downloading a pre-defined set of dependencies as defined + in \${PROFILES_DIR}/PROFILE_NAME.specs. This is useful to deploy specific library versions and/or configurations, using a recognizable name. Optionally, PROFILE_NAME may include a specific version for the profile, e.g. 'mogon2:latest' or 'ngio:0.8.0', which will download the dependencies defined for that specific version. If unspecified, the 'default:latest' profile will be used, which should include all the possible dependencies. - -d, --dependency DEPENDENCY_NAME[[@PROFILE_NAME][:VERSION]] - build and install a specific dependency, ignoring any --profile + -d, --dependency DEPENDENCY_NAME[[@PROFILE_NAME][:PROFILE_VERSION]] + Build and install a specific dependency, ignoring any --profile option provided. If PROFILE_NAME is unspecified, the 'default' - profile will be used. Similarly, if VERSION is unspecified, the - 'latest' version of the specified profile will be used. + profile will be used. Similarly, if PROFILE_VERSION is unspecified, + the 'latest' version of the specified profile will be used. + -P, --profiles-dir PROFILES_DIR + Choose the directory to be used when searching for profiles. + If unspecified, PROFILES_DIR defaults to \${PWD}/profiles. + -n, --dry-run Do not actually run, print only what would be done. -v, --verbose Increase download verbosity " } +exec_mode_error() { + echo "ERROR: --profile and --dependency options are mutually exclusive" + usage_short + exit 1 +} + # load default profile for now, might be overridden later load_profile "${DEFAULT_PROFILE}" "${DEFAULT_VERSION}" -# load source URLs for dependencies -load_sources - POSITIONAL=() while [[ $# -gt 0 ]]; do key="$1" case ${key} in -p | --profile) + + [ -n "${EXECUTION_MODE}" ] && exec_mode_error || EXECUTION_MODE='profile' + if [[ -z "$2" ]]; then echo "ERROR: Missing argument for -p/--profile option" exit 1 @@ -354,17 +380,52 @@ while [[ $# -gt 0 ]]; do PROFILE_VERSION="${DEFAULT_VERSION}" fi - load_profile "${PROFILE_NAME}" "${PROFILE_VERSION}" shift # past argument shift # past value ;; -d | --dependency) + + [ -n "${EXECUTION_MODE}" ] && exec_mode_error || EXECUTION_MODE='dependency' + if [[ -z "$2" ]]; then echo "ERROR: Missing argument for -d/--dependency option" exit 1 fi - DEPENDENCY="$2" + + # e.g. mercury@mogon1:latest + if [[ "$2" =~ ^(.*)@(.*):(.*)$ ]]; then + if [[ -n "${BASH_REMATCH[1]}" ]]; then + DEPENDENCY="${BASH_REMATCH[1]}" + fi + + if [[ -n "${BASH_REMATCH[2]}" ]]; then + PROFILE_NAME="${BASH_REMATCH[2]}" + fi + + if [[ -n "${BASH_REMATCH[3]}" ]]; then + PROFILE_VERSION="${BASH_REMATCH[3]}" + fi + + # e.g. mercury@mogon1 + elif [[ "$2" =~ ^(.*)@(.*)$ ]]; then + if [[ -n "${BASH_REMATCH[1]}" ]]; then + DEPENDENCY="${BASH_REMATCH[1]}" + fi + + if [[ -n "${BASH_REMATCH[2]}" ]]; then + PROFILE_NAME="${BASH_REMATCH[2]}" + fi + # e.g. mercury + else + DEPENDENCY="$2" + fi + + if [[ ! -n "${DEPENDENCY}" ]]; then + echo "ERROR: Missing dependency name." + exit 1 + fi + shift # past argument shift # past value ;; @@ -386,6 +447,21 @@ while [[ $# -gt 0 ]]; do VERBOSE=true shift # past argument ;; + -P | --profiles-dir) + + if [[ ! -d "$2" ]]; then + echo "ERROR: PROFILES_DIR '$2' does not exist or is not a directory." + exit 1 + fi + + PROFILES_DIR="$2" + SOURCES_FILE="${PROFILES_DIR}/sources.list" + shift + ;; + -n | --dry-run) + DRY_RUN=true + shift + ;; *) # unknown option POSITIONAL+=("$1") # save it in an array for later shift # past argument @@ -402,72 +478,85 @@ if [[ -z ${1+x} ]]; then fi SOURCE_DIR="$(readlink -mn "${1}")" +load_profile "${PROFILE_NAME}" "${PROFILE_VERSION}" + +if [[ -n "${DEPENDENCY}" && ! -n "${PROFILE_DEP_NAMES[${DEPENDENCY}]}" ]]; then + echo "ERROR: '${DEPENDENCY}' not found in '${PROFILE_NAME}:${PROFILE_VERSION}'" + exit 1 +fi + echo "Destination path is set to \"${SOURCE_DIR}\"" +echo "Profile name: ${PROFILE_NAME}" +echo "Profile version: ${PROFILE_VERSION}" echo "------------------------------------" -mkdir -p "${SOURCE_DIR}" +mkdir -p "${SOURCE_DIR}" || exit 1 ## download dependencies -for dep in "${PROFILE_DEP_NAMES[@]}"; do +for dep_name in "${PROFILE_DEP_LIST[@]}"; do - if [[ ! -z "${PROFILE_WGETDEPS[${dep}]:-}" ]]; then + # in dependency mode, skip any dependencies != DEPENDENCY + if [[ -n "${DEPENDENCY}" && "${dep_name}" != "${DEPENDENCY}" ]]; then + continue + fi - # dependency names can include a TAG after a colon (e.g. ofi:verbs), - # remove it - dep_id=${dep%%:*} + if [[ ! -z "${PROFILE_WGETDEPS[${dep_name}]:-}" ]]; then # find required version for dependency - dep_version="${PROFILE_WGETDEPS[${dep}]}" + dep_version="${PROFILE_WGETDEPS[${dep_name}]}" # build URL for dependency - dep_url="${PROFILE_SOURCES[${dep_id}]}" + dep_url="${PROFILE_SOURCES[${dep_name}]}" if [[ -z "${dep_url}" ]]; then - echo "Missing source URL for '${dep_id}'. Verify ${SOURCES_FILE}." + echo "Missing source URL for '${dep_name}'. Verify ${SOURCES_FILE}." + wait exit 1 fi dep_url="${dep_url/\{\{VERSION\}\}/${dep_version}}" - wgetdeps "${dep_id}" "${dep_url}" & - - elif [[ ! -z "${PROFILE_CLONEDEPS[${dep}]:-}" ]]; then + wgetdeps "${dep_name}" "${dep_url}" & - # dependency names can include a TAG after a colon (e.g. ofi:verbs), - # remove it - dep_id=${dep%%:*} + elif [[ ! -z "${PROFILE_CLONEDEPS[${dep_name}]:-}" ]]; then - dep_args="" + dep_args=() # find required version for dependency - dep_version="${PROFILE_CLONEDEPS[${dep}]}" + dep_version="${PROFILE_CLONEDEPS[${dep_name}]}" # version may be a commit hash, a tag or something like HEAD@BRANCH_NAME # if it's the latter, remove the @BRANCH_NAME if [[ "${dep_version}" =~ ^(.*)@(.*)$ ]]; then - dep_args+="-b ${BASH_REMATCH[2]}" + dep_args+=("--branch=${BASH_REMATCH[2]}") dep_version=${BASH_REMATCH[1]} fi # build URL for dependency - dep_url="${PROFILE_SOURCES[${dep_id}]}" + dep_url="${PROFILE_SOURCES[${dep_name}]}" if [[ -z "${dep_url}" ]]; then - echo "Missing source URL for '${dep_id}'. Verify ${SOURCES_FILE}." + echo "Missing source URL for '${dep_name}'. Verify ${SOURCES_FILE}." + wait exit 1 fi dep_url="${dep_url/\{\{VERSION\}\}/${dep_version}}" # check if extra args are required - dep_args+="${PROFILE_CLONEDEPS_ARGS[${dep}]}" + for arg in "${PROFILE_CLONEDEPS_ARGS[${dep_name}]}"; + do + if [[ -n "${arg}" ]]; then + dep_args+=("${arg}") + fi + done - dep_patch=${PROFILE_CLONEDEPS_PATCHES[${dep}]} + dep_patch=${PROFILE_CLONEDEPS_PATCHES[${dep_name}]} - clonedeps "${dep}" "${dep_url}" "${dep_version}" "${dep_args}" "${dep_patch}" & + clonedeps "${dep_name}" "${dep_url}" "${dep_version}" "${dep_patch}" "${dep_args[@]}" & else - echo "Unknown dependency '${dep}'." + echo "Unknown dependency '${dep_name}'." exit 1 fi done diff --git a/scripts/profiles/0.8.0/default.specs b/scripts/profiles/0.8.0/default.specs index 4512c95b2a3fc3d080187022d8651ca9ffdf3de6..d3506b0d21b810a9d4cb5ba5e544823990a97032 100644 --- a/scripts/profiles/0.8.0/default.specs +++ b/scripts/profiles/0.8.0/default.specs @@ -44,7 +44,7 @@ wgetdeps=( ["capstone"]="4.0.1" ["argobots"]="1.0rc1" ["rocksdb"]="6.2.2" - ["rocksdb:experimental"]="6.11.4" + ["rocksdb%experimental"]="6.11.4" ["psm2"]="11.2.86" ) @@ -52,8 +52,8 @@ wgetdeps=( clonedeps=( ["bmi"]="6ea0b78fce1b964e45102828cdd05df7040a94c8" ["libfabric"]="HEAD@v1.8.1" -# ["libfabric:experimental"]="HEAD@v1.9.1" -# ["libfabric:verbs"]="HEAD@v1.7.2" + ["libfabric%experimental"]="HEAD@v1.9.1" + ["libfabric%verbs"]="HEAD@v1.7.2" ["mercury"]="41caa143a07ed179a3149cac4af0dc7aa3f946fd" ["margo"]="v0.6.3" ["syscall_intercept"]="f7cebb7b7e7512a19b78a31ce236ad6ca22636dd" @@ -75,9 +75,9 @@ clonedeps_patches=( order=( "bzip2" "zstd" "lz4" "snappy" "capstone" "bmi" "libfabric" - #"libfabric:experimental" - #"libfabric:verbs" - "mercury" "argobots" "margo" "rocksdb" "rocksdb:experimental" + "libfabric%experimental" + "libfabric%verbs" + "mercury" "argobots" "margo" "rocksdb" "rocksdb%experimental" "syscall_intercept" "date" "psm2" "agios" ) @@ -91,6 +91,6 @@ order=( # - PERFORM_TEST: whether tests for the package should be executed extra_install_args=( ["libfabric"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2" - #["libfabric:verbs"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2 --enable-verbs=yes" - #["libfabric:experimental"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2 --enable-verbs=yes" + ["libfabric%verbs"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2 --enable-verbs=yes" + ["libfabric%experimental"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2 --enable-verbs=yes" ) diff --git a/scripts/profiles/0.8.0/install/agios.install b/scripts/profiles/0.8.0/install/agios.install index 4ceffc2c3c72aa9afc140148cdfe1b6167f63d6e..f19d03f091af55989ca06fb3e0d8f03af45c6d30 100644 --- a/scripts/profiles/0.8.0/install/agios.install +++ b/scripts/profiles/0.8.0/install/agios.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/agios" + ID="agios" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}/build" ${CMAKE} -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" .. diff --git a/scripts/profiles/0.8.0/install/argobots.install b/scripts/profiles/0.8.0/install/argobots.install index 17c4d2be9f1ea36866307678816f6a6bfb8ca5a3..6c0aff1464bcd302ee50cb2d102b3b582d0d7615 100644 --- a/scripts/profiles/0.8.0/install/argobots.install +++ b/scripts/profiles/0.8.0/install/argobots.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/argobots" + ID="argobots" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}" ./autogen.sh diff --git a/scripts/profiles/0.8.0/install/bmi.install b/scripts/profiles/0.8.0/install/bmi.install index 411b4d880783b8559e43887be7a15daf6aea42da..a0cd0b6753e40f0cafea26f1ff5a57777e248d38 100644 --- a/scripts/profiles/0.8.0/install/bmi.install +++ b/scripts/profiles/0.8.0/install/bmi.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/bmi" + ID="bmi" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}" ./prepare diff --git a/scripts/profiles/0.8.0/install/bzip2.install b/scripts/profiles/0.8.0/install/bzip2.install index fa40bc2655c500b501ff7e12f55bfbc75518c752..a1f45ab393c54ddd9dffdf0edc10d002fdbe75e9 100644 --- a/scripts/profiles/0.8.0/install/bzip2.install +++ b/scripts/profiles/0.8.0/install/bzip2.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/bzip2" + ID="bzip2" + CURR="${SOURCE_DIR}/${ID}" cd "${CURR}" make install PREFIX="${INSTALL_DIR}" } diff --git a/scripts/profiles/0.8.0/install/capstone.install b/scripts/profiles/0.8.0/install/capstone.install index 6a43867615efda4fe300de98c474689e9e67c6ab..60bbd5faf7d948cf11db3b5b7da7f35e460c82b5 100644 --- a/scripts/profiles/0.8.0/install/capstone.install +++ b/scripts/profiles/0.8.0/install/capstone.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/capstone" + ID="capstone" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}/build" ${CMAKE} -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -DCMAKE_BUILD_TYPE:STRING=Release .. diff --git a/scripts/profiles/0.8.0/install/date.install b/scripts/profiles/0.8.0/install/date.install index cab34851abf27c72a9009120f367764fddfc82ac..4adf6bc11e5f511db19e992585d5a2bceef2f368 100644 --- a/scripts/profiles/0.8.0/install/date.install +++ b/scripts/profiles/0.8.0/install/date.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/date" + ID="date" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}/build" ${CMAKE} -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -DCMAKE_CXX_STANDARD:STRING=14 -DUSE_SYSTEM_TZ_DB:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON .. diff --git a/scripts/profiles/0.8.0/install/libfabric:verbs.install b/scripts/profiles/0.8.0/install/libfabric%experimental.install similarity index 90% rename from scripts/profiles/0.8.0/install/libfabric:verbs.install rename to scripts/profiles/0.8.0/install/libfabric%experimental.install index 09bf2a0890cf6f4ee560796bec5f4e30fe71e85e..98cbe5b0c620079095337b9fa8165fb99186d643 100644 --- a/scripts/profiles/0.8.0/install/libfabric:verbs.install +++ b/scripts/profiles/0.8.0/install/libfabric%experimental.install @@ -37,18 +37,22 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/libfabric" + ID="libfabric%experimental" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}" ./autogen.sh cd "${CURR}/build" OFI_CONFIG="../configure --prefix=${INSTALL_DIR} --enable-tcp=yes" - EXTRA_INSTALL_ARGS="${PROFILE_EXTRA_INSTALL_ARGS["libfabric"]}" + EXTRA_INSTALL_ARGS="${PROFILE_EXTRA_INSTALL_ARGS[${ID}]}" if [[ -n "${EXTRA_INSTALL_ARGS}" ]]; then OFI_CONFIG="${OFI_CONFIG} ${EXTRA_INSTALL_ARGS}" diff --git a/scripts/profiles/0.8.0/install/libfabric:experimental.install b/scripts/profiles/0.8.0/install/libfabric%verbs.install similarity index 90% rename from scripts/profiles/0.8.0/install/libfabric:experimental.install rename to scripts/profiles/0.8.0/install/libfabric%verbs.install index 09bf2a0890cf6f4ee560796bec5f4e30fe71e85e..46fe274334b9ba786449ba7deba64b64ac256b9e 100644 --- a/scripts/profiles/0.8.0/install/libfabric:experimental.install +++ b/scripts/profiles/0.8.0/install/libfabric%verbs.install @@ -37,18 +37,22 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/libfabric" + ID="libfabric%verbs" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}" ./autogen.sh cd "${CURR}/build" OFI_CONFIG="../configure --prefix=${INSTALL_DIR} --enable-tcp=yes" - EXTRA_INSTALL_ARGS="${PROFILE_EXTRA_INSTALL_ARGS["libfabric"]}" + EXTRA_INSTALL_ARGS="${PROFILE_EXTRA_INSTALL_ARGS[${ID}]}" if [[ -n "${EXTRA_INSTALL_ARGS}" ]]; then OFI_CONFIG="${OFI_CONFIG} ${EXTRA_INSTALL_ARGS}" diff --git a/scripts/profiles/0.8.0/install/libfabric.install b/scripts/profiles/0.8.0/install/libfabric.install index 09bf2a0890cf6f4ee560796bec5f4e30fe71e85e..deb0f511149bc19dea72481ec6bf3fbf95f126e6 100644 --- a/scripts/profiles/0.8.0/install/libfabric.install +++ b/scripts/profiles/0.8.0/install/libfabric.install @@ -37,18 +37,22 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/libfabric" + ID=libfabric + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}" ./autogen.sh cd "${CURR}/build" OFI_CONFIG="../configure --prefix=${INSTALL_DIR} --enable-tcp=yes" - EXTRA_INSTALL_ARGS="${PROFILE_EXTRA_INSTALL_ARGS["libfabric"]}" + EXTRA_INSTALL_ARGS="${PROFILE_EXTRA_INSTALL_ARGS[${ID}]}" if [[ -n "${EXTRA_INSTALL_ARGS}" ]]; then OFI_CONFIG="${OFI_CONFIG} ${EXTRA_INSTALL_ARGS}" diff --git a/scripts/profiles/0.8.0/install/lz4.install b/scripts/profiles/0.8.0/install/lz4.install index 26e549ba3f5a960b3eb9e394a847a3314ad033b5..2e807ab880d34b3c2c5bfcfb6778ee1062805122 100644 --- a/scripts/profiles/0.8.0/install/lz4.install +++ b/scripts/profiles/0.8.0/install/lz4.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/lz4" + ID="lz4" + CURR="${SOURCE_DIR}/${ID}" cd "${CURR}" make -j"${CORES}" make DESTDIR="${INSTALL_DIR}" PREFIX="" install diff --git a/scripts/profiles/0.8.0/install/margo.install b/scripts/profiles/0.8.0/install/margo.install index ea1a51d5b2fbaad28dfaba08d0fc83a783b65a25..8ddfadd98fe2236515ac8d7fa8136d4c65c54bd3 100644 --- a/scripts/profiles/0.8.0/install/margo.install +++ b/scripts/profiles/0.8.0/install/margo.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/margo" + ID="margo" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}" ./prepare.sh diff --git a/scripts/profiles/0.8.0/install/mercury.install b/scripts/profiles/0.8.0/install/mercury.install index d2677fd63103b3f6b25018846365da1be1aa39c2..50394d8612d0bfb7e3a75dab1697fad20a262ebb 100644 --- a/scripts/profiles/0.8.0/install/mercury.install +++ b/scripts/profiles/0.8.0/install/mercury.install @@ -37,13 +37,14 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - set -x - # if the profile compiles bmi, enable it if [[ -n "${PROFILE_DEP_NAMES['bmi']}" ]]; then USE_BMI="-DNA_USE_BMI:BOOL=ON" @@ -51,14 +52,15 @@ pkg_install() { USE_BMI="-DNA_USE_BMI:BOOL=OFF" fi - # if the profile compiles libfabric, enable it - if [[ -n "${PROFILE_DEP_NAMES['libfabric']}" ]]; then + # if the profile provides any flavour of libfabric, enable it + if profile_has_dependency "^libfabric.*$"; then USE_OFI="-DNA_USE_OFI:BOOL=ON" else USE_OFI="-DNA_USE_OFI:BOOL=OFF" fi - CURR="${SOURCE_DIR}/mercury" + ID="mercury" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}/build" PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig" $CMAKE \ diff --git a/scripts/profiles/0.8.0/install/rocksdb%experimental.install b/scripts/profiles/0.8.0/install/rocksdb%experimental.install new file mode 100644 index 0000000000000000000000000000000000000000..3acd778190612feaed12f24f5a731b7a54af916d --- /dev/null +++ b/scripts/profiles/0.8.0/install/rocksdb%experimental.install @@ -0,0 +1,57 @@ +################################################################################ +# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain # +# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany # +# # +# This software was partially supported by the # +# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). # +# # +# This software was partially supported by the # +# ADA-FS project under the SPPEXA project funded by the DFG. # +# # +# This file is part of GekkoFS. # +# # +# GekkoFS is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# GekkoFS is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with GekkoFS. If not, see . # +# # +# SPDX-License-Identifier: GPL-3.0-or-later # +################################################################################ +# vi: ft=bash + +################################################################################ +## The installation script must define both a pkg_install function and +## pkg_check function that, as their name implies, must specify how +## a dependency package should be installed and tested. ## ## The following +## variables can be used in the installation script: +## - CMAKE: a variable that expands to the cmake binary +## - SOURCE_DIR: the directory where the sources for the package were +## downloaded +## - INSTALL_DIR: the directory where the package should be installed +## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) +## - PERFORM_TEST: whether tests for the package should be executed +################################################################################ + +pkg_install() { + ID="rocksdb%experimental" + CURR="${SOURCE_DIR}/${ID}" + cd "${CURR}" + make clean + PORTABLE=1 USE_SSE=1 USE_RTTI=1 make -j"${CORES}" static_lib + INSTALL_PATH="${INSTALL_DIR}/${ID}" make install +} + +pkg_check() { + : +} diff --git a/scripts/profiles/0.8.0/install/rocksdb.install b/scripts/profiles/0.8.0/install/rocksdb.install index 7e14bbaabae9969c505f1d37d7540f22772a56d5..9959bf1f18e6c6afb39d4b1330baaedc0bdc507d 100644 --- a/scripts/profiles/0.8.0/install/rocksdb.install +++ b/scripts/profiles/0.8.0/install/rocksdb.install @@ -37,14 +37,26 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR=${SOURCE_DIR}/rocksdb + ID="rocksdb" + CURR="${SOURCE_DIR}/${ID}" cd "${CURR}" make clean - PORTABLE=1 USE_SSE=1 USE_RTTI=1 make -j"${CORES}" static_lib + + # gcc 9 and clang 8 need -Wno-error=deprecated-copy -Wno-error=pessimizing-move + if [[ ("${COMPILER_NAME}" == "g++" && "${COMPILER_MAJOR_VERSION}" -ge 9) || + ("${COMPILER_NAME}" == "clang" && "${COMPILER_MAJOR_VERSION}" -ge 8) ]]; then + CXXFLAGS='-Wno-error=deprecated-copy -Wno-error=pessimizing-move' PORTABLE=1 USE_SSE=1 USE_RTTI=1 make -j"${CORES}" static_lib + else + PORTABLE=1 USE_SSE=1 USE_RTTI=1 make -j"${CORES}" static_lib + fi + INSTALL_PATH="${INSTALL_DIR}" make install } diff --git a/scripts/profiles/0.8.0/install/snappy.install b/scripts/profiles/0.8.0/install/snappy.install index 078c728516c818b9200064ee650341c1547a4067..5d9b1ce92153b43b7f11d0b2e056f481e6df811a 100644 --- a/scripts/profiles/0.8.0/install/snappy.install +++ b/scripts/profiles/0.8.0/install/snappy.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR=${SOURCE_DIR}/snappy + ID="snappy" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}"/build $CMAKE -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -DCMAKE_BUILD_TYPE:STRING=Release .. diff --git a/scripts/profiles/0.8.0/install/syscall_intercept.install b/scripts/profiles/0.8.0/install/syscall_intercept.install index 72d5551a640f8ab326f8a383d9042b9710315171..aa469255aca179897dc20457505d0b47e64cd170 100644 --- a/scripts/profiles/0.8.0/install/syscall_intercept.install +++ b/scripts/profiles/0.8.0/install/syscall_intercept.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR=${SOURCE_DIR}/syscall_intercept + ID="syscall_intercept" + CURR="${SOURCE_DIR}/${ID}" prepare_build_dir "${CURR}" cd "${CURR}"/build $CMAKE -DCMAKE_PREFIX_PATH="${INSTALL_DIR}" -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -DCMAKE_BUILD_TYPE:STRING=Debug -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_TESTS:BOOK=OFF .. diff --git a/scripts/profiles/0.8.0/install/zstd.install b/scripts/profiles/0.8.0/install/zstd.install index 2ab403dbfbca27fb8b8b8f386dc2f9596c349fba..def1d467de774274f6e348b6cd0ee4921f65968c 100644 --- a/scripts/profiles/0.8.0/install/zstd.install +++ b/scripts/profiles/0.8.0/install/zstd.install @@ -37,11 +37,15 @@ ## downloaded ## - INSTALL_DIR: the directory where the package should be installed ## - CORES: the number of cores to use when building +## - COMPILER_NAME: the name of the compiler being used (e.g. g++, clang, etc.) +## - COMPILER_FULL_VERSION: the compiler's full version (e.g. 9.3.0) +## - COMPILER_MAJOR_VERSION: the compiler's major version (e.g. 9) ## - PERFORM_TEST: whether tests for the package should be executed ################################################################################ pkg_install() { - CURR="${SOURCE_DIR}/zstd/build/cmake" + ID="zstd" + CURR="${SOURCE_DIR}/${ID}/build/cmake" prepare_build_dir "${CURR}" cd "${CURR}"/build $CMAKE -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -DCMAKE_BUILD_TYPE:STRING=Release .. diff --git a/scripts/profiles/0.8.0/mogon1.specs b/scripts/profiles/0.8.0/mogon1.specs index 65bee82fbcb83cd2aefa68d21917bc82da716ac0..86ee11dc3b16eb1834b761e46720692b3daf4dcd 100644 --- a/scripts/profiles/0.8.0/mogon1.specs +++ b/scripts/profiles/0.8.0/mogon1.specs @@ -46,7 +46,7 @@ wgetdeps=( # Dependencies that must be cloned clonedeps=( - ["libfabric:verbs"]="HEAD@v1.7.2" + ["libfabric%verbs"]="HEAD@v1.7.2" ["mercury"]="41caa143a07ed179a3149cac4af0dc7aa3f946fd" ["margo"]="v0.6.3" ["rocksdb"]="6.2.2" @@ -66,7 +66,7 @@ clonedeps_patches=( # Ordering that MUST be followed when downloading/installing order=( - "zstd" "lz4" "snappy" "capstone" "libfabric:verbs" "mercury" + "zstd" "lz4" "snappy" "capstone" "libfabric%verbs" "mercury" "argobots" "margo" "rocksdb" "syscall_intercept" "date" ) @@ -79,5 +79,5 @@ order=( # - CORES: the number of cores to use when building # - PERFORM_TEST: whether tests for the package should be executed extra_install_args=( - ["libfabric:verbs"]="--enable-verbs=yes" + ["libfabric%verbs"]="--enable-verbs=yes" ) diff --git a/scripts/profiles/0.8.0/mogon2.specs b/scripts/profiles/0.8.0/mogon2.specs index 0e43065844e294cd324e0a3ba15068d83697e892..ad8d8d97dce1437238e3f6b19f144b2a95c76d5f 100644 --- a/scripts/profiles/0.8.0/mogon2.specs +++ b/scripts/profiles/0.8.0/mogon2.specs @@ -43,13 +43,13 @@ wgetdeps=( ["snappy"]="1.1.7" ["capstone"]="4.0.1" ["argobots"]="1.0rc1" - ["rocksdb:experimental"]="6.11.4" + ["rocksdb%experimental"]="6.11.4" ["psm2"]="11.2.86" ) # Dependencies that must be cloned clonedeps=( - ["libfabric:experimental"]="HEAD@v1.9.1" + ["libfabric%experimental"]="HEAD@v1.9.1" ["mercury"]="41caa143a07ed179a3149cac4af0dc7aa3f946fd" ["margo"]="v0.6.3" ["syscall_intercept"]="f7cebb7b7e7512a19b78a31ce236ad6ca22636dd" @@ -68,8 +68,8 @@ clonedeps_patches=( # Ordering that MUST be followed when downloading order=( - "bzip2" "zstd" "lz4" "snappy" "capstone" "libfabric:experimental" - "mercury" "argobots" "margo" "rocksdb:experimental" "syscall_intercept" + "bzip2" "zstd" "lz4" "snappy" "capstone" "libfabric%experimental" + "mercury" "argobots" "margo" "rocksdb%experimental" "syscall_intercept" "date" "psm2" ) @@ -82,5 +82,5 @@ order=( # - CORES: the number of cores to use when building # - PERFORM_TEST: whether tests for the package should be executed extra_install_args=( - ["libfabric:experimental"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2" + ["libfabric%experimental"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2" ) diff --git a/scripts/profiles/0.8.0/ngio.specs b/scripts/profiles/0.8.0/ngio.specs index 715c08a3467ef7f09298ac788a38c4ae1e1102af..1742e8c54b6a284f9a2ff695aaa082faeeb4371c 100644 --- a/scripts/profiles/0.8.0/ngio.specs +++ b/scripts/profiles/0.8.0/ngio.specs @@ -48,7 +48,7 @@ wgetdeps=( # Dependencies that must be cloned clonedeps=( - ["libfabric:experimental"]="HEAD@v1.9.1" + ["libfabric%experimental"]="HEAD@v1.9.1" ["mercury"]="41caa143a07ed179a3149cac4af0dc7aa3f946fd" ["margo"]="v0.6.3" ["syscall_intercept"]="f7cebb7b7e7512a19b78a31ce236ad6ca22636dd" @@ -68,7 +68,7 @@ clonedeps_patches=( # Ordering that MUST be followed when downloading order=( - "zstd" "lz4" "snappy" "capstone" "libfabric:experimental" "mercury" + "zstd" "lz4" "snappy" "capstone" "libfabric%experimental" "mercury" "argobots" "margo" "rocksdb" "syscall_intercept" "date" "psm2" "agios" ) @@ -81,5 +81,5 @@ order=( # - CORES: the number of cores to use when building # - PERFORM_TEST: whether tests for the package should be executed extra_install_args=( - ["libfabric:experimental"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2" + ["libfabric%experimental"]="--enable-psm2=yes --with-psm2-src=${SOURCE_DIR}/psm2" ) diff --git a/scripts/profiles/sources.list b/scripts/profiles/sources.list index 4485f3d7794f8d204e4767c19e044e424dc75d1a..5cbc130173f3fd331756f6e8897639365510b34d 100644 --- a/scripts/profiles/sources.list +++ b/scripts/profiles/sources.list @@ -38,11 +38,12 @@ sources=( ["capstone"]="https://github.com/aquynh/capstone/archive/{{VERSION}}.tar.gz" ["argobots"]="https://github.com/pmodels/argobots/archive/v{{VERSION}}.tar.gz" ["rocksdb"]="https://github.com/facebook/rocksdb/archive/v{{VERSION}}.tar.gz" + ["rocksdb%experimental"]="https://github.com/facebook/rocksdb/archive/v{{VERSION}}.tar.gz" ["psm2"]="https://github.com/intel/opa-psm2/archive/PSM2_{{VERSION}}.tar.gz" ["bmi"]="https://github.com/radix-io/bmi/" ["libfabric"]="https://github.com/ofiwg/libfabric.git" - ["libfabric:experimental"]="https://github.com/ofiwg/libfabric.git" - ["libfabric:verbs"]="https://github.com/ofiwg/libfabric.git" + ["libfabric%experimental"]="https://github.com/ofiwg/libfabric.git" + ["libfabric%verbs"]="https://github.com/ofiwg/libfabric.git" ["mercury"]="https://github.com/mercury-hpc/mercury" ["margo"]="https://xgitlab.cels.anl.gov/sds/margo.git" ["syscall_intercept"]="https://github.com/pmem/syscall_intercept.git" diff --git a/tests/scripts/bats b/tests/scripts/bats new file mode 160000 index 0000000000000000000000000000000000000000..a8b8d0dc7a05abe10c8511fe5041c137e06d18bf --- /dev/null +++ b/tests/scripts/bats @@ -0,0 +1 @@ +Subproject commit a8b8d0dc7a05abe10c8511fe5041c137e06d18bf diff --git a/tests/scripts/compile_dep.sh/0.8.0/all.out b/tests/scripts/compile_dep.sh/0.8.0/all.out new file mode 100644 index 0000000000000000000000000000000000000000..847a6c563f4b8956b758d3732c422ef64ce8482f --- /dev/null +++ b/tests/scripts/compile_dep.sh/0.8.0/all.out @@ -0,0 +1,14 @@ +######## Installing: bzip2 ############################### +######## Installing: zstd ############################### +######## Installing: lz4 ############################### +######## Installing: snappy ############################### +######## Installing: capstone ############################### +######## Installing: bmi ############################### +######## Installing: libfabric ############################### +######## Installing: mercury ############################### +######## Installing: argobots ############################### +######## Installing: margo ############################### +######## Installing: rocksdb ############################### +######## Installing: syscall_intercept ############################### +######## Installing: date ############################### +######## Installing: agios ############################### diff --git a/tests/scripts/compile_dep.sh/0.8.0/ci.out b/tests/scripts/compile_dep.sh/0.8.0/ci.out new file mode 100644 index 0000000000000000000000000000000000000000..8c7072d879ee8379c6cfd3251a8e8fed5b72b225 --- /dev/null +++ b/tests/scripts/compile_dep.sh/0.8.0/ci.out @@ -0,0 +1,8 @@ +######## Installing: libfabric ############################### +######## Installing: mercury ############################### +######## Installing: argobots ############################### +######## Installing: margo ############################### +######## Installing: rocksdb ############################### +######## Installing: syscall_intercept ############################### +######## Installing: date ############################### +######## Installing: agios ############################### diff --git a/tests/scripts/compile_dep.sh/0.8.0/default.out b/tests/scripts/compile_dep.sh/0.8.0/default.out new file mode 100644 index 0000000000000000000000000000000000000000..a1781600a8f6926884d0d8f910d22945b409c0ed --- /dev/null +++ b/tests/scripts/compile_dep.sh/0.8.0/default.out @@ -0,0 +1,17 @@ +######## Installing: bzip2 ############################### +######## Installing: zstd ############################### +######## Installing: lz4 ############################### +######## Installing: snappy ############################### +######## Installing: capstone ############################### +######## Installing: bmi ############################### +######## Installing: libfabric ############################### +######## Installing: mercury ############################### +######## Installing: argobots ############################### +######## Installing: margo ############################### +######## Installing: rocksdb ############################### +######## Installing: rocksdb%experimental ############################### +######## Installing: syscall_intercept ############################### +######## Installing: date ############################### +######## Installing: psm2 ############################### +WARNING: Install script for 'psm2' not found. Skipping. +######## Installing: agios ############################### diff --git a/tests/scripts/compile_dep.sh/0.8.0/direct.out b/tests/scripts/compile_dep.sh/0.8.0/direct.out new file mode 100644 index 0000000000000000000000000000000000000000..d830e84df8dc8806eeb01c5ef8600783a62c1f51 --- /dev/null +++ b/tests/scripts/compile_dep.sh/0.8.0/direct.out @@ -0,0 +1,6 @@ +######## Installing: mercury ############################### +######## Installing: argobots ############################### +######## Installing: margo ############################### +######## Installing: rocksdb ############################### +######## Installing: syscall_intercept ############################### +######## Installing: date ############################### diff --git a/tests/scripts/compile_dep.sh/0.8.0/mogon1.out b/tests/scripts/compile_dep.sh/0.8.0/mogon1.out new file mode 100644 index 0000000000000000000000000000000000000000..3afaabd70023f7a9220a8e30e1e019d814a9faea --- /dev/null +++ b/tests/scripts/compile_dep.sh/0.8.0/mogon1.out @@ -0,0 +1,11 @@ +######## Installing: zstd ############################### +######## Installing: lz4 ############################### +######## Installing: snappy ############################### +######## Installing: capstone ############################### +######## Installing: libfabric%verbs ############################### +######## Installing: mercury ############################### +######## Installing: argobots ############################### +######## Installing: margo ############################### +######## Installing: rocksdb ############################### +######## Installing: syscall_intercept ############################### +######## Installing: date ############################### diff --git a/tests/scripts/compile_dep.sh/0.8.0/mogon2.out b/tests/scripts/compile_dep.sh/0.8.0/mogon2.out new file mode 100644 index 0000000000000000000000000000000000000000..925ef005dc7ee4b0b07697d4ba45361d38f16843 --- /dev/null +++ b/tests/scripts/compile_dep.sh/0.8.0/mogon2.out @@ -0,0 +1,14 @@ +######## Installing: bzip2 ############################### +######## Installing: zstd ############################### +######## Installing: lz4 ############################### +######## Installing: snappy ############################### +######## Installing: capstone ############################### +######## Installing: libfabric%experimental ############################### +######## Installing: mercury ############################### +######## Installing: argobots ############################### +######## Installing: margo ############################### +######## Installing: rocksdb%experimental ############################### +######## Installing: syscall_intercept ############################### +######## Installing: date ############################### +######## Installing: psm2 ############################### +WARNING: Install script for 'psm2' not found. Skipping. diff --git a/tests/scripts/compile_dep.sh/0.8.0/ngio.out b/tests/scripts/compile_dep.sh/0.8.0/ngio.out new file mode 100644 index 0000000000000000000000000000000000000000..ec0cb2c4d335f51251bf75095602dc03d6239e3e --- /dev/null +++ b/tests/scripts/compile_dep.sh/0.8.0/ngio.out @@ -0,0 +1,14 @@ +######## Installing: zstd ############################### +######## Installing: lz4 ############################### +######## Installing: snappy ############################### +######## Installing: capstone ############################### +######## Installing: libfabric%experimental ############################### +######## Installing: mercury ############################### +######## Installing: argobots ############################### +######## Installing: margo ############################### +######## Installing: rocksdb ############################### +######## Installing: syscall_intercept ############################### +######## Installing: date ############################### +######## Installing: psm2 ############################### +WARNING: Install script for 'psm2' not found. Skipping. +######## Installing: agios ############################### diff --git a/tests/scripts/compile_dep.sh/latest b/tests/scripts/compile_dep.sh/latest new file mode 120000 index 0000000000000000000000000000000000000000..6c49bdfd1e11ac3dc9db730e3468a7b6efe241fe --- /dev/null +++ b/tests/scripts/compile_dep.sh/latest @@ -0,0 +1 @@ +0.8.0/ \ No newline at end of file diff --git a/tests/scripts/compile_dep.sh/test.bats b/tests/scripts/compile_dep.sh/test.bats new file mode 100644 index 0000000000000000000000000000000000000000..244aff1366a19f01995a684c4c689fc511b721d9 --- /dev/null +++ b/tests/scripts/compile_dep.sh/test.bats @@ -0,0 +1,217 @@ +# vim: set ft=bash: + +setup() { + GIT_ROOTDIR=$(git rev-parse --show-toplevel) + SCRIPT_TESTDIR=${GIT_ROOTDIR}/tests/scripts/compile_dep.sh + + load "${GIT_ROOTDIR}/tests/scripts/helpers/bats-support/load.bash" + load "${GIT_ROOTDIR}/tests/scripts/helpers/bats-assert/load.bash" + load "${GIT_ROOTDIR}/tests/scripts/helpers/bats-file/load.bash" + + + # save the current PWD + pushd . > /dev/null + + # make sure that the script is able to find the profiles + cd ${GIT_ROOTDIR}/scripts + + # make executables in scripts/ visible to PATH + PATH="${GIT_ROOTDIR}/scripts:$PATH" +} + +teardown() { + # restore the current PWD + popd > /dev/null +} + +@test "[compile_dep.sh] Check usage" { + run compile_dep.sh -h + assert_output --partial "usage: compile_dep.sh" +} + +@test "[compile_dep.sh] Check no --profile or --dependency options" { + + expected_output=${SCRIPT_TESTDIR}/latest/default.out + + assert_exist $expected_output + + run compile_dep.sh -n bar baz + + while IFS= read -r line + do + assert_output --partial "$line" + done < "$expected_output" +} + +@test "[compile_dep.sh] Check --profile and --dependency option at the same time" { + run -1 compile_dep.sh -p foobar -d barbaz + assert_output --partial "ERROR: --profile and --dependency options are mutually exclusive" +} + +@test "[compile_dep.sh] Check --profile option without argument" { + run -1 compile_dep.sh -p + assert_output --partial "ERROR: Missing argument for -p/--profile option" +} + +@test "[compile_dep.sh] Check invalid --profile option without SOURCES_PATH or INSTALL_PATH" { + run -1 compile_dep.sh -p foo + assert_output --partial "ERROR: Positional arguments missing." +} + +@test "[compile_dep.sh] Check invalid --profile option without SOURCES_PATH" { + run -1 compile_dep.sh -p foo bar + assert_output --partial "ERROR: Positional arguments missing." +} + +@test "[compile_dep.sh] Check invalid --profile option" { + run -1 compile_dep.sh -p foo bar baz + assert_output --partial "Profile 'foo:latest' does not exist." +} + +@test "[compile_dep.sh] Check valid --profile option, no PROFILE_VERSION" { + + profile_names=($(compile_dep.sh -l latest | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + expected_output=${SCRIPT_TESTDIR}/latest/${pn}.out + + assert_exist $expected_output + + run compile_dep.sh -n -p "${pn}" foo bar + + while IFS= read -r line + do + assert_output --partial "$line" + done < "$expected_output" + done + +} + +@test "[compile_dep.sh] Check valid --profile option, with PROFILE_VERSION" { + + profile_versions=($(compile_dep.sh -l | perl -lne "print for /^\s{2}(.*?):$/")) + + for pv in "${profile_versions[@]}"; do + profile_names=($(compile_dep.sh -l ${pv} | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + expected_output=${SCRIPT_TESTDIR}/${pv}/${pn}.out + + assert_exist $expected_output + + run compile_dep.sh -n -p "${pn}:${pv}" foo bar + + while IFS= read -r line + do + assert_output --partial "$line" + done < "$expected_output" + done + + done +} + +@test "[compile_dep.sh] Check unknown --dependency option" { + + profile_name=default + profile_version=latest + + run -1 compile_dep.sh -n -d foobar bar baz + + assert_output --partial "Dependency 'foobar' not found in '$profile_name:$profile_version'" + +} + +@test "[compile_dep.sh] Check valid --dependency option, no PROFILE_NAME or PROFILE_VERSION" { + + dependency_names=($(compile_dep.sh -l default:latest | perl -lne "print for /^\s{4}(\w+(?::\w+)*):.*$/")) + + for dep in "${dependency_names[@]}"; do + source_path=$(readlink -f ${BATS_TEST_TMPDIR}/foo) + install_path=$(readlink -f ${BATS_TEST_TMPDIR}/bar) + + run compile_dep.sh -n -d "${dep}" ${source_path} ${install_path} + + assert_output --regexp \ +"CORES = [0-9]+ \(default\) +Sources download path = ${source_path} +Installation path = ${install_path} +Profile name: default +Profile version: latest +------------------------------------ + + +######## Installing: ${dep} ############################### +.* +Done" + + done +} + +@test "[compile_dep.sh] Check valid --dependency option, PROFILE_NAME only" { + + profile_names=($(compile_dep.sh -l latest | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + dependency_names=($(compile_dep.sh -l ${pn}:latest | perl -lne "print for /^\s{4}(\w+(?::\w+)*):.*$/")) + + for dep in "${dependency_names[@]}"; do + source_path=$(readlink -f ${BATS_TEST_TMPDIR}/foo) + install_path=$(readlink -f ${BATS_TEST_TMPDIR}/bar) + + run compile_dep.sh -n -d "${dep}@${pn}" ${source_path} ${install_path} + + assert_output --regexp \ +"CORES = [0-9]+ \(default\) +Sources download path = ${source_path} +Installation path = ${install_path} +Profile name: ${pn} +Profile version: latest +------------------------------------ + + +######## Installing: ${dep} ############################### +.* +Done" + + done + done +} + +@test "[compile_dep.sh] Check valid --dependency option, PROFILE_NAME and PROFILE_VERSION" { + + profile_versions=($(compile_dep.sh -l | perl -lne "print for /^\s{2}(.*?):$/")) + + for pv in "${profile_versions[@]}"; do + + profile_names=($(compile_dep.sh -l latest | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + dependency_names=($(compile_dep.sh -l ${pn}:latest | perl -lne "print for /^\s{4}(\w+(?::\w+)*):.*$/")) + + for dep in "${dependency_names[@]}"; do + source_path=$(readlink -f ${BATS_TEST_TMPDIR}/foo) + install_path=$(readlink -f ${BATS_TEST_TMPDIR}/bar) + + run compile_dep.sh -n -d "${dep}@${pn}" ${source_path} ${install_path} + + assert_output --regexp \ +"CORES = [0-9]+ \(default\) +Sources download path = ${source_path} +Installation path = ${install_path} +Profile name: ${pn} +Profile version: latest +------------------------------------ + + +######## Installing: ${dep} ############################### +.* +Done" + + done + done + done +} diff --git a/tests/scripts/dl_dep.sh/0.8.0/all.out b/tests/scripts/dl_dep.sh/0.8.0/all.out new file mode 100644 index 0000000000000000000000000000000000000000..3c3328b01602567ead8924b4928c98fd00756bcb --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.8.0/all.out @@ -0,0 +1,14 @@ +Downloaded 'https://github.com/facebook/zstd/archive/v1.3.2.tar.gz' to 'zstd' +Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy' +Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone' +Cloned 'https://github.com/radix-io/bmi/' to 'bmi' with commit '[6ea0b78fce1b964e45102828cdd05df7040a94c8]' and flags '' +Downloaded 'https://sourceforge.net/projects/bzip2/files/bzip2-1.0.6.tar.gz' to 'bzip2' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '--branch=v1.8.1' +Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4' +Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules' +Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags '' +Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb' +Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags '' +Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags '' +Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '--branch=development' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots' diff --git a/tests/scripts/dl_dep.sh/0.8.0/ci.out b/tests/scripts/dl_dep.sh/0.8.0/ci.out new file mode 100644 index 0000000000000000000000000000000000000000..60e258c9800102bedc388314a95f56e14542a423 --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.8.0/ci.out @@ -0,0 +1,8 @@ +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '--branch=v1.8.1' +Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots' +Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags '' +Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb' +Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags '' +Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags '' +Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '--branch=development' diff --git a/tests/scripts/dl_dep.sh/0.8.0/default.out b/tests/scripts/dl_dep.sh/0.8.0/default.out new file mode 100644 index 0000000000000000000000000000000000000000..bb81f52f975c6f12974ecec2e12e9495faf64f98 --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.8.0/default.out @@ -0,0 +1,16 @@ +Downloaded 'https://sourceforge.net/projects/bzip2/files/bzip2-1.0.6.tar.gz' to 'bzip2' +Downloaded 'https://github.com/facebook/zstd/archive/v1.3.2.tar.gz' to 'zstd' +Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4' +Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy' +Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '--branch=v1.8.1' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric%experimental' with commit '[HEAD]' and flags '--branch=v1.9.1' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric%verbs' with commit '[HEAD]' and flags '--branch=v1.7.2' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots' +Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags '' +Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb' +Downloaded 'https://github.com/facebook/rocksdb/archive/v6.11.4.tar.gz' to 'rocksdb%experimental' +Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags '' +Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags '' +Downloaded 'https://github.com/intel/opa-psm2/archive/PSM2_11.2.86.tar.gz' to 'psm2' +Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '--branch=development' diff --git a/tests/scripts/dl_dep.sh/0.8.0/direct.out b/tests/scripts/dl_dep.sh/0.8.0/direct.out new file mode 100644 index 0000000000000000000000000000000000000000..7778dc0653dc3fee28f198773a4b7cc8a3bd8906 --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.8.0/direct.out @@ -0,0 +1,6 @@ +Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots' +Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags '' +Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb' +Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags '' +Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags '' diff --git a/tests/scripts/dl_dep.sh/0.8.0/mogon1.out b/tests/scripts/dl_dep.sh/0.8.0/mogon1.out new file mode 100644 index 0000000000000000000000000000000000000000..3fe32ccb791770a0a1e1b566e7ec6c2bfa0da0cc --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.8.0/mogon1.out @@ -0,0 +1,11 @@ +Downloaded 'https://github.com/facebook/zstd/archive/v1.3.2.tar.gz' to 'zstd' +Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4' +Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy' +Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric%verbs' with commit '[HEAD]' and flags '--branch=v1.7.2' +Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots' +Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags '' +Cloned 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb' with commit '[6.2.2]' and flags '' +Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags '' +Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags '' diff --git a/tests/scripts/dl_dep.sh/0.8.0/mogon2.out b/tests/scripts/dl_dep.sh/0.8.0/mogon2.out new file mode 100644 index 0000000000000000000000000000000000000000..a506c43fae470f2e797759ce90e94120905a5181 --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.8.0/mogon2.out @@ -0,0 +1,13 @@ +Downloaded 'https://sourceforge.net/projects/bzip2/files/bzip2-1.0.6.tar.gz' to 'bzip2' +Downloaded 'https://github.com/facebook/zstd/archive/v1.3.2.tar.gz' to 'zstd' +Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4' +Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy' +Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric%experimental' with commit '[HEAD]' and flags '--branch=v1.9.1' +Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots' +Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags '' +Downloaded 'https://github.com/facebook/rocksdb/archive/v6.11.4.tar.gz' to 'rocksdb%experimental' +Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags '' +Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags '' +Downloaded 'https://github.com/intel/opa-psm2/archive/PSM2_11.2.86.tar.gz' to 'psm2' diff --git a/tests/scripts/dl_dep.sh/0.8.0/ngio.out b/tests/scripts/dl_dep.sh/0.8.0/ngio.out new file mode 100644 index 0000000000000000000000000000000000000000..8885bc29768c630a1dbdeb487ced264091d2a954 --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.8.0/ngio.out @@ -0,0 +1,13 @@ +Downloaded 'https://github.com/facebook/zstd/archive/v1.3.2.tar.gz' to 'zstd' +Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4' +Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy' +Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric%experimental' with commit '[HEAD]' and flags '--branch=v1.9.1' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots' +Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules' +Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags '' +Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb' +Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags '' +Downloaded 'https://github.com/intel/opa-psm2/archive/PSM2_11.2.86.tar.gz' to 'psm2' +Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags '' +Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '--branch=development' diff --git a/tests/scripts/dl_dep.sh/latest b/tests/scripts/dl_dep.sh/latest new file mode 120000 index 0000000000000000000000000000000000000000..6c49bdfd1e11ac3dc9db730e3468a7b6efe241fe --- /dev/null +++ b/tests/scripts/dl_dep.sh/latest @@ -0,0 +1 @@ +0.8.0/ \ No newline at end of file diff --git a/tests/scripts/dl_dep.sh/test.bats b/tests/scripts/dl_dep.sh/test.bats new file mode 100644 index 0000000000000000000000000000000000000000..51b27ba3a67ceb8e4bf5ae356c3fd6f5e48ba5f9 --- /dev/null +++ b/tests/scripts/dl_dep.sh/test.bats @@ -0,0 +1,202 @@ +# vim: set ft=bash: + +setup() { + GIT_ROOTDIR=$(git rev-parse --show-toplevel) + SCRIPT_TESTDIR=${GIT_ROOTDIR}/tests/scripts/dl_dep.sh + + load "${GIT_ROOTDIR}/tests/scripts/helpers/bats-support/load.bash" + load "${GIT_ROOTDIR}/tests/scripts/helpers/bats-assert/load.bash" + load "${GIT_ROOTDIR}/tests/scripts/helpers/bats-file/load.bash" + + + # save the current PWD + pushd . > /dev/null + + # make sure that the script is able to find the profiles + cd ${GIT_ROOTDIR}/scripts + + # make executables in scripts/ visible to PATH + PATH="${GIT_ROOTDIR}/scripts:$PATH" +} + +teardown() { + # restore the current PWD + popd > /dev/null +} + +@test "[dl_dep.sh] Check usage" { + run dl_dep.sh -h + assert_output --partial "usage: dl_dep.sh" +} + +@test "[dl_dep.sh] Check no --profile or --dependency options" { + + expected_output=${SCRIPT_TESTDIR}/latest/default.out + + assert_exist $expected_output + + run dl_dep.sh -n "${BATS_TEST_TMPDIR}" + + while IFS= read -r line + do + assert_output --partial "$line" + done < "$expected_output" +} + +@test "[dl_dep.sh] Check --profile and --dependency option at the same time" { + run -1 dl_dep.sh -p foobar -d barbaz + assert_output --partial "ERROR: --profile and --dependency options are mutually exclusive" +} + +@test "[dl_dep.sh] Check --profile option without argument" { + run -1 dl_dep.sh -p + assert_output --partial "ERROR: Missing argument for -p/--profile option" +} + +@test "[dl_dep.sh] Check invalid --profile option without DESTINATION_PATH" { + run -1 dl_dep.sh -p foobar + assert_output --partial "ERROR: Positional arguments missing." +} + +@test "[dl_dep.sh] Check valid --profile option without DESTINATION_PATH" { + run dl_dep.sh -p default + assert_output --partial "ERROR: Positional arguments missing." +} + +@test "[dl_dep.sh] Check valid --profile option, no PROFILE_VERSION" { + + profile_names=($(dl_dep.sh -l latest | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + expected_output=${SCRIPT_TESTDIR}/latest/${pn}.out + + assert_exist $expected_output + + run dl_dep.sh -n -p "${pn}" "${BATS_TEST_TMPDIR}" + + while IFS= read -r line + do + assert_output --partial "$line" + done < "$expected_output" + done +} + +@test "[dl_dep.sh] Check valid --profile option, with PROFILE_VERSION" { + + profile_versions=($(dl_dep.sh -l | perl -lne "print for /^\s{2}(.*?):$/")) + + for pv in "${profile_versions[@]}"; do + profile_names=($(dl_dep.sh -l ${pv} | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + expected_output=${SCRIPT_TESTDIR}/${pv}/${pn}.out + + assert_exist $expected_output + + run dl_dep.sh -n -p "${pn}:${pv}" "${BATS_TEST_TMPDIR}" + + while IFS= read -r line + do + assert_output --partial "$line" + done < "$expected_output" + done + + done +} + +@test "[dl_dep.sh] Check unknown --dependency option" { + + profile_name=default + profile_version=latest + + run -1 dl_dep.sh -n -d foobar "${BATS_TEST_TMPDIR}" + + assert_output "ERROR: 'foobar' not found in '$profile_name:$profile_version'" + +} + +@test "[dl_dep.sh] Check invalid --dependency option without DESTINATION_PATH" { + run -1 dl_dep.sh -d foobar + assert_output --partial "ERROR: Positional arguments missing." +} + +@test "[dl_dep.sh] Check valid --dependency option without DESTINATION_PATH" { + run dl_dep.sh -d mercury + assert_output --partial "ERROR: Positional arguments missing." +} + +@test "[dl_dep.sh] Check valid --dependency option, no PROFILE_NAME or PROFILE_VERSION" { + + dependency_names=($(dl_dep.sh -l default:latest | perl -lne "print for /^\s{4}(\w+(?::\w+)*):.*$/")) + + for dep in "${dependency_names[@]}"; do + destination_path=$(readlink -f ${BATS_TEST_TMPDIR}) + + run dl_dep.sh -n -d "${dep}" "${BATS_TEST_TMPDIR}" + + assert_output --regexp \ +"Destination path is set to \"${destination_path}\" +Profile name: default +Profile version: latest +------------------------------------ +Downloaded|Cloned '.*' to '${dep}'.* +Done" + + done +} + +@test "[dl_dep.sh] Check valid --dependency option, PROFILE_NAME only" { + + profile_names=($(dl_dep.sh -l latest | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + dependency_names=($(dl_dep.sh -l ${pn}:latest | perl -lne "print for /^\s{4}(\w+(?::\w+)*):.*$/")) + + for dep in "${dependency_names[@]}"; do + destination_path=$(readlink -f ${BATS_TEST_TMPDIR}) + + run dl_dep.sh -n -d "${dep}@${pn}" "${BATS_TEST_TMPDIR}" + + assert_output --regexp \ +"Destination path is set to \"${destination_path}\" +Profile name: ${pn} +Profile version: latest +------------------------------------ +Downloaded|Cloned '.*' to '${dep}'.* +Done" + + done + done +} + +@test "[dl_dep.sh] Check valid --dependency option, PROFILE_NAME and PROFILE_VERSION" { + + profile_versions=($(dl_dep.sh -l | perl -lne "print for /^\s{2}(.*?):$/")) + + for pv in "${profile_versions[@]}"; do + profile_names=($(dl_dep.sh -l "${pv}" | perl -lne "print for /^\* (\w+):.*$/")) + + for pn in "${profile_names[@]}"; do + + dependency_names=($(dl_dep.sh -l ${pn}:${pv} | perl -lne "print for /^\s{4}(\w+(?::\w+)*):.*$/")) + + for dep in "${dependency_names[@]}"; do + destination_path=$(readlink -f ${BATS_TEST_TMPDIR}) + + run dl_dep.sh -n -d "${dep}@${pn}:${pv}" "${BATS_TEST_TMPDIR}" + + assert_output --regexp \ +"Destination path is set to \"${destination_path}\" +Profile name: ${pn} +Profile version: ${pv} +------------------------------------ +Downloaded|Cloned '.*' to '${dep}'.* +Done" + + done + done + done +} diff --git a/tests/scripts/helpers/bats-assert b/tests/scripts/helpers/bats-assert new file mode 160000 index 0000000000000000000000000000000000000000..672ad1823a4d2f0c475fdbec0c4497498eec5f41 --- /dev/null +++ b/tests/scripts/helpers/bats-assert @@ -0,0 +1 @@ +Subproject commit 672ad1823a4d2f0c475fdbec0c4497498eec5f41 diff --git a/tests/scripts/helpers/bats-file b/tests/scripts/helpers/bats-file new file mode 160000 index 0000000000000000000000000000000000000000..17fa557f6fe28a327933e3fa32efef1d211caa5a --- /dev/null +++ b/tests/scripts/helpers/bats-file @@ -0,0 +1 @@ +Subproject commit 17fa557f6fe28a327933e3fa32efef1d211caa5a diff --git a/tests/scripts/helpers/bats-support b/tests/scripts/helpers/bats-support new file mode 160000 index 0000000000000000000000000000000000000000..d140a65044b2d6810381935ae7f0c94c7023c8c3 --- /dev/null +++ b/tests/scripts/helpers/bats-support @@ -0,0 +1 @@ +Subproject commit d140a65044b2d6810381935ae7f0c94c7023c8c3