def testDestroyCIDTwice(t, env):
    """ destroy a clientid twice without session

    FLAGS: destroy_clientid all
    CODE: DESCID8
    """
    c = env.c1.new_client(env.testname(t))

    res = env.c1.compound([op.destroy_clientid(c.clientid)])
    check(res)

    res = env.c1.compound([op.destroy_clientid(c.clientid)])
    check(res, NFS4ERR_STALE_CLIENTID)
Exemple #2
0
 def shutDown(self):
     """Run after each test"""
     log.debug("post-test")
     client_index = 0
     clients = {}
     for sessid in self.c1.sessions:
         session = self.c1.sessions[sessid]
         if session is None:
             continue
         clients[client_index] = session.client
         client_index += 1
         res = self.c1.compound([op.destroy_session(sessid)])
         if res.status != NFS4_OK:
             log.info("Could not clean up session: status %s" %
                      nfsstat4[res.status])
             session.client._del_session(session)
     for client_index in clients:
         client = clients[client_index]
         if client == self.c1:
             continue
         res = self.c1.compound([op.destroy_clientid(client.clientid)])
         if res.status != NFS4_OK:
             log.info("Could not clean up client: status %s" %
                      nfsstat4[res.status])
     log.debug("done post-test")
def testDestroyCIDNotOnly(t, env):
    """ destroy a clientid without session with other compound

    FLAGS: destroy_clientid all
    CODE: DESCID7
    """
    res = env.c1.compound([op.destroy_clientid(0), op.reclaim_complete(TRUE)])
    check(res, NFS4ERR_NOT_ONLY_OP)
def testDestroyBadCIDWS(t, env):
    """ destroy a nonexistant clientid without session

    FLAGS: destroy_clientid all
    CODE: DESCID3
    """
    res = env.c1.compound([op.destroy_clientid(0)])
    check(res, NFS4ERR_STALE_CLIENTID)
def testDestroyCIDCSession(t, env):
    """ destroy a clientid which contains session without session

    FLAGS: destroy_clientid all
    CODE: DESCID6
    """
    c = env.c1.new_client(env.testname(t))
    sess = c.create_session()

    res = env.c1.compound([op.destroy_clientid(c.clientid)])
    check(res, NFS4ERR_CLIENTID_BUSY)
def testSupported(t, env):
    """ Do a simple DESTROY_CLIENTID
        destroy an unconfirmed clientid without session

    FLAGS: destroy_clientid all
    CODE: DESCID1
    """
    c = env.c1.new_client(env.testname(t))

    res = env.c1.compound([op.destroy_clientid(c.clientid)])
    check(res)
def testDestroyCIDSessionB(t, env):
    """ destroy clientid using a session belong to that client

    FLAGS: destroy_clientid all
    CODE: DESCID5
    """
    c = env.c1.new_client(env.testname(t))
    sess = c.create_session()

    res = sess.compound([op.destroy_clientid(c.clientid)])
    check(res, NFS4ERR_CLIENTID_BUSY)
def testDestroyBadCIDIS(t, env):
    """ destroy a nonexistant clientid in session

    FLAGS: destroy_clientid all
    CODE: DESCID4
    """
    c = env.c1.new_client(env.testname(t))
    sess = c.create_session()

    res = sess.compound([op.destroy_clientid(0)])
    check(res, NFS4ERR_STALE_CLIENTID)
def testDestroyCIDWS(t, env):
    """ destroy an unconfirmed clientid with session

    FLAGS: destroy_clientid all
    CODE: DESCID2
    """
    c1 = env.c1.new_client("%s_1" % env.testname(t))
    c2 = env.c1.new_client("%s_2" % env.testname(t))
    sess = c1.create_session()

    res = sess.compound([op.destroy_clientid(c2.clientid)])
    check(res)