def METHOD_NAME(test, params, env):
    """
    Run tests with disk target configurations
    """
    libvirt_version.is_libvirt_feature_supported(params)
    vm_name = params.get("main_vm")
    vm = env.get_vm(vm_name)
    at_dt = params.get('at_dt')
    cmds_in_guest = eval(params.get('cmds_in_guest'))
    target_rotation = params.get('target_rotation')
    to_file_xml = os.path.join(data_dir.get_tmp_dir(), "detach_disk.xml")
    backup_xml = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name)
    try:
        if not at_dt:
            libvirt.set_vm_disk(vm, params)
        if not vm.is_alive():
            vm.start()
        logging.debug(vm_xml.VMXML.new_from_dumpxml(vm_name))
        vm_session = vm.wait_for_login()
        pkg_list = params.get("install_pkgs")
        if pkg_list:
            install_pkg(test, eval(pkg_list), vm_session)
        if at_dt:
            old_parts = utils_disk.get_parts_list(vm_session)
            disk_xml = create_second_disk(params, to_file_xml)
            virsh.attach_device(vm_name, disk_xml, debug=True, ignore_status=False)
            pat_in_dumpxml = params.get('pattern_in_dumpxml')
            libvirt_vmxml.check_guest_xml(vm_name, pat_in_dumpxml, status_error=False)
            time.sleep(10)
            added_parts = utils_disk.get_added_parts(vm_session, old_parts)
            if not added_parts or len(added_parts) != 1:
                test.error("Only one new partition is expected in the VM, "
                           "but found {}".format(added_parts))
            cmd = cmds_in_guest[0] % added_parts[0]
            run_cmd_in_guest(test, vm_session, cmd)
            virsh.detach_device(vm_name, to_file_xml, debug=True, ignore_status=False)
            cmd = cmds_in_guest[1] % added_parts[0]
            run_cmd_in_guest(test, vm_session, cmd, any_error=True)
            libvirt_vmxml.check_guest_xml(vm_name, pat_in_dumpxml, status_error=True)
        else:
            if cmds_in_guest:
                for cmd_index in range(0, len(cmds_in_guest)):
                    any_error = False
                    if not target_rotation and cmd_index == 0:
                        any_error = True
                    run_cmd_in_guest(test, vm_session, cmds_in_guest[cmd_index], any_error=any_error)
    finally:
        backup_xml.sync()
        source_file = params.get('source_file')
        if source_file:
            libvirt.delete_local_disk('file', source_file)