On Thu, Apr 30, 2026, at 11:27 AM, Dave Jiang wrote:
>
>
> On 4/30/26 8:34 AM, John Groves wrote:
> > From: John Groves <[email protected]>
> >
> > - devdax <-> famfs mode switches
> > - Verify famfs -> system-ram is rejected (must go via devdax)
> > - Test JSON output shows correct mode
> > - Test error handling for invalid modes
> >
> > Signed-off-by: John Groves <[email protected]>
> > ---
> > test/daxctl-famfs.sh | 253 +++++++++++++++++++++++++++++++++++++++++++
> > test/meson.build | 2 +
> > 2 files changed, 255 insertions(+)
> > create mode 100755 test/daxctl-famfs.sh
> >
> > diff --git a/test/daxctl-famfs.sh b/test/daxctl-famfs.sh
> > new file mode 100755
> > index 0000000..12fbfef
> > --- /dev/null
> > +++ b/test/daxctl-famfs.sh
> > @@ -0,0 +1,253 @@
> > +#!/bin/bash -Ex
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (C) 2025 Micron Technology, Inc. All rights reserved.
> > +#
> > +# Test daxctl famfs mode transitions and mode detection
> > +
> > +rc=77
> > +. $(dirname $0)/common
> > +
> > +trap 'cleanup $LINENO' ERR
> > +
> > +daxdev=""
> > +original_mode=""
> > +
> > +cleanup()
> > +{
> > + printf "Error at line %d\n" "$1"
> > + # Try to restore to original mode if we know it
> > + if [[ $daxdev && $original_mode ]]; then
> > + "$DAXCTL" reconfigure-device -f -m "$original_mode" "$daxdev" 2>/dev/null
> > || true
> > + fi
> > + exit $rc
> > +}
> > +
> > +# Check if fsdev_dax module is available
> > +check_fsdev_dax()
> > +{
> > + if modinfo fsdev_dax &>/dev/null; then
> > + return 0
> > + fi
> > + if grep -qF "fsdev_dax" "/lib/modules/$(uname -r)/modules.builtin"
> > 2>/dev/null; then
> > + return 0
> > + fi
> > + printf "fsdev_dax module not available, skipping\n"
> > + exit 77
> > +}
> > +
> > +# Check if kmem module is available (needed for system-ram mode tests)
> > +check_kmem()
> > +{
> > + if modinfo kmem &>/dev/null; then
> > + return 0
> > + fi
> > + if grep -qF "kmem" "/lib/modules/$(uname -r)/modules.builtin"
> > 2>/dev/null; then
> > + return 0
> > + fi
> > + printf "kmem module not available, skipping system-ram tests\n"
> > + return 1
> > +}
> > +
> > +# Find an existing dax device to test with
> > +find_daxdev()
> > +{
> > + # Look for any available dax device
> > + daxdev=$("$DAXCTL" list | jq -er '.[0].chardev // empty' 2>/dev/null) ||
> > true
> > +
> > + if [[ ! $daxdev ]]; then
> > + printf "No dax device found, skipping\n"
> > + exit 77
>
> Can you use 'do_skip' here?
>
> DJ
Yes! Done in 2 places...
<snip>
Thanks,
John