From 2a8358495a3688ab5f4b5f5f701bb9c11c946fa8 Mon Sep 17 00:00:00 2001 From: Ke Zhiming Date: Wed, 23 Dec 2020 10:16:02 +0800 Subject: [PATCH] virttest: tmp dir is fixed as /var/tmp The temporary directory used by the testing framework is fixed as /var/tmp, and mount --bind to the disk filesystem Signed-off-by: Ke Zhiming --- tests/virttest | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/virttest b/tests/virttest index be0e421..7911876 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 -- Gitee