Skip to content

Commit

Permalink
Add a custom validate function for raid-ddf test case
Browse files Browse the repository at this point in the history
The default validate uses virt-copy-out which doesn't work with
RAIDs.
  • Loading branch information
vojtechtrefny committed Feb 22, 2024
1 parent cba7016 commit c6bd379
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions raid-ddf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,21 @@ additional_runner_args() {
echo "--wait $(get_timeout)"
}

validate() {
disksdir=$1
args=$(for d in ${disksdir}/disk-*img; do echo -a ${d}; done)

# There should be a /root/RESULT file with results in it. Check
# its contents and decide whether the test finally succeeded or
# not.
result=$(run_with_timeout ${COPY_FROM_IMAGE_TIMEOUT} "virt-cat ${args} -m /dev/disk/by-label/rootfs /root/RESULT")
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
status=1
echo "${result}"
fi

return ${status}
}

0 comments on commit c6bd379

Please sign in to comment.