port pub&mpub command tests from mreiferson's pull request #11