提交 787905ce 编写于 作者: X Xueqiang Wei

mkfs: update old fs to new one

Signed-off-by: NXueqiang Wei <xuwei@redhat.com>
上级 6a51113c
......@@ -17,6 +17,9 @@
post_command_noncritical = no
clean = no
check_mount = "mountpoint /mnt/kvm_test_lvm"
fs_type = xfs
RHEL.6:
fs_type = ext4
variants:
- lvm_create:
sub_type = lvm_create
......
......@@ -7,7 +7,7 @@ from virttest import utils_test
@error_context.context_aware
def mount_lv(lv_path, session):
error_context.context("mounting ext3 filesystem made on logical volume %s"
error_context.context("mounting filesystem made on logical volume %s"
% os.path.basename(lv_path), logging.info)
session.cmd("mkdir -p /mnt/kvm_test_lvm")
session.cmd("mount %s /mnt/kvm_test_lvm" % lv_path)
......@@ -15,7 +15,7 @@ def mount_lv(lv_path, session):
@error_context.context_aware
def umount_lv(lv_path, session):
error_context.context("umounting ext3 filesystem made on logical volume "
error_context.context("umounting filesystem made on logical volume "
"%s" % os.path.basename(lv_path), logging.info)
session.cmd("umount %s" % lv_path)
session.cmd("rm -rf /mnt/kvm_test_lvm")
......@@ -57,6 +57,7 @@ def run(test, params, env):
timeout = params.get("lvm_timeout", "600")
check_mount = params.get("check_mount", "mountpoint /mnt/kvm_test_lvm")
sub_type = params.get("sub_type", "lvm_create")
fs_type = params.get("fs_type", "ext4")
try:
if sub_type == "lvm_create":
disk_list = []
......@@ -79,13 +80,13 @@ def run(test, params, env):
error_context.context("creating logical volume on volume group %s"
% vg_name, logging.info)
session.cmd("lvcreate -L2000 -n %s %s" % (lv_name, vg_name))
error_context.context("creating ext3 filesystem on logical volume"
" %s" % lv_name, logging.info)
session.cmd("yes | mkfs.ext3 %s" % lv_path, timeout=int(timeout))
error_context.context("creating %s filesystem on logical volume"
" %s" % (fs_type, lv_name), logging.info)
session.cmd("yes | mkfs.%s %s" % (fs_type, lv_path), timeout=int(timeout))
mount_lv(lv_path, session)
umount_lv(lv_path, session)
error_context.context("checking ext3 filesystem made on logical "
"volume %s" % lv_name, logging.info)
error_context.context("checking %s filesystem made on logical "
"volume %s" % (fs_type, lv_name), logging.info)
session.cmd("fsck %s" % lv_path, timeout=int(timeout))
if clean == "no":
mount_lv(lv_path, session)
......
......@@ -74,7 +74,10 @@
src_file = "%s/%s"
dst_file = "${tmp_dir}/%s"
tray_check_cmd = "python ${tray_check_src} %s"
readonly_test_cmd = "echo y|mkfs.ext2 %s"
fs_type = xfs
RHEL.6:
fs_type = ext4
readonly_test_cmd = "echo y|mkfs.${fs_type} %s"
lock_cdrom_cmd = "eject -i on %s"
unlock_cdrom_cmd = "eject -i off %s"
eject_cdrom_cmd = "eject %s"
......
......@@ -13,11 +13,14 @@
cmd_timeout = 1200
# The following parameters will be overriden in guest-os config files.
create_partition_cmd = ""
format_cmd = "yes | mkfs.ext3 {0}"
fs_type = xfs
RHEL.6:
fs_type = ext4
format_cmd = "yes | mkfs.${fs_type} {0}"
list_disk_cmd = ""
set_online_cmd = ""
show_dev_cmd = "ls {0}"
mount_cmd = "mkdir -p /media && mount -t ext3 {0} /media"
mount_cmd = "mkdir -p /media && mount -t ${fs_type} {0} /media"
show_mount_cmd = "mount | grep {0}"
umount_cmd = "umount {0}"
testfile_name = "/media/format_disk-test.txt"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册