On some linux distributions, if it used /dev/zram0 as default by zram-generate
service, then this case will fail or report EBUSY.
To fix this, use hot_add/hot_remove interface. Also, move module check code into
zram_load from zram.sh. We can use /sys/class/zram-control to detect the
module whether existed.
After this patch, we still run case pass even /dev/zram0 is being used.
Signed-off-by: Yang Xu <xuyang2018.jy@xxxxxxxxxxx>
---
tools/testing/selftests/zram/zram.sh | 16 +----
tools/testing/selftests/zram/zram01.sh | 2 +-
tools/testing/selftests/zram/zram_lib.sh | 75 ++++++++++++------------
3 files changed, 41 insertions(+), 52 deletions(-)