def METHOD_NAME(test, vm, params):
    """
    1) Write a file to oldvm
    2) Resize the olddisk to a newdisk
    3) Check file's md5 in newvm
    """
    # Create a file to oldvm with guestfish
    content = "This is file for resized vm."
    path = params.get("temp_file", "/home/test_resized_vm")
    resize_part_num = params.get("resize_part_num", "2")
    resized_size = params.get("resized_size", "+1G")
    increased_size = params.get("increased_size", "+10G")
    vt = utils_test.libguestfs.VirtTools(vm, params)
    params['libvirt_domain'] = vt.oldvm.name
    params['gf_inspector'] = True
    gf = utils_test.libguestfs.GuestfishTools(params)
    old_disk_size = gf.get_part_size(resize_part_num)
    if old_disk_size is None:
        gf.close_session()
        test.fail("Get part %s size failed." % resize_part_num)
    else:
        old_disk_size = int(old_disk_size)
    if gf.write_file(path, content) is False:
        gf.close_session()
        test.fail("Create file failed.")
    md5s, md5o = gf.get_md5(path)
    if md5s is False:
        gf.close_session()
        test.fail(md5o)
    gf.close_session()
    md5_old = md5o.strip()
    logging.debug("%s's md5 in oldvm is:%s", path, md5_old)
    # Create a new file with 2G bigger than old vm's disk
    if vt.indisk is None:
        test.fail("No disk found for %s" % vt.oldvm.name)
    vt.outdisk = "%s-resize" % vt.indisk
    truncate_from_file(vt.indisk, vt.outdisk, increased_size)
    resizes, resizeo = vt.expand_vm_filesystem(resize_part_num,
                                               resized_size)
    if resizes is False:
        utils_test.libguestfs.cleanup_vm(disk=vt.outdisk)
        test.fail(resizeo)
    params['disk_img'] = vt.outdisk
    params['libvirt_domain'] = None
    params['gf_inspector'] = True
    gf = utils_test.libguestfs.GuestfishTools(params)
    # Check disk's size
    new_disk_size = gf.get_part_size(resize_part_num)
    if new_disk_size is None:
        gf.close_session()
        utils_test.libguestfs.cleanup_vm(disk=vt.outdisk)
        test.fail("Get part %s size failed." % resize_part_num)
    else:
        new_disk_size = int(new_disk_size)
    real_increased_size = abs(new_disk_size - old_disk_size)
    delta = (real_increased_size - 2147483648) / 2147483648
    if delta > 0.1:
        gf.close_session()
        utils_test.libguestfs.cleanup_vm(disk=vt.outdisk)
        test.fail("Disk size is not increased to expected value:\n"
                  "Original:%s\n"
                  "New:%s" % (old_disk_size, new_disk_size))
    # Check file's md5 after resize
    md5s, md5o = gf.get_md5(path)
    if md5s is False:
        gf.close_session()
        utils_test.libguestfs.cleanup_vm(disk=vt.outdisk)
        test.fail(md5o)
    gf.close_session()
    md5_new = md5o.strip()
    logging.debug("%s's md5 in newvm is:%s", path, md5_new)
    if md5_old != md5_new:
        utils_test.libguestfs.cleanup_vm(disk=vt.outdisk)
        test.fail("Md5 of new vm is not match with old one.")
    utils_test.libguestfs.cleanup_vm(disk=vt.outdisk)