All of lore.kernel.org
 help / color / mirror / Atom feed
From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v3 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed
Date: Wed, 15 Dec 2021 06:24:21 +0000	[thread overview]
Message-ID: <61B98A46.9030207@fujitsu.com> (raw)
In-Reply-To: <1639374260-22887-2-git-send-email-xuyang2018.jy@fujitsu.com>

Hi All

I will send a v4 patch today by using hot_add/hot_remove interface
instead of skipping case.

Best Regards
Yang Xu
> If zram-generator package is installed and works, then we can not
> remove zram module because zram swap is being used. We can also use zramstart
> command or similar shell script(use zramctl,mkswap,swapon) to do this.
> 
> Since zram01.sh and zram02.sh needs to rmmod and modprobe, they can't work well
> if zram module can't be removed. So skip it.
> 
> Fixes: #888
> Signed-off-by: Yang Xu<xuyang2018.jy@fujitsu.com>
> ---
>   testcases/kernel/device-drivers/zram/zram_lib.sh | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/device-drivers/zram/zram_lib.sh b/testcases/kernel/device-drivers/zram/zram_lib.sh
> index fe9c915c3..26f19ec02 100755
> --- a/testcases/kernel/device-drivers/zram/zram_lib.sh
> +++ b/testcases/kernel/device-drivers/zram/zram_lib.sh
> @@ -5,6 +5,7 @@
> 
>   dev_makeswap=-1
>   dev_mounted=-1
> +dev_zram_load=-1
> 
>   TST_NEEDS_TMPDIR=1
>   TST_NEEDS_ROOT=1
> @@ -17,6 +18,10 @@ zram_cleanup()
>   {
>   	local i
> 
> +	if [ $dev_zram_load -le 0 ]; then
> +		return
> +	fi
> +
>   	for i in $(seq 0 $dev_makeswap); do
>   		swapoff /dev/zram$i
>   	done
> @@ -47,6 +52,10 @@ zram_load()
>   		tst_brk TBROK "dev_num must be>  0"
>   	fi
> 
> +	if grep -q '^zram' /proc/modules; then
> +		 rmmod zram>  /dev/null 2>&1 || tst_brk TCONF "zram module is being used"
> +	fi
> +
>   	tst_set_timeout $((dev_num*450))
> 
>   	tst_res TINFO "create '$dev_num' zram device(s)"
> @@ -54,10 +63,12 @@ zram_load()
>   	modprobe zram num_devices=$dev_num || \
>   		tst_brk TBROK "failed to insert zram module"
> 
> +	dev_zram_load=1
>   	dev_num_created=$(ls /dev/zram* | wc -w)
> 
>   	if [ "$dev_num_created" -ne "$dev_num" ]; then
> -		tst_brk TFAIL "unexpected num of devices: $dev_num_created"
> +		tst_brk TFAIL "expected num of devices $dev_num, but created"\
> +				"$dev_num_created"
>   	fi
> 
>   	tst_res TPASS "all zram devices successfully created"

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-12-15  6:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09  7:43 [LTP] [PATCH 1/3] swapping01: skip test if zram-swap is being used Yang Xu
2021-12-09  7:43 ` [LTP] [PATCH 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed Yang Xu
2021-12-09 15:17   ` Cyril Hrubis
2021-12-09 21:11     ` Petr Vorel
2021-12-10  8:56       ` xuyang2018.jy
2021-12-10  9:03         ` Petr Vorel
2021-12-10  9:31           ` xuyang2018.jy
2021-12-13  7:40             ` Petr Vorel
2021-12-13  8:05               ` xuyang2018.jy
2021-12-13 10:34                 ` Petr Vorel
2021-12-14  3:45                   ` xuyang2018.jy
2021-12-14  6:35                     ` xuyang2018.jy
2021-12-15 11:56                     ` Petr Vorel
2021-12-10  8:27     ` xuyang2018.jy
2021-12-09  7:43 ` [LTP] [PATCH 3/3] zram/zram03: Convert into new api Yang Xu
2021-12-09 21:38   ` Petr Vorel
2021-12-10 10:55     ` xuyang2018.jy
2021-12-10 11:06       ` xuyang2018.jy
2021-12-13  7:30         ` Petr Vorel
2021-12-10 11:40     ` [LTP] [PATCH v2 1/3] swapping01: skip test if zram-swap is being used Yang Xu
2021-12-10 11:40       ` [LTP] [PATCH v2 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed Yang Xu
2021-12-10 12:25         ` Cyril Hrubis
2021-12-10 11:40       ` [LTP] [PATCH v2 3/3] zram/zram03: Convert into new api Yang Xu
2021-12-10 12:28         ` Cyril Hrubis
2021-12-13  5:44           ` [LTP] [PATCH v3 1/3] swapping01: skip test if zram-swap is being used Yang Xu
2021-12-13  5:44             ` [LTP] [PATCH v3 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed Yang Xu
2021-12-15  6:24               ` xuyang2018.jy [this message]
2021-12-10 11:51       ` [LTP] [PATCH v2 1/3] swapping01: skip test if zram-swap is being used Cyril Hrubis
2021-12-10 11:52       ` Cyril Hrubis
2021-12-09 15:15 ` [LTP] [PATCH " Cyril Hrubis
2021-12-09 20:57   ` Petr Vorel
2021-12-10  2:57     ` xuyang2018.jy

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=61B98A46.9030207@fujitsu.com \
    --to=xuyang2018.jy@fujitsu.com \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.