modify tests to include caServerCert
Add new file factory.py to include common tools