Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 18 additions & 35 deletions automated/linux/ltp/ltp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ BUILD_FROM_TAR="false"
SHARD_NUMBER=1
SHARD_INDEX=1

RUNNER=""
RUNNER="kirk"
KIRK_WORKERS=1
EXTRA_KIRK_ARGS=""

Expand All @@ -50,7 +50,7 @@ usage() {
[-v LTP_VERSION]
[-M Timeout_Multiplier]
[-R root_password]
[-r new runner (kirk)]
[-r runner (kirk)]
[-u git url]
[-p build directory]
[-t build from tarfile ]
Expand Down Expand Up @@ -162,13 +162,6 @@ if [ -n "${SKIPFILE_YAML}" ]; then
SKIPFILE="-S ${SKIPFILE_PATH}"
fi

# Parse LTP output
parse_ltp_output() {
grep -E "PASS|FAIL|CONF" "$1" \
| awk '{print $1" "$2}' \
| sed 's/PASS/pass/; s/FAIL/fail/; s/CONF/skip/' >> "${RESULT_FILE}"
}

parse_ltp_json_results() {
jq -r '.results| .[]| "\(.test_fqn) \(.test.result)"' "$1" \
| sed 's/brok/fail/; s/conf/skip/' >> "${RESULT_FILE}"
Expand All @@ -193,33 +186,23 @@ run_ltp() {
cat runtest/shardfile
echo "===========End Tests to run ==============="

if [ -n "${RUNNER}" ]; then
eval "${RUNNER}" --version
# shellcheck disable=SC2181
if [ $? -ne "0" ]; then
error_msg "${RUNNER} is not installed into the file system."
fi
if [ "${KIRK_WORKERS}" = "max" ]; then
KIRK_WORKERS=$(grep ^processor /proc/cpuinfo | wc -l)
fi
pipe0_status "${RUNNER} ${EXTRA_KIRK_ARGS} --framework ltp --run-suite shardfile \
-d ${LTP_TMPDIR} --env LTP_COLORIZE_OUTPUT=0 \
${SKIPFILE_PATH:+--skip-file} ${SKIPFILE_PATH} \
${KIRK_WORKERS:+--workers} ${KIRK_WORKERS} \
--no-colors \
--json-report /tmp/kirk-report.json" \
"tee ${OUTPUT}/LTP_${LOG_FILE}.out"
parse_ltp_json_results "/tmp/kirk-report.json"
rm "/tmp/kirk-report.json"
else
pipe0_status "./runltp -p -q -f shardfile \
-l ${OUTPUT}/LTP_${LOG_FILE}.log \
-C ${OUTPUT}/LTP_${LOG_FILE}.failed \
-d ${LTP_TMPDIR} \
${SKIPFILE}" "tee ${OUTPUT}/LTP_${LOG_FILE}.out"
parse_ltp_output "${OUTPUT}/LTP_${LOG_FILE}.log"
eval "${RUNNER}" --version
# shellcheck disable=SC2181
if [ $? -ne "0" ]; then
error_msg "${RUNNER} is not installed into the file system."
fi
if [ "${KIRK_WORKERS}" = "max" ]; then
KIRK_WORKERS=$(grep ^processor /proc/cpuinfo | wc -l)
fi
# check_return "runltp_${LOG_FILE}"
pipe0_status "${RUNNER} ${EXTRA_KIRK_ARGS} --framework ltp --run-suite shardfile \
-d ${LTP_TMPDIR} --env LTP_COLORIZE_OUTPUT=0 \
${SKIPFILE_PATH:+--skip-file} ${SKIPFILE_PATH} \
${KIRK_WORKERS:+--workers} ${KIRK_WORKERS} \
--no-colors \
--json-report /tmp/kirk-report.json" \
"tee ${OUTPUT}/LTP_${LOG_FILE}.out"
parse_ltp_json_results "/tmp/kirk-report.json"
rm "/tmp/kirk-report.json"

# Cleanup
# don't fail the whole test job if rm fails
Expand Down
8 changes: 4 additions & 4 deletions automated/linux/ltp/ltp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ params:
# root's password. Needed by ltp/su01.
ROOT_PASSWD: root

# New kirk runner (https://github.com/linux-test-project/kirk.git)
# Kirk runner (https://github.com/linux-test-project/kirk.git)
# Needs to be installed onto the rootfs.
# Set RUNNER to full path to kirk or to kirk if its in the PATH.
RUNNER: ""
# Set RUNNER to full path to kirk or to kirk if it's in the PATH.
RUNNER: "kirk"

# Number of parallel test workers to use with the new KIRK runner.
# Number of parallel test workers to use with kirk.
# # Tests can now run concurrently by specifying '--workers X'.
KIRK_WORKERS: 1

Expand Down
Loading