tests: Change ADD_OF_PORTS from macro to shell function.