osandov / blktests

Linux kernel block layer testing framework
118 stars 75 forks source link

some case cannot be executed in embedded kernel #48

Open ChenChunSung opened 5 years ago

ChenChunSung commented 5 years ago

xfs_io is not supported in Android There might be also other unsupported commands. Do you have any plan for it?

osandov commented 5 years ago

There were some patches way back in 2015 (https://www.spinics.net/lists/xfs/msg33832.html) from @tytso for compiling xfsprogs for Android. What's the situation now?

tytso commented 5 years ago

I had sent patches to allow xfsprogs to compile using the Android toolchain and with the bionic C library. I believe all of the changes were accepted upstream --- or I was able to work around it in xfstests-bld's build scripts.

However, I ultimately gave up on this approach since it was too painful to port all of the various userspace tools required to run xfstests --- lvm2, mdadm, etc. I would expect it would be even worse for blktests since I suspect nvme-cli will be especially painful to port. The approach we used to test file systems on Android was to use a debian chroot. See[1] for more details; but the short version is that I build binaries using qemu-static for the Debian architectures arm64 and armhf and create a test appliance as a tar.gz. The android-xfstests front end will install the test appliance onto the handset using adb and fastboot, and then upload the kernel to be tested, kick off the tests, and then retrieve the results of the test run using adb and fastboot.

[1] https://thunk.org/android-xfstests

The xfstests-bld repository[2] now builds blktests and I have used it to successfully run blktests using kvm-xfstests and gce-xfstests. I have not tried to make blktests work for android-xfstests, due to lack of time and no longer regularly doing Android kernel development these days. However. building its dependencies should not be the problem; a lot of it should be figuring out which block devices are safe to use, or how to pass the block devices that it should use from the android-xfstests front-end when the user runs the command to kick off the blktests. Yeah, it's a bit weird to to run blktests by using the command "gce-xfstests --blktests" or for android, "android-xfstests --blktests", but ¯_(ツ)_/¯.

[2] https://github.com/tytso/xfstests-bld

I'd love to have someone send patches to make "android-xfstests --blktests" work. :-)