testsuite: A more portable solution to #9399