Fix bug 1052242.  Also includes rewrite of test case using unittest and
avoiding use of popen.
4 files changed