示例#1
0
def testNoData(t, env):
    """WRITE with no data

    FLAGS: write all
    DEPEND: MKFILE
    CODE: WRT4
    """
    c = env.c1
    c.init_connection()
    attrs = {FATTR4_SIZE: 32, FATTR4_MODE: 0644}
    fh, stateid = c.create_confirm(t.code, attrs=attrs)
    time_prior = c.do_getattr(FATTR4_TIME_MODIFY, fh)
    env.sleep(1)
    res = c.write_file(fh, '', 5, stateid)
    check(res, msg="WRITE with no data")
    if res.count:
        t.fail("WRITE with no data returned count=%i" % res.count)
    # Now ensure time_modify was unchanged
    time_after = c.do_getattr(FATTR4_TIME_MODIFY, fh)
    if compareTimes(time_prior, time_after) != 0:
        t.fail("WRITE with no data affected time_modify")
示例#2
0
def testNoData(t, env):
    """WRITE with no data

    FLAGS: write all
    DEPEND: MKFILE
    CODE: WRT4
    """
    c = env.c1
    c.init_connection()
    attrs = {FATTR4_SIZE: 32, FATTR4_MODE: 0644}
    fh, stateid = c.create_confirm(t.code, attrs=attrs)
    time_prior = c.do_getattr(FATTR4_TIME_MODIFY, fh)
    env.sleep(1)
    res = c.write_file(fh, '', 5, stateid)
    check(res, msg="WRITE with no data")
    if res.count:
        t.fail("WRITE with no data returned count=%i" % res.count)
    # Now ensure time_modify was unchanged
    time_after = c.do_getattr(FATTR4_TIME_MODIFY, fh)
    if compareTimes(time_prior,time_after) != 0:
        t.fail("WRITE with no data affected time_modify")