[OC-8242] Fixed issues related to port and added test cases