1#!/usr/bin/env bash
2#
3# Copyright (C) 2009 Red Hat, Inc.
4# Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18#
19
20SED=
21for sed in sed gsed; do
22    ($sed --version | grep 'GNU sed') > /dev/null 2>&1
23    if [ "$?" -eq 0 ]; then
24        SED=$sed
25        break
26    fi
27done
28if [ -z "$SED" ]; then
29    echo "$0: GNU sed not found"
30    exit 1
31fi
32
33dd()
34{
35   if [ "$HOSTOS" == "Linux" ]
36   then
37        command dd --help | grep noxfer > /dev/null 2>&1
38
39        if [ "$?" -eq 0 ]
40            then
41                command dd status=noxfer $@
42            else
43                command dd $@
44            fi
45   else
46        command dd $@
47   fi
48}
49
50# poke_file 'test.img' 512 '\xff\xfe'
51poke_file()
52{
53    printf "$3" | dd "of=$1" bs=1 "seek=$2" conv=notrunc &>/dev/null
54}
55
56# peek_file_le 'test.img' 512 2 => 65534
57peek_file_le()
58{
59    local val=0 shift=0 byte
60
61    # coreutils' od --endian is not portable, so manually assemble bytes.
62    for byte in $(od -j"$2" -N"$3" -An -v -tu1 "$1"); do
63        val=$(( val | (byte << shift) ))
64        shift=$((shift + 8))
65    done
66    printf %llu $val
67}
68
69# peek_file_be 'test.img' 512 2 => 65279
70peek_file_be()
71{
72    local val=0 byte
73
74    # coreutils' od --endian is not portable, so manually assemble bytes.
75    for byte in $(od -j"$2" -N"$3" -An -v -tu1 "$1"); do
76        val=$(( (val << 8) | byte ))
77    done
78    printf %llu $val
79}
80
81# peek_file_raw 'test.img' 512 2 => '\xff\xfe'. Do not use if the raw data
82# is likely to contain \0 or trailing \n.
83peek_file_raw()
84{
85    dd if="$1" bs=1 skip="$2" count="$3" status=none
86}
87
88
89if ! . ./common.config
90    then
91    echo "$0: failed to source common.config"
92    exit 1
93fi
94
95# Set the variables to the empty string to turn Valgrind off
96# for specific processes, e.g.
97# $ VALGRIND_QEMU_IO= ./check -qcow2 -valgrind 015
98
99: ${VALGRIND_QEMU_VM=$VALGRIND_QEMU}
100: ${VALGRIND_QEMU_IMG=$VALGRIND_QEMU}
101: ${VALGRIND_QEMU_IO=$VALGRIND_QEMU}
102: ${VALGRIND_QEMU_NBD=$VALGRIND_QEMU}
103: ${VALGRIND_QEMU_VXHS=$VALGRIND_QEMU}
104
105# The Valgrind own parameters may be set with
106# its environment variable VALGRIND_OPTS, e.g.
107# $ VALGRIND_OPTS="--leak-check=yes" ./check -qcow2 -valgrind 015
108
109_qemu_proc_exec()
110{
111    local VALGRIND_LOGFILE="$1"
112    shift
113    if [[ "${VALGRIND_QEMU}" == "y" && "${NO_VALGRIND}" != "y" ]]; then
114        exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$@"
115    else
116        exec "$@"
117    fi
118}
119
120_qemu_proc_valgrind_log()
121{
122    local VALGRIND_LOGFILE="$1"
123    local RETVAL="$2"
124    if [[ "${VALGRIND_QEMU}" == "y" && "${NO_VALGRIND}" != "y" ]]; then
125        if [ $RETVAL == 99 ]; then
126            cat "${VALGRIND_LOGFILE}"
127        fi
128        rm -f "${VALGRIND_LOGFILE}"
129    fi
130}
131
132_qemu_wrapper()
133{
134    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
135    (
136        if [ -n "${QEMU_NEED_PID}" ]; then
137            echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"
138        fi
139        VALGRIND_QEMU="${VALGRIND_QEMU_VM}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
140            "$QEMU_PROG" $QEMU_OPTIONS "$@"
141    )
142    RETVAL=$?
143    _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
144    return $RETVAL
145}
146
147_qemu_img_wrapper()
148{
149    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
150    (
151        VALGRIND_QEMU="${VALGRIND_QEMU_IMG}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
152            "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@"
153    )
154    RETVAL=$?
155    _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
156    return $RETVAL
157}
158
159_qemu_io_wrapper()
160{
161    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
162    local QEMU_IO_ARGS="$QEMU_IO_OPTIONS"
163    if [ "$IMGOPTSSYNTAX" = "true" ]; then
164        QEMU_IO_ARGS="--image-opts $QEMU_IO_ARGS"
165        if [ -n "$IMGKEYSECRET" ]; then
166            QEMU_IO_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IO_ARGS"
167        fi
168    fi
169    (
170        VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
171            "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
172    )
173    RETVAL=$?
174    _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
175    return $RETVAL
176}
177
178_qemu_nbd_wrapper()
179{
180    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
181    (
182        VALGRIND_QEMU="${VALGRIND_QEMU_NBD}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
183            "$QEMU_NBD_PROG" --pid-file="${QEMU_TEST_DIR}/qemu-nbd.pid" \
184             $QEMU_NBD_OPTIONS "$@"
185    )
186    RETVAL=$?
187    _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
188    return $RETVAL
189}
190
191_qemu_vxhs_wrapper()
192{
193    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
194    (
195        echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
196        VALGRIND_QEMU="${VALGRIND_QEMU_VXHS}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
197            "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
198    )
199    RETVAL=$?
200    _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
201    return $RETVAL
202}
203
204# Valgrind bug #409141 https://bugs.kde.org/show_bug.cgi?id=409141
205# Until valgrind 3.16+ is ubiquitous, we must work around a hang in
206# valgrind when issuing sigkill. Disable valgrind for this invocation.
207_NO_VALGRIND()
208{
209    NO_VALGRIND="y" "$@"
210}
211
212export QEMU=_qemu_wrapper
213export QEMU_IMG=_qemu_img_wrapper
214export QEMU_IO=_qemu_io_wrapper
215export QEMU_NBD=_qemu_nbd_wrapper
216export QEMU_VXHS=_qemu_vxhs_wrapper
217
218if [ "$IMGOPTSSYNTAX" = "true" ]; then
219    DRIVER="driver=$IMGFMT"
220    QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS"
221    if [ -n "$IMGKEYSECRET" ]; then
222        QEMU_IMG_EXTRA_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IMG_EXTRA_ARGS"
223    fi
224    if [ "$IMGFMT" = "luks" ]; then
225        DRIVER="$DRIVER,key-secret=keysec0"
226    fi
227    if [ "$IMGPROTO" = "file" ]; then
228        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
229        TEST_IMG="$DRIVER,file.filename=$TEST_DIR/t.$IMGFMT"
230    elif [ "$IMGPROTO" = "nbd" ]; then
231        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
232        TEST_IMG="$DRIVER,file.driver=nbd,file.type=unix"
233        TEST_IMG="$TEST_IMG,file.path=$SOCK_DIR/nbd"
234    elif [ "$IMGPROTO" = "ssh" ]; then
235        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
236        TEST_IMG="$DRIVER,file.driver=ssh,file.host=127.0.0.1,file.path=$TEST_IMG_FILE"
237    elif [ "$IMGPROTO" = "nfs" ]; then
238        TEST_DIR="$DRIVER,file.driver=nfs,file.filename=nfs://127.0.0.1/$TEST_DIR"
239        TEST_IMG=$TEST_DIR/t.$IMGFMT
240    else
241        TEST_IMG="$DRIVER,file.driver=$IMGPROTO,file.filename=$TEST_DIR/t.$IMGFMT"
242    fi
243else
244    QEMU_IMG_EXTRA_ARGS=
245    if [ "$IMGPROTO" = "file" ]; then
246        TEST_IMG=$TEST_DIR/t.$IMGFMT
247    elif [ "$IMGPROTO" = "nbd" ]; then
248        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
249        TEST_IMG="nbd+unix:///?socket=$SOCK_DIR/nbd"
250    elif [ "$IMGPROTO" = "ssh" ]; then
251        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
252        REMOTE_TEST_DIR="ssh://\\($USER@\\)\\?127.0.0.1\\(:[0-9]\\+\\)\\?$TEST_DIR"
253        TEST_IMG="ssh://127.0.0.1$TEST_IMG_FILE"
254    elif [ "$IMGPROTO" = "nfs" ]; then
255        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
256        REMOTE_TEST_DIR="nfs://127.0.0.1$TEST_DIR"
257        TEST_IMG="nfs://127.0.0.1$TEST_IMG_FILE"
258    elif [ "$IMGPROTO" = "vxhs" ]; then
259        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
260        TEST_IMG="vxhs://127.0.0.1:9999/t.$IMGFMT"
261    else
262        TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT
263    fi
264fi
265ORIG_TEST_IMG="$TEST_IMG"
266
267if [ -z "$TEST_DIR" ]; then
268        TEST_DIR=$PWD/scratch
269fi
270
271QEMU_TEST_DIR="${TEST_DIR}"
272
273if [ ! -e "$TEST_DIR" ]; then
274        mkdir "$TEST_DIR"
275fi
276
277if [ ! -d "$TEST_DIR" ]; then
278    echo "common.rc: Error: \$TEST_DIR ($TEST_DIR) is not a directory"
279    exit 1
280fi
281
282if [ -z "$REMOTE_TEST_DIR" ]; then
283    REMOTE_TEST_DIR="$TEST_DIR"
284fi
285
286if [ ! -d "$SAMPLE_IMG_DIR" ]; then
287    echo "common.rc: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a directory"
288    exit 1
289fi
290
291_use_sample_img()
292{
293    SAMPLE_IMG_FILE="${1%\.bz2}"
294    TEST_IMG="$TEST_DIR/$SAMPLE_IMG_FILE"
295    bzcat "$SAMPLE_IMG_DIR/$1" > "$TEST_IMG"
296    if [ $? -ne 0 ]
297    then
298        echo "_use_sample_img error, cannot extract '$SAMPLE_IMG_DIR/$1'"
299        exit 1
300    fi
301}
302
303_stop_nbd_server()
304{
305    if [ -f "${QEMU_TEST_DIR}/qemu-nbd.pid" ]; then
306        local QEMU_NBD_PID
307        read QEMU_NBD_PID < "${QEMU_TEST_DIR}/qemu-nbd.pid"
308        kill ${QEMU_NBD_PID}
309        rm -f "${QEMU_TEST_DIR}/qemu-nbd.pid" "$SOCK_DIR/nbd"
310    fi
311}
312
313_make_test_img()
314{
315    # extra qemu-img options can be added by tests
316    # at least one argument (the image size) needs to be added
317    local extra_img_options=""
318    local image_size=$*
319    local optstr=""
320    local img_name=""
321    local use_backing=0
322    local backing_file=""
323    local object_options=""
324
325    if [ -n "$TEST_IMG_FILE" ]; then
326        img_name=$TEST_IMG_FILE
327    else
328        img_name=$TEST_IMG
329    fi
330
331    if [ -n "$IMGOPTS" ]; then
332        optstr=$(_optstr_add "$optstr" "$IMGOPTS")
333    fi
334    if [ -n "$IMGKEYSECRET" ]; then
335        object_options="--object secret,id=keysec0,data=$IMGKEYSECRET"
336        optstr=$(_optstr_add "$optstr" "key-secret=keysec0")
337    fi
338
339    if [ "$1" = "-b" ]; then
340        use_backing=1
341        backing_file=$2
342        image_size=$3
343    fi
344    if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE" ]; then
345        optstr=$(_optstr_add "$optstr" "cluster_size=$CLUSTER_SIZE")
346    fi
347
348    if [ -n "$optstr" ]; then
349        extra_img_options="-o $optstr $extra_img_options"
350    fi
351
352    if [ $IMGPROTO = "nbd" ]; then
353        _stop_nbd_server
354    fi
355
356    # XXX(hch): have global image options?
357    (
358     if [ $use_backing = 1 ]; then
359        $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options -b "$backing_file" "$img_name" $image_size 2>&1
360     else
361        $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options "$img_name" $image_size 2>&1
362     fi
363    ) | _filter_img_create
364
365    # Start an NBD server on the image file, which is what we'll be talking to.
366    # Once NBD gains resize support, we may also want to use -f raw at the
367    # server and interpret format over NBD, but for now, the format is
368    # interpreted at the server and raw data sent over NBD.
369    if [ $IMGPROTO = "nbd" ]; then
370        # Pass a sufficiently high number to -e that should be enough for all
371        # tests
372        eval "$QEMU_NBD -v -t -k '$SOCK_DIR/nbd' -f $IMGFMT -e 42 -x '' $TEST_IMG_FILE >/dev/null &"
373        sleep 1 # FIXME: qemu-nbd needs to be listening before we continue
374    fi
375
376    # Start QNIO server on image directory for vxhs protocol
377    if [ $IMGPROTO = "vxhs" ]; then
378        eval "$QEMU_VXHS -d  $TEST_DIR > /dev/null &"
379        sleep 1 # Wait for server to come up.
380    fi
381}
382
383_rm_test_img()
384{
385    local img=$1
386    if [ "$IMGFMT" = "vmdk" ]; then
387        # Remove all the extents for vmdk
388        "$QEMU_IMG" info "$img" 2>/dev/null | grep 'filename:' | cut -f 2 -d: \
389            | xargs -I {} rm -f "{}"
390    fi
391    rm -f "$img"
392}
393
394_cleanup_test_img()
395{
396    case "$IMGPROTO" in
397
398        nbd)
399            _stop_nbd_server
400            rm -f "$TEST_IMG_FILE"
401            ;;
402        vxhs)
403            if [ -f "${TEST_DIR}/qemu-vxhs.pid" ]; then
404                local QEMU_VXHS_PID
405                read QEMU_VXHS_PID < "${TEST_DIR}/qemu-vxhs.pid"
406                kill ${QEMU_VXHS_PID} >/dev/null 2>&1
407                rm -f "${TEST_DIR}/qemu-vxhs.pid"
408            fi
409            rm -f "$TEST_IMG_FILE"
410            ;;
411
412        file)
413            _rm_test_img "$TEST_DIR/t.$IMGFMT"
414            _rm_test_img "$TEST_DIR/t.$IMGFMT.orig"
415            _rm_test_img "$TEST_DIR/t.$IMGFMT.base"
416            if [ -n "$SAMPLE_IMG_FILE" ]
417            then
418                rm -f "$TEST_DIR/$SAMPLE_IMG_FILE"
419                SAMPLE_IMG_FILE=
420                TEST_IMG="$ORIG_TEST_IMG"
421            fi
422            ;;
423
424        rbd)
425            rbd --no-progress rm "$TEST_DIR/t.$IMGFMT" > /dev/null
426            ;;
427
428        sheepdog)
429            collie vdi delete "$TEST_DIR/t.$IMGFMT"
430            ;;
431
432    esac
433}
434
435_check_test_img()
436{
437    (
438        if [ "$IMGOPTSSYNTAX" = "true" ]; then
439            $QEMU_IMG check $QEMU_IMG_EXTRA_ARGS "$@" "$TEST_IMG" 2>&1
440        else
441            $QEMU_IMG check "$@" -f $IMGFMT "$TEST_IMG" 2>&1
442        fi
443    ) | _filter_testdir | _filter_qemu_img_check
444
445    # return real qemu_img check status, to analyze in
446    # _check_test_img_ignore_leaks
447    return ${PIPESTATUS[0]}
448}
449
450_check_test_img_ignore_leaks()
451{
452    out=$(_check_test_img "$@")
453    status=$?
454    if [ $status = 3 ]; then
455        # This must correspond to success output in dump_human_image_check()
456        echo "No errors were found on the image."
457        return 0
458    fi
459    echo "$out"
460    return $status
461}
462
463_img_info()
464{
465    if [[ "$1" == "--format-specific" ]]; then
466        local format_specific=1
467        shift
468    else
469        local format_specific=0
470    fi
471
472    discard=0
473    regex_json_spec_start='^ *"format-specific": \{'
474    $QEMU_IMG info $QEMU_IMG_EXTRA_ARGS "$@" "$TEST_IMG" 2>&1 | \
475        sed -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
476            -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
477            -e "s#$TEST_DIR#TEST_DIR#g" \
478            -e "s#$IMGFMT#IMGFMT#g" \
479            -e "/^disk size:/ D" \
480            -e "/actual-size/ D" | \
481        while IFS='' read -r line; do
482            if [[ $format_specific == 1 ]]; then
483                discard=0
484            elif [[ $line == "Format specific information:" ]]; then
485                discard=1
486            elif [[ $line =~ $regex_json_spec_start ]]; then
487                discard=2
488                regex_json_spec_end="^${line%%[^ ]*}\\},? *$"
489            fi
490            if [[ $discard == 0 ]]; then
491                echo "$line"
492            elif [[ $discard == 1 && ! $line ]]; then
493                echo
494                discard=0
495            elif [[ $discard == 2 && $line =~ $regex_json_spec_end ]]; then
496                discard=0
497            fi
498        done
499}
500
501# bail out, setting up .notrun file
502#
503_notrun()
504{
505    echo "$*" >"$OUTPUT_DIR/$seq.notrun"
506    echo "$seq not run: $*"
507    status=0
508    exit
509}
510
511# bail out, setting up .casenotrun file
512# The function _casenotrun() is used as a notifier. It is the
513# caller's responsibility to make skipped a particular test.
514#
515_casenotrun()
516{
517    echo "    [case not run] $*" >>"$OUTPUT_DIR/$seq.casenotrun"
518}
519
520# just plain bail out
521#
522_fail()
523{
524    echo "$*" | tee -a "$OUTPUT_DIR/$seq.full"
525    echo "(see $seq.full for details)"
526    status=1
527    exit 1
528}
529
530# tests whether $IMGFMT is one of the supported image formats for a test
531#
532_supported_fmt()
533{
534    # "generic" is suitable for most image formats. For some formats it doesn't
535    # work, however (most notably read-only formats), so they can opt out by
536    # setting IMGFMT_GENERIC to false.
537    for f; do
538        if [ "$f" = "$IMGFMT" -o "$f" = "generic" -a "$IMGFMT_GENERIC" = "true" ]; then
539            return
540        fi
541    done
542
543    _notrun "not suitable for this image format: $IMGFMT"
544}
545
546# tests whether $IMGFMT is one of the unsupported image format for a test
547#
548_unsupported_fmt()
549{
550    for f; do
551        if [ "$f" = "$IMGFMT" ]; then
552            _notrun "not suitable for this image format: $IMGFMT"
553        fi
554    done
555}
556
557# tests whether $IMGPROTO is one of the supported image protocols for a test
558#
559_supported_proto()
560{
561    for f; do
562        if [ "$f" = "$IMGPROTO" -o "$f" = "generic" ]; then
563            return
564        fi
565    done
566
567    _notrun "not suitable for this image protocol: $IMGPROTO"
568}
569
570# tests whether $IMGPROTO is specified as an unsupported image protocol for a test
571#
572_unsupported_proto()
573{
574    for f; do
575        if [ "$f" = "$IMGPROTO" ]; then
576            _notrun "not suitable for this image protocol: $IMGPROTO"
577            return
578        fi
579    done
580}
581
582# tests whether the host OS is one of the supported OSes for a test
583#
584_supported_os()
585{
586    for h
587    do
588        if [ "$h" = "$HOSTOS" ]
589        then
590            return
591        fi
592    done
593
594    _notrun "not suitable for this OS: $HOSTOS"
595}
596
597_supported_cache_modes()
598{
599    for mode; do
600        if [ "$mode" = "$CACHEMODE" ]; then
601            return
602        fi
603    done
604    _notrun "not suitable for cache mode: $CACHEMODE"
605}
606
607_default_cache_mode()
608{
609    if $CACHEMODE_IS_DEFAULT; then
610        CACHEMODE="$1"
611        QEMU_IO="$QEMU_IO --cache $1"
612        return
613    fi
614}
615
616_unsupported_imgopts()
617{
618    for bad_opt
619    do
620        if echo "$IMGOPTS" | grep -q 2>/dev/null "$bad_opt"
621        then
622            _notrun "not suitable for image option: $bad_opt"
623        fi
624    done
625}
626
627# this test requires that a specified command (executable) exists
628#
629_require_command()
630{
631    if [ "$1" = "QEMU" ]; then
632        c=$QEMU_PROG
633    elif [ "$1" = "QEMU_IMG" ]; then
634        c=$QEMU_IMG_PROG
635    elif [ "$1" = "QEMU_IO" ]; then
636        c=$QEMU_IO_PROG
637    elif [ "$1" = "QEMU_NBD" ]; then
638        c=$QEMU_NBD_PROG
639    else
640        eval c=\$$1
641    fi
642    [ -x "$c" ] || _notrun "$1 utility required, skipped this test"
643}
644
645# Check that a set of drivers has been whitelisted in the QEMU binary
646#
647_require_drivers()
648{
649    available=$($QEMU -drive format=help | \
650                sed -e '/Supported formats:/!d' -e 's/Supported formats://')
651    for driver
652    do
653        if ! echo "$available" | grep -q " $driver\( \|$\)"; then
654            _notrun "$driver not available"
655        fi
656    done
657}
658
659# make sure this script returns success
660true
661