Improved test framework and test for hardlink handling