示例#1
0
 def test_release(self):
     try:
         conn = Connection()
         conn.open('127.0.0.1', 3699, 1000)
         session_id = conn.authenticate('root', 'nebula')
         assert session_id != 0
         resp = conn.execute(session_id, 'SHOW SPACES')
         assert resp.error_code == ttypes.ErrorCode.SUCCEEDED, resp.error_msg
         conn.signout(session_id)
         resp = conn.execute(session_id, 'SHOW SPACES')
         assert resp.error_code != ttypes.ErrorCode.SUCCEEDED
     except Exception as ex:
         assert False, ex
示例#2
0
    def test_signout_and_execute(self):
        try:
            conn = Connection()
            conn.open(self.addr_host1, self.addr_port1, 3000)
            session_id = conn.authenticate(self.user, self.password)
            conn.signout(session_id)
        except Exception as e:
            assert False, e.message

        time.sleep(2)
        resp = conn.execute(session_id, 'SHOW HOSTS')
        assert resp.error_code == ttypes.ErrorCode.E_SESSION_INVALID, resp.error_msg
        assert resp.error_msg.find(b'Session not existed!') > 0
示例#3
0
 def test_release(self):
     try:
         conn = Connection()
         conn.open('127.0.0.1', 9669, 1000)
         auth_result = conn.authenticate('root', 'nebula')
         session_id = auth_result.get_session_id()
         assert session_id != 0
         resp = conn.execute(session_id, 'SHOW SPACES')
         assert resp.error_code == ttypes.ErrorCode.SUCCEEDED, resp.error_msg
         conn.signout(session_id)
         # the session delete later
         time.sleep(12)
         resp = conn.execute(session_id, 'SHOW SPACES')
         assert resp.error_code != ttypes.ErrorCode.SUCCEEDED
         conn.close()
     except Exception as ex:
         assert False, ex