refactoring tests to prevent duplication for testing amazon normal and spot instances