Example #1
0
    def testSshCmdRetry(self):
        wrongPort = '33'
        input = 'true', 'localhost', '', wrongPort, 'noname'

        devNull = file(os.path.devnull,'w')
        assert Util.SSH_EXIT_STATUS_ERROR == Util.sshCmd(*input, stderr=devNull)
        devNull.close()

        output = Util.sshCmdWithOutput(*input)
        assert Util.SSH_EXIT_STATUS_ERROR == output[0]
        assert output[1].startswith('ssh: connect to host localhost port 33: Connection refused')