[tests] fix the tests when no X is available.