Function testing of valves