defaultPort and customPort aren't python variables causing the test to fail. We instead use the nix variables with string interpolation.
Fix some fallout from de3e423 (PR #171280).
de3e423