Missing part of test postcmd cherrypicked from v1.70/1