lkml.org 
[lkml]   [2020]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC v3 6/7] mm/damon/selftests: Add 'schemes' debugfs tests
    Date
    From: SeongJae Park <sjpark@amazon.de>

    This commit adds simple selftets for 'schemes' debugfs file of DAMON.

    Signed-off-by: SeongJae Park <sjpark@amazon.de>
    ---
    .../testing/selftests/damon/debugfs_attrs.sh | 29 +++++++++++++++++++
    1 file changed, 29 insertions(+)

    diff --git a/tools/testing/selftests/damon/debugfs_attrs.sh b/tools/testing/selftests/damon/debugfs_attrs.sh
    index d5188b0f71b1..82a98c81975b 100755
    --- a/tools/testing/selftests/damon/debugfs_attrs.sh
    +++ b/tools/testing/selftests/damon/debugfs_attrs.sh
    @@ -97,6 +97,35 @@ fi

    echo $ORIG_CONTENT > $file

    +# Test schemes file
    +file="$DBGFS/schemes"
    +
    +ORIG_CONTENT=$(cat $file)
    +echo "1 2 3 4 5 6 3" > $file
    +if [ $? -ne 0 ]
    +then
    + echo "$file write fail"
    + echo $ORIG_CONTENT > $file
    + exit 1
    +fi
    +
    +echo "1 2
    +3 4 5 6 3" > $file
    +if [ $? -eq 0 ]
    +then
    + echo "$file splitted write success (expected fail)"
    + echo $ORIG_CONTENT > $file
    + exit 1
    +fi
    +
    +echo > $file
    +if [ $? -ne 0 ]
    +then
    + echo "$file empty string writing fail"
    + echo $ORIG_CONTENT > $file
    + exit 1
    +fi
    +
    # Test pids file
    file="$DBGFS/pids"

    --
    2.17.1
    \
     
     \ /
      Last update: 2020-02-25 11:26    [W:3.667 / U:0.216 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site