Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Dan Rue | 9e11dcd | 2017-10-04 11:29:04 -0500 | [diff] [blame] | 3 | set -x |
| 4 | |
Chase Qi | 890c120 | 2017-06-19 16:09:27 +0800 | [diff] [blame] | 5 | # shellcheck disable=SC1091 |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 6 | . ../../lib/sh-test-lib |
| 7 | OUTPUT="$(pwd)/output" |
| 8 | RESULT_FILE="${OUTPUT}/result.txt" |
| 9 | # Absolute path to this script. /home/user/bin/foo.sh |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 10 | SCRIPT="$(readlink -f "${0}")" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 11 | # Absolute path this script is in. /home/user/bin |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 12 | SCRIPTPATH="$(dirname "${SCRIPT}")" |
| 13 | echo "Script path is: ${SCRIPTPATH}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 14 | # List of test cases |
| 15 | TST_CMDFILES="" |
| 16 | # List of test cases to be skipped |
| 17 | SKIPFILE="" |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 18 | # List of test cases to be skipped in yaml/skipgen format |
| 19 | SKIPFILE_YAML="" |
| 20 | BOARD="" |
| 21 | BRANCH="" |
| 22 | ENVIRONMENT="" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 23 | # LTP version |
Naresh Kamboju | 52f0257 | 2018-11-20 19:52:18 +0530 | [diff] [blame] | 24 | LTP_VERSION="20180926" |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 25 | TEST_PROGRAM=ltp |
| 26 | # https://github.com/linux-test-project/ltp.git |
| 27 | TEST_GIT_URL="" |
| 28 | TEST_DIR="$(pwd)/${TEST_PROGRAM}" |
| 29 | BUILD_FROM_TAR="false" |
Anders Roxell | a384c31 | 2022-10-25 09:02:44 +0200 | [diff] [blame] | 30 | SHARD_NUMBER=1 |
| 31 | SHARD_INDEX=1 |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 32 | |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame^] | 33 | RUNNER="" |
| 34 | |
Naresh Kamboju | 9bce916 | 2017-07-13 12:56:27 +0530 | [diff] [blame] | 35 | LTP_TMPDIR=/ltp-tmp |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 36 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 37 | LTP_INSTALL_PATH=/opt/ltp |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 38 | |
| 39 | usage() { |
Naresh Kamboju | 3a42795 | 2017-07-06 16:56:59 +0530 | [diff] [blame] | 40 | echo "Usage: ${0} [-T mm,math,syscalls] |
| 41 | [-S skipfile-lsk-juno] |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 42 | [-b board] |
Anders Roxell | 05c1e17 | 2019-04-02 05:08:34 +0200 | [diff] [blame] | 43 | [-d temp directory] |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 44 | [-g branch] |
| 45 | [-e environment] |
Rémi Duraffort | e08fea4 | 2021-01-04 14:31:02 +0100 | [diff] [blame] | 46 | [-i install path] |
Naresh Kamboju | 3a42795 | 2017-07-06 16:56:59 +0530 | [diff] [blame] | 47 | [-s True|False] |
| 48 | [-v LTP_VERSION] |
Dan Rue | 58d3a88 | 2017-07-11 16:30:30 -0500 | [diff] [blame] | 49 | [-M Timeout_Multiplier] |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 50 | [-R root_password] |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame^] | 51 | [-r new runner (kirk)] |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 52 | [-u git url] |
| 53 | [-p build directory] |
| 54 | [-t build from tarfile ] |
Anders Roxell | a384c31 | 2022-10-25 09:02:44 +0200 | [diff] [blame] | 55 | [-c sharding bucket to run ] |
| 56 | [-n number of shard buckets to create ] |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 57 | " 1>&2 |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 58 | exit 0 |
| 59 | } |
| 60 | |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame^] | 61 | while getopts "M:T:S:b:d:g:e:i:s:v:R:r:u:p:t:c:n:" arg; do |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 62 | case "$arg" in |
| 63 | T) |
| 64 | TST_CMDFILES="${OPTARG}" |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 65 | # shellcheck disable=SC2001 |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 66 | LOG_FILE=$(echo "${OPTARG}"| sed 's,\/,_,') |
| 67 | ;; |
| 68 | S) |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 69 | if [ -z "${OPTARG##*http*}" ]; then |
| 70 | if [ -z "${OPTARG##*yaml*}" ]; then |
| 71 | # Skipfile is of type yaml |
| 72 | SKIPFILE_TMP="http-skipfile.yaml" |
| 73 | SKIPFILE_YAML="${SCRIPTPATH}/${SKIPFILE_TMP}" |
| 74 | else |
| 75 | # Skipfile is normal skipfile |
| 76 | SKIPFILE_TMP="http-skipfile" |
| 77 | SKIPFILE="-S ${SCRIPTPATH}/${SKIPFILE_TMP}" |
| 78 | fi |
| 79 | # Download LTP skipfile from specified URL |
| 80 | if ! wget "${OPTARG}" -O "${SKIPFILE_TMP}"; then |
| 81 | error_msg "Failed to fetch ${OPTARG}" |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 82 | fi |
| 83 | elif [ "${OPTARG##*.}" = "yaml" ]; then |
| 84 | # yaml skipfile; use skipgen to generate a skipfile |
| 85 | SKIPFILE_YAML="${SCRIPTPATH}/${OPTARG}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 86 | else |
Rémi Duraffort | e7cc8a2 | 2021-01-05 14:04:03 +0100 | [diff] [blame] | 87 | # Regular LTP skipfile. Absolute or relative path? |
| 88 | if [ "${OPTARG:0:1}" == "/" ]; then |
| 89 | SKIPFILE="-S ${OPTARG}" |
| 90 | else |
| 91 | SKIPFILE="-S ${SCRIPTPATH}/${OPTARG}" |
| 92 | fi |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 93 | fi |
| 94 | ;; |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 95 | b) |
| 96 | export BOARD="${OPTARG}" |
| 97 | ;; |
Anders Roxell | 05c1e17 | 2019-04-02 05:08:34 +0200 | [diff] [blame] | 98 | d) |
| 99 | export LTP_TMPDIR="${OPTARG}" |
| 100 | ;; |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 101 | g) |
| 102 | export BRANCH="${OPTARG}" |
| 103 | ;; |
| 104 | e) |
| 105 | export ENVIRONMENT="${OPTARG}" |
| 106 | ;; |
Rémi Duraffort | e08fea4 | 2021-01-04 14:31:02 +0100 | [diff] [blame] | 107 | i) |
| 108 | export LTP_INSTALL_PATH="${OPTARG}" |
| 109 | ;; |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 110 | # SKIP_INSTALL is true in case of Open Embedded builds |
| 111 | # SKIP_INSTALL is flase in case of Debian builds |
| 112 | s) SKIP_INSTALL="${OPTARG}";; |
| 113 | v) LTP_VERSION="${OPTARG}";; |
Naresh Kamboju | 3bff06b | 2017-05-24 14:46:37 +0530 | [diff] [blame] | 114 | # Slow machines need more timeout Default is 5min and multiply * MINUTES |
| 115 | M) export LTP_TIMEOUT_MUL="${OPTARG}";; |
Dan Rue | 58d3a88 | 2017-07-11 16:30:30 -0500 | [diff] [blame] | 116 | R) export PASSWD="${OPTARG}";; |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame^] | 117 | r) export RUNNER="${OPTARG}";; |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 118 | u) |
| 119 | if [[ "$OPTARG" != '' ]]; then |
| 120 | TEST_GIT_URL="$OPTARG" |
| 121 | TEST_TARFILE="" |
| 122 | fi |
| 123 | ;; |
| 124 | p) |
| 125 | if [[ "$OPTARG" != '' ]]; then |
| 126 | TEST_DIR="$OPTARG" |
| 127 | fi |
| 128 | ;; |
| 129 | t) |
| 130 | BUILD_FROM_TAR="$OPTARG" |
| 131 | ;; |
Anders Roxell | a384c31 | 2022-10-25 09:02:44 +0200 | [diff] [blame] | 132 | c) |
| 133 | SHARD_INDEX="$OPTARG" |
| 134 | ;; |
| 135 | n) |
| 136 | SHARD_NUMBER="$OPTARG" |
| 137 | ;; |
Anders Roxell | 446b84f | 2019-04-03 05:30:21 +0200 | [diff] [blame] | 138 | *) |
| 139 | usage |
| 140 | error_msg "No flag ${OPTARG}" |
| 141 | ;; |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 142 | esac |
| 143 | done |
| 144 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 145 | TEST_TARFILE=https://github.com/linux-test-project/ltp/releases/download/"${LTP_VERSION}"/ltp-full-"${LTP_VERSION}".tar.xz |
| 146 | |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 147 | if [ -n "${SKIPFILE_YAML}" ]; then |
| 148 | export SKIPFILE_PATH="${SCRIPTPATH}/generated_skipfile" |
| 149 | generate_skipfile |
| 150 | if [ ! -f "${SKIPFILE_PATH}" ]; then |
| 151 | error_msg "Skipfile ${SKIPFILE} does not exist"; |
Dan Rue | f497055 | 2018-01-26 17:28:35 -0600 | [diff] [blame] | 152 | fi |
| 153 | SKIPFILE="-S ${SKIPFILE_PATH}" |
| 154 | fi |
| 155 | |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 156 | # Parse LTP output |
| 157 | parse_ltp_output() { |
Chase Qi | 3308d6b | 2017-08-07 15:19:35 +0800 | [diff] [blame] | 158 | grep -E "PASS|FAIL|CONF" "$1" \ |
| 159 | | awk '{print $1" "$2}' \ |
| 160 | | sed 's/PASS/pass/; s/FAIL/fail/; s/CONF/skip/' >> "${RESULT_FILE}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 161 | } |
| 162 | |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame^] | 163 | parse_ltp_json_results() { |
| 164 | jq -r '.results| .[]| "\(.test_fqn) \(.test.result)"' "$1" \ |
| 165 | | sed 's/brok/fail/; s/conf/skip/' >> "${RESULT_FILE}" |
| 166 | } |
| 167 | |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 168 | # Run LTP test suite |
| 169 | run_ltp() { |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 170 | # shellcheck disable=SC2164 |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 171 | cd "${LTP_INSTALL_PATH}" |
Naresh Kamboju | ff5f6c3 | 2017-07-11 14:50:32 +0530 | [diff] [blame] | 172 | # shellcheck disable=SC2174 |
| 173 | mkdir -m 777 -p "${LTP_TMPDIR}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 174 | |
Anders Roxell | a384c31 | 2022-10-25 09:02:44 +0200 | [diff] [blame] | 175 | for file in ${TST_CMDFILES//,/ }; do |
| 176 | cat runtest/"${file}" >>alltests |
| 177 | done |
| 178 | sed -i 's/#.*$//;/^$/d' alltests |
| 179 | split --verbose --numeric-suffixes=1 -n l/"${SHARD_INDEX}"/"${SHARD_NUMBER}" alltests >runtest/shardfile |
| 180 | echo "============== Tests to run ===============" |
| 181 | cat runtest/shardfile |
| 182 | echo "===========End Tests to run ===============" |
| 183 | |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame^] | 184 | if [ -n "${RUNNER}" ]; then |
| 185 | eval "${RUNNER}" --version |
| 186 | # shellcheck disable=SC2181 |
| 187 | if [ $? -ne "0" ]; then |
| 188 | error_msg "${RUNNER} is not installed into the file system." |
| 189 | fi |
| 190 | pipe0_status "${RUNNER} --framework ltp --run-suite shardfile \ |
| 191 | -d ${LTP_TMPDIR} --env LTP_COLORIZE_OUTPUT=0 \ |
| 192 | --skip-file ${SKIPFILE_PATH} \ |
| 193 | --json-report /tmp/kirk-report.json \ |
| 194 | --verbose" "tee ${OUTPUT}/LTP_${LOG_FILE}.out" |
| 195 | parse_ltp_json_results "/tmp/kirk-report.json" |
| 196 | else |
| 197 | pipe0_status "./runltp -p -q -f shardfile \ |
Naresh Kamboju | 3a42795 | 2017-07-06 16:56:59 +0530 | [diff] [blame] | 198 | -l ${OUTPUT}/LTP_${LOG_FILE}.log \ |
| 199 | -C ${OUTPUT}/LTP_${LOG_FILE}.failed \ |
| 200 | -d ${LTP_TMPDIR} \ |
| 201 | ${SKIPFILE}" "tee ${OUTPUT}/LTP_${LOG_FILE}.out" |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame^] | 202 | parse_ltp_output "${OUTPUT}/LTP_${LOG_FILE}.log" |
| 203 | fi |
Naresh Kamboju | e188053 | 2018-10-02 15:17:34 +0530 | [diff] [blame] | 204 | # check_return "runltp_${LOG_FILE}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 205 | |
Naresh Kamboju | 3a42795 | 2017-07-06 16:56:59 +0530 | [diff] [blame] | 206 | # Cleanup |
Milosz Wasilewski | cacf738 | 2017-11-01 11:25:55 +0000 | [diff] [blame] | 207 | # don't fail the whole test job if rm fails |
| 208 | rm -rf "${LTP_TMPDIR}" || true |
Anders Roxell | 0466d2c | 2022-12-07 10:12:07 +0100 | [diff] [blame] | 209 | rm -rf alltests || true |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 210 | } |
| 211 | |
Dan Rue | a7e86c4 | 2017-11-07 14:55:58 -0600 | [diff] [blame] | 212 | # Prepare system |
| 213 | prep_system() { |
| 214 | # Stop systemd-timesyncd if running |
| 215 | if systemctl is-active systemd-timesyncd 2>/dev/null; then |
| 216 | info_msg "Stopping systemd-timesyncd" |
| 217 | systemctl stop systemd-timesyncd |
| 218 | fi |
Dan Rue | f07393e | 2017-11-13 09:55:43 -0600 | [diff] [blame] | 219 | # userns07 requires kernel.unprivileged_userns_clone |
Shawn Guo | e7f9f1c | 2019-06-12 10:40:47 +0800 | [diff] [blame] | 220 | if [ -f "/proc/sys/kernel/unprivileged_userns_clone" ]; then |
Dan Rue | f07393e | 2017-11-13 09:55:43 -0600 | [diff] [blame] | 221 | info_msg "Enabling kernel.unprivileged_userns_clone" |
| 222 | sysctl -w kernel.unprivileged_userns_clone=1 |
Shawn Guo | e7f9f1c | 2019-06-12 10:40:47 +0800 | [diff] [blame] | 223 | else |
| 224 | info_msg "Kernel has no support of unprivileged_userns_clone" |
Dan Rue | f07393e | 2017-11-13 09:55:43 -0600 | [diff] [blame] | 225 | fi |
Dan Rue | a7e86c4 | 2017-11-07 14:55:58 -0600 | [diff] [blame] | 226 | } |
| 227 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 228 | get_tarfile() { |
| 229 | local test_tarfile="$1" |
| 230 | mkdir "${TEST_DIR}" |
| 231 | pushd "${TEST_DIR}" || exit 1 |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 232 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 233 | wget "${test_tarfile}" |
| 234 | tar --strip-components=1 -Jxf "$(basename "${test_tarfile}")" |
| 235 | popd || exit 1 |
| 236 | } |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 237 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 238 | build_install_tests() { |
| 239 | rm -rf "${LTP_INSTALL_PATH}" |
| 240 | pushd "${TEST_DIR}" || exit 1 |
| 241 | [[ -n "${TEST_GIT_URL}" ]] && make autotools |
| 242 | ./configure |
| 243 | make -j"$(proc)" all |
| 244 | make SKIP_IDCHECK=1 install |
| 245 | popd || exit 1 |
| 246 | } |
| 247 | |
| 248 | install() { |
| 249 | dist= |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 250 | dist_name |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 251 | # shellcheck disable=SC2154 |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 252 | case "${dist}" in |
Nicolas Dechesne | b7e3876 | 2017-01-25 12:07:08 +0100 | [diff] [blame] | 253 | debian|ubuntu) |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 254 | [[ -n "${TEST_GIT_URL}" ]] && pkgs="git" |
| 255 | pkgs="${pkgs} xz-utils flex bison build-essential wget curl net-tools quota genisoimage sudo libaio-dev libattr1-dev libcap-dev expect automake acl autotools-dev autoconf m4 pkgconf" |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 256 | install_deps "${pkgs}" "${SKIP_INSTALL}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 257 | ;; |
Nicolas Dechesne | b7e3876 | 2017-01-25 12:07:08 +0100 | [diff] [blame] | 258 | centos|fedora) |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 259 | [[ -n "${TEST_GIT_URL}" ]] && pkgs="git-core" |
Anders Roxell | 1c0eeb3 | 2022-01-20 12:05:32 +0100 | [diff] [blame] | 260 | pkgs="${pkgs} xz flex bison make automake gcc gcc-c++ kernel-devel wget curl net-tools quota genisoimage sudo libaio-devel libattr-devel libcap-devel m4 expect acl pkgconf" |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 261 | install_deps "${pkgs}" "${SKIP_INSTALL}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 262 | ;; |
| 263 | *) |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 264 | warn_msg "Unsupported distribution: package install skipped" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 265 | esac |
Chase Qi | fee992c | 2017-06-19 17:02:50 +0800 | [diff] [blame] | 266 | |
| 267 | # Check if mkisofs or genisoimage installed for isofs test. |
| 268 | if echo "${TST_CMDFILES}" | grep 'fs'; then |
| 269 | # link mkisofs to genisoimage on distributions that have replaced mkisofs with genisoimage. |
| 270 | if ! which mkisofs; then |
| 271 | if which genisoimage; then |
| 272 | ln -s "$(which genisoimage)" /usr/bin/mkisofs |
| 273 | else |
| 274 | warn_msg "Neither mkisofs nor genisoimage found! Either of them is required by isofs test." |
| 275 | fi |
| 276 | fi |
| 277 | fi |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 278 | } |
Chase Qi | fee992c | 2017-06-19 17:02:50 +0800 | [diff] [blame] | 279 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 280 | # Test run. |
| 281 | ! check_root && error_msg "This script must be run as root" |
| 282 | create_out_dir "${OUTPUT}" |
| 283 | |
| 284 | info_msg "About to run ltp test..." |
| 285 | info_msg "Output directory: ${OUTPUT}" |
| 286 | |
| 287 | if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then |
| 288 | info_msg "${TEST_PROGRAM} installation skipped altogether" |
| 289 | else |
| 290 | install |
| 291 | fi |
| 292 | |
Rémi Duraffort | e7cc8a2 | 2021-01-05 14:04:03 +0100 | [diff] [blame] | 293 | if [ ! -d "${LTP_INSTALL_PATH}" ]; then |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 294 | if [ "${BUILD_FROM_TAR}" = "true" ] || [ "${BUILD_FROM_TAR}" = "True" ]; then |
| 295 | get_tarfile "${TEST_TARFILE}" |
| 296 | elif [ -n "${TEST_GIT_URL}" ]; then |
| 297 | get_test_program "${TEST_GIT_URL}" "${TEST_DIR}" "${LTP_VERSION}" "${TEST_PROGRAM}" |
| 298 | else |
| 299 | error_msg "I'm confused, get me out of here, can't fetch tar or test version." |
| 300 | fi |
| 301 | build_install_tests |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 302 | fi |
Dan Rue | a7e86c4 | 2017-11-07 14:55:58 -0600 | [diff] [blame] | 303 | info_msg "Running prep_system" |
| 304 | prep_system |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 305 | info_msg "Running run_ltp" |
| 306 | run_ltp |