[PATCH v2 2/5] selftests/ima: define a set of common functions