Story 54279: backport file-transfer tests

Checked out tests/ at 38d35c2 (initial port + initial fixes) and
backported to 3.6.1