NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Vishal Verma <vishal.l.verma@intel.com>,
	<linux-cxl@vger.kernel.org>, <nvdimm@lists.linux.dev>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Joao Martins <joao.m.martins@oracle.com>,
	Vishal Verma <vishal.l.verma@intel.com>
Subject: RE: [PATCH ndctl v2] test/daxctl-create.sh: remove region and dax device assumptions
Date: Thu, 11 Jan 2024 16:15:41 -0800	[thread overview]
Message-ID: <65a084ade3b42_1eb42946b@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20240111-vv-daxctl-create-v2-1-1052c8390c5d@intel.com>

Vishal Verma wrote:
> The daxctl-create.sh test had some hard-coded assumptions about what dax
> device it expects to find, and what region number it will be under. This
> usually worked when the unit test environment only had efi_fake_mem
> devices as the sources of hmem memory. With CXL however, the region
> numbering namespace is shared with CXL regions, often pushing the
> efi_fake_mem region to something other than 'region0'.
> 
> Remove any region and device number assumptions from this test so it
> works regardless of how regions get enumerated.
> 
> Cc: Joao Martins <joao.m.martins@oracle.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
> Changes in v2:
> - Fix hmem region selection in case the first dax region is not an hmem
>   one (Dan)
> - Link to v1: https://lore.kernel.org/r/20240110-vv-daxctl-create-v1-1-01f5d58afcd8@intel.com
> ---
>  test/daxctl-create.sh | 58 ++++++++++++++++++++++++++-------------------------
>  1 file changed, 30 insertions(+), 28 deletions(-)
> 
> diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
> index d319a39..c093cb9 100755
> --- a/test/daxctl-create.sh
> +++ b/test/daxctl-create.sh
> @@ -29,14 +29,14 @@ find_testdev()
>  	fi
>  
>  	# find a victim region provided by dax_hmem
> -	testpath=$("$DAXCTL" list -r 0 | jq -er '.[0].path | .//""')
> -	if [[ ! "$testpath" == *"hmem"* ]]; then
> +	region_id="$("$DAXCTL" list -R | jq -r '.[] | select(.path | contains("hmem")) | .id')"
> +	if [[ ! "$region_id" ]]; then

/me learned a new bash'ism for testing empty variables, I like that
better than [ -z $region_id ]

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

      reply	other threads:[~2024-01-12  0:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 23:00 [PATCH ndctl v2] test/daxctl-create.sh: remove region and dax device assumptions Vishal Verma
2024-01-12  0:15 ` Dan Williams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65a084ade3b42_1eb42946b@dwillia2-xfh.jf.intel.com.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=joao.m.martins@oracle.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).