factor out common test code
changed process execution to get better debug information