openzfsonwindows / ZFSin

OpenZFS on Windows port

Home Page:https://openzfsonwindows.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unit test framework for ZFSin - porting ZFS Test Suite?

imtiazdc opened this issue · comments

@lundman Has there been a discussion around this before? A quick search doesn't seem to reveal much.

What are your thoughts on unit testing ZFSin? What could be the challenges involved in porting ZFS Test on Windows? Or are there any other 'shortcuts'?

WSL seemed like an option to explore. Anyone tried that before?

In my understanding, WSL2 seems to be completely different from WSL. In the sense that WSL2 talks to its own Linux kernel instead of 'translating' Linux system calls to Windows like WSL (that would have allowed us to 'test' ZFSin).

I did a branch that used WSL2, and configured enough to run the tests in Linux, but the ZFS driver is in Windows, including running the zpool and zfs commands from Windows. I ran one set of tests only. Then there is a tonne of work to tweak tests to work correctly with this setup.

But I wanted to pause that, as I know Upstream has refreshed all the tests when FreeBSD merged (ie, they already fixed many porting issues for us). So over on OsX, the port has reached the same point (tweaking all the tests to work), but it is running from CI when a commit is pushed to GH.

So ultimately, it wasn't quite the right time, or, be aware of having to do work twice :)

@lundman Can you please provide the branch name which has those changes?

It was quite a while ago I looked at it last:

https://github.com/openzfsonwindows/ZFSin/commits/zfstest

I wrote these notes
https://openzfsonosx.org/wiki/Windows_zfstest

but they are for when I tried running it in cygwin, which wasn't as great.

@lundman also do you think it makes sense to port ztest to Windows? How much would be the effort? Is there any relation between ztest and zfs-tests?

Yes, we should probably do that - I've never actually run it, even on OSX. It's a stand-alone program that runs a bunch of tests, over and over. Should be relatively easy port, it's just another userland program.

@lundman would you know folks who are actively maintaining ztest and/or ZFS test suite or trying to port it to Windows? Want to get in touch with them to understand the state of art and build on top of it and avoid any duplication of effort. Would @ahrens have any inputs here?

zfstest on Windows, there is only I. Upstream it is ZOL, which is maintained by all at OpenZFS, but Brian Behlendorf looks after upstream. But, there is no point in using what is in ZFSin repo (other than reference) since I intend to take a new copy of the tests/ directory from the OpenZFS repo (as they did a lot of work to make it more portable).

If you wanted to start porting tests over, make sure you take the files from :
https://github.com/openzfs/zfs/tree/master/tests

and add another platform type. You can see I started the OsX porting work the same way:
openzfsonosx/openzfs@e99632e