Dimuth Karunaratne, the former Sri Lanka captain, is set to retire from Test cricket after making his 100th appearance in the format in Sri Lanka's second match against Australia in Galle.