[testsuite] Fix retrieval of testname