Add valgrind tests

Change-Id: Ie5f74108fa9eae8dd533bd8b91e89bb634ffccf8