Add kpm wrap functional tests

parent #936