port hanling and test command