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}" |
Antonio Terceiro | aac60d9 | 2025-03-10 16:44:48 -0300 | [diff] [blame^] | 166 | for test_fqn in $(jq -r '.results| .[]| .test_fqn' "$1"); do |
| 167 | jq -r '.results | .[] | select(.test_fqn == "'"${test_fqn}"'") | .test.log' "$1" > ${OUTPUT}/${test_fqn}.log |
| 168 | done |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame] | 169 | } |
| 170 | |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 171 | # Run LTP test suite |
| 172 | run_ltp() { |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 173 | # shellcheck disable=SC2164 |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 174 | cd "${LTP_INSTALL_PATH}" |
Naresh Kamboju | ff5f6c3 | 2017-07-11 14:50:32 +0530 | [diff] [blame] | 175 | # shellcheck disable=SC2174 |
| 176 | mkdir -m 777 -p "${LTP_TMPDIR}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 177 | |
Anders Roxell | a384c31 | 2022-10-25 09:02:44 +0200 | [diff] [blame] | 178 | for file in ${TST_CMDFILES//,/ }; do |
| 179 | cat runtest/"${file}" >>alltests |
| 180 | done |
| 181 | sed -i 's/#.*$//;/^$/d' alltests |
| 182 | split --verbose --numeric-suffixes=1 -n l/"${SHARD_INDEX}"/"${SHARD_NUMBER}" alltests >runtest/shardfile |
| 183 | echo "============== Tests to run ===============" |
| 184 | cat runtest/shardfile |
| 185 | echo "===========End Tests to run ===============" |
| 186 | |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame] | 187 | if [ -n "${RUNNER}" ]; then |
| 188 | eval "${RUNNER}" --version |
| 189 | # shellcheck disable=SC2181 |
| 190 | if [ $? -ne "0" ]; then |
| 191 | error_msg "${RUNNER} is not installed into the file system." |
| 192 | fi |
| 193 | pipe0_status "${RUNNER} --framework ltp --run-suite shardfile \ |
| 194 | -d ${LTP_TMPDIR} --env LTP_COLORIZE_OUTPUT=0 \ |
Antonio Terceiro | a131279 | 2025-03-07 15:00:15 -0300 | [diff] [blame] | 195 | ${SKIPFILE_PATH:+--skip-file} ${SKIPFILE_PATH} \ |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame] | 196 | --json-report /tmp/kirk-report.json \ |
| 197 | --verbose" "tee ${OUTPUT}/LTP_${LOG_FILE}.out" |
| 198 | parse_ltp_json_results "/tmp/kirk-report.json" |
Anders Roxell | 48fa901 | 2025-02-27 14:32:28 +0100 | [diff] [blame] | 199 | rm "/tmp/kirk-report.json" |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame] | 200 | else |
| 201 | pipe0_status "./runltp -p -q -f shardfile \ |
Naresh Kamboju | 3a42795 | 2017-07-06 16:56:59 +0530 | [diff] [blame] | 202 | -l ${OUTPUT}/LTP_${LOG_FILE}.log \ |
| 203 | -C ${OUTPUT}/LTP_${LOG_FILE}.failed \ |
| 204 | -d ${LTP_TMPDIR} \ |
| 205 | ${SKIPFILE}" "tee ${OUTPUT}/LTP_${LOG_FILE}.out" |
Anders Roxell | 1e4165f | 2024-06-12 14:45:20 +0200 | [diff] [blame] | 206 | parse_ltp_output "${OUTPUT}/LTP_${LOG_FILE}.log" |
| 207 | fi |
Naresh Kamboju | e188053 | 2018-10-02 15:17:34 +0530 | [diff] [blame] | 208 | # check_return "runltp_${LOG_FILE}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 209 | |
Naresh Kamboju | 3a42795 | 2017-07-06 16:56:59 +0530 | [diff] [blame] | 210 | # Cleanup |
Milosz Wasilewski | cacf738 | 2017-11-01 11:25:55 +0000 | [diff] [blame] | 211 | # don't fail the whole test job if rm fails |
| 212 | rm -rf "${LTP_TMPDIR}" || true |
Anders Roxell | 0466d2c | 2022-12-07 10:12:07 +0100 | [diff] [blame] | 213 | rm -rf alltests || true |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 214 | } |
| 215 | |
Dan Rue | a7e86c4 | 2017-11-07 14:55:58 -0600 | [diff] [blame] | 216 | # Prepare system |
| 217 | prep_system() { |
| 218 | # Stop systemd-timesyncd if running |
| 219 | if systemctl is-active systemd-timesyncd 2>/dev/null; then |
| 220 | info_msg "Stopping systemd-timesyncd" |
| 221 | systemctl stop systemd-timesyncd |
| 222 | fi |
Dan Rue | f07393e | 2017-11-13 09:55:43 -0600 | [diff] [blame] | 223 | # userns07 requires kernel.unprivileged_userns_clone |
Shawn Guo | e7f9f1c | 2019-06-12 10:40:47 +0800 | [diff] [blame] | 224 | if [ -f "/proc/sys/kernel/unprivileged_userns_clone" ]; then |
Dan Rue | f07393e | 2017-11-13 09:55:43 -0600 | [diff] [blame] | 225 | info_msg "Enabling kernel.unprivileged_userns_clone" |
| 226 | sysctl -w kernel.unprivileged_userns_clone=1 |
Shawn Guo | e7f9f1c | 2019-06-12 10:40:47 +0800 | [diff] [blame] | 227 | else |
| 228 | info_msg "Kernel has no support of unprivileged_userns_clone" |
Dan Rue | f07393e | 2017-11-13 09:55:43 -0600 | [diff] [blame] | 229 | fi |
Dan Rue | a7e86c4 | 2017-11-07 14:55:58 -0600 | [diff] [blame] | 230 | } |
| 231 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 232 | get_tarfile() { |
| 233 | local test_tarfile="$1" |
| 234 | mkdir "${TEST_DIR}" |
| 235 | pushd "${TEST_DIR}" || exit 1 |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 236 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 237 | wget "${test_tarfile}" |
| 238 | tar --strip-components=1 -Jxf "$(basename "${test_tarfile}")" |
| 239 | popd || exit 1 |
| 240 | } |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 241 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 242 | build_install_tests() { |
| 243 | rm -rf "${LTP_INSTALL_PATH}" |
| 244 | pushd "${TEST_DIR}" || exit 1 |
| 245 | [[ -n "${TEST_GIT_URL}" ]] && make autotools |
| 246 | ./configure |
| 247 | make -j"$(proc)" all |
| 248 | make SKIP_IDCHECK=1 install |
| 249 | popd || exit 1 |
| 250 | } |
| 251 | |
| 252 | install() { |
| 253 | dist= |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 254 | dist_name |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 255 | # shellcheck disable=SC2154 |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 256 | case "${dist}" in |
Nicolas Dechesne | b7e3876 | 2017-01-25 12:07:08 +0100 | [diff] [blame] | 257 | debian|ubuntu) |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 258 | [[ -n "${TEST_GIT_URL}" ]] && pkgs="git" |
| 259 | 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] | 260 | install_deps "${pkgs}" "${SKIP_INSTALL}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 261 | ;; |
Nicolas Dechesne | b7e3876 | 2017-01-25 12:07:08 +0100 | [diff] [blame] | 262 | centos|fedora) |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 263 | [[ -n "${TEST_GIT_URL}" ]] && pkgs="git-core" |
Anders Roxell | 1c0eeb3 | 2022-01-20 12:05:32 +0100 | [diff] [blame] | 264 | 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] | 265 | install_deps "${pkgs}" "${SKIP_INSTALL}" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 266 | ;; |
| 267 | *) |
Naresh Kamboju | 43e8074 | 2017-01-18 15:51:02 +0530 | [diff] [blame] | 268 | warn_msg "Unsupported distribution: package install skipped" |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 269 | esac |
Chase Qi | fee992c | 2017-06-19 17:02:50 +0800 | [diff] [blame] | 270 | |
| 271 | # Check if mkisofs or genisoimage installed for isofs test. |
| 272 | if echo "${TST_CMDFILES}" | grep 'fs'; then |
| 273 | # link mkisofs to genisoimage on distributions that have replaced mkisofs with genisoimage. |
| 274 | if ! which mkisofs; then |
| 275 | if which genisoimage; then |
| 276 | ln -s "$(which genisoimage)" /usr/bin/mkisofs |
| 277 | else |
| 278 | warn_msg "Neither mkisofs nor genisoimage found! Either of them is required by isofs test." |
| 279 | fi |
| 280 | fi |
| 281 | fi |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 282 | } |
Chase Qi | fee992c | 2017-06-19 17:02:50 +0800 | [diff] [blame] | 283 | |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 284 | # Test run. |
| 285 | ! check_root && error_msg "This script must be run as root" |
| 286 | create_out_dir "${OUTPUT}" |
| 287 | |
| 288 | info_msg "About to run ltp test..." |
| 289 | info_msg "Output directory: ${OUTPUT}" |
| 290 | |
| 291 | if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then |
| 292 | info_msg "${TEST_PROGRAM} installation skipped altogether" |
| 293 | else |
| 294 | install |
| 295 | fi |
| 296 | |
Rémi Duraffort | e7cc8a2 | 2021-01-05 14:04:03 +0100 | [diff] [blame] | 297 | if [ ! -d "${LTP_INSTALL_PATH}" ]; then |
Anders Roxell | 67acee6 | 2020-10-21 08:52:24 +0200 | [diff] [blame] | 298 | if [ "${BUILD_FROM_TAR}" = "true" ] || [ "${BUILD_FROM_TAR}" = "True" ]; then |
| 299 | get_tarfile "${TEST_TARFILE}" |
| 300 | elif [ -n "${TEST_GIT_URL}" ]; then |
| 301 | get_test_program "${TEST_GIT_URL}" "${TEST_DIR}" "${LTP_VERSION}" "${TEST_PROGRAM}" |
| 302 | else |
| 303 | error_msg "I'm confused, get me out of here, can't fetch tar or test version." |
| 304 | fi |
| 305 | build_install_tests |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 306 | fi |
Dan Rue | a7e86c4 | 2017-11-07 14:55:58 -0600 | [diff] [blame] | 307 | info_msg "Running prep_system" |
| 308 | prep_system |
Naresh Kamboju | ad19d88 | 2016-09-20 19:31:00 +0530 | [diff] [blame] | 309 | info_msg "Running run_ltp" |
| 310 | run_ltp |