diff --git a/tests/virttest b/tests/virttest index be0e421daf423a75dd1714c0b1b62cdbd879d08d..7911876f8cd023510fe62505cc9fb31ad2dffd85 100755 --- a/tests/virttest +++ b/tests/virttest @@ -292,13 +292,21 @@ done ok=0 all=0 -# image file system config -if [ $os_mount == "cifs" -o $os_mount == "nfs" -o $os_mount == "initramfs" ]; then - mount /dev/sdb ${images_path} || echo y | mkfs.ext4 /dev/sdb && mount /dev/sdb ${images_path} +# config tmp dir +config_tmpdir() { + umount /var/tmp > /dev/null 2>&1 rm -rf ${images_path:?}/tmp mkdir -p ${images_path}/tmp + [ -d /var/tmp ] || mkdir -p /var/tmp + export TMP="/var/tmp" mount --bind ${images_path}/tmp /var/tmp +} + +# image file system config +if [ $os_mount == "cifs" -o $os_mount == "nfs" -o $os_mount == "initramfs" ]; then + mount /dev/sdb ${images_path} || echo y | mkfs.ext4 /dev/sdb && mount /dev/sdb ${images_path} fi +config_tmpdir # download images images_download