Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve property tests #1058

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lading/proptest-regressions/generator/file_gen/model.txt

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions lading/src/bin/logrotate_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ fn getattr_helper(
ino: attr.inode as u64,
size: attr.size,
blocks: (attr.size + 511) / 512,
// TODO these times should reflect those in the model, will need to
// be translated from the tick to systemtime. Implies we'll need to
// adjust up from start_time, knowing that a tick is one second
// wide.
atime,
mtime,
ctime,
Expand Down Expand Up @@ -233,6 +229,9 @@ impl Filesystem for LogrotateFS {
// TODO building up a vec of entries here to handle offset really does
// suggest that the model needs to be exposed in such a way that this
// needn't be done.
//
// Ah, actually, the right buffer to push into is reply.add. There's no
// need for `entries` at all.
let mut entries = Vec::new();

// '.' and '..'
Expand All @@ -248,7 +247,7 @@ impl Filesystem for LogrotateFS {
));
}

// reaming children
// remaining children
if let Some(child_inodes) = state.readdir(ino as usize) {
for child_ino in child_inodes {
let file_type = state
Expand Down Expand Up @@ -310,10 +309,13 @@ fn main() -> Result<(), Error> {
.expect("block construction"); // TODO make this an Error

let state = model::State::new(
&mut rng,
args.bytes_per_second.get_bytes() as u64, // Adjust units accordingly
5, // TODO make an argument
1_000_000, // 1MiB
block_cache,
10, // max_depth
8, // concurrent_logs
);

// Initialize the FUSE filesystem
Expand Down
Loading
Loading