Skip to content

Commit

Permalink
Skip some logging.
Browse files Browse the repository at this point in the history
Test-tag: dfuse

Required-githooks: true

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
  • Loading branch information
ashleypittman committed Apr 24, 2023
1 parent 709d5c9 commit b3af6ba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/client/dfuse/ops/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ dfuse_readahead_reply(fuse_req_t req, size_t len, off_t position, struct dfuse_o
oh->doh_linear_read_eof = true;
}

DFUSE_TRA_DEBUG(oh, "%#zx-%#zx requested", position, position + len - 1);

/* At this point there is a buffer of known length that contains the data, and a read
* request.
* If the attempted read is bigger than the data then it will be truncated.
Expand All @@ -94,7 +92,7 @@ dfuse_readahead_reply(fuse_req_t req, size_t len, off_t position, struct dfuse_o
position + reply_len - 1, position + reply_len, position + len - 1);
}

DFUSE_REPLY_BUF(oh, req, oh->doh_readahead->dra_ev->de_iov.iov_buf + position, reply_len);
DFUSE_REPLY_BUFQ(oh, req, oh->doh_readahead->dra_ev->de_iov.iov_buf + position, reply_len);
return true;
}

Expand Down
19 changes: 19 additions & 0 deletions utils/node_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import stat
import errno
import argparse
import random
import threading
import functools
import traceback
Expand Down Expand Up @@ -1871,6 +1872,14 @@ def test_pre_read(self):
with open(join(dfuse.dir, 'file2'), 'w') as fd:
fd.write('testing')

raw_data0 = ''.join(random.choices(['d', 'a', 'o', 's'], k=1024 * 1024)) # nosec
with open(join(dfuse.dir, 'file3'), 'w') as fd:
fd.write(raw_data0)

raw_data1 = ''.join(random.choices(['d', 'a', 'o', 's'], k=(1024 * 1024) - 1)) # nosec
with open(join(dfuse.dir, 'file4'), 'w') as fd:
fd.write(raw_data1)

if dfuse.stop():
self.fatal_errors = True

Expand All @@ -1886,12 +1895,22 @@ def test_pre_read(self):
with open(join(dfuse.dir, 'file2'), 'r') as fd:
data2 = fd.read(2)

with open(join(dfuse.dir, 'file3'), 'r') as fd:
data3 = fd.read()

with open(join(dfuse.dir, 'file4'), 'r') as fd:
data4 = fd.read()
data5 = fd.read()

if dfuse.stop():
self.fatal_errors = True
print(data0)
assert data0 == 'test'
assert data1 == 'test'
assert data2 == 'te'
assert raw_data0 == data3
assert raw_data1 == data4
assert len(data5) == 0

def test_two_mounts(self):
"""Create two mounts, and check that a file created in one can be read from the other"""
Expand Down

0 comments on commit b3af6ba

Please sign in to comment.