Use a common function in test and test building in XDP mode as well