diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-04 21:07:27 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-16 22:17:13 -0500 |
commit | fc29dafd7afffe6fbef764495d281ce3041a1c00 (patch) | |
tree | 363d90fb3bf66111159eb8fc90ffabf3dd04f489 /tests/bcachefs/subvol.ktest | |
parent | 91c9a633292e771822cb161aac0e5075bc8f1cee (diff) |
tests/bcachefs: new contributed tests
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'tests/bcachefs/subvol.ktest')
-rwxr-xr-x | tests/bcachefs/subvol.ktest | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/bcachefs/subvol.ktest b/tests/bcachefs/subvol.ktest index 4a50da2..de9ce7e 100755 --- a/tests/bcachefs/subvol.ktest +++ b/tests/bcachefs/subvol.ktest @@ -736,4 +736,24 @@ test_subvol_rmdir_empty_snapshot() bcachefs fsck ${ktest_scratch_dev[0]} } +test_snapshot_reflink() +{ + run_quiet "" bcachefs format -f ${ktest_scratch_dev[0]} + mount -t bcachefs -o noinline_data ${ktest_scratch_dev[0]} /mnt + + cp /usr/bin/cp /mnt/file + #echo Test > /mnt/file + bcachefs subvolume snapshot /mnt/snapshot + + cp --reflink=always /mnt/snapshot/file /mnt/file1 + rm /mnt/file + cp --reflink=always /mnt/snapshot/file /mnt/file2 + + md5sum /mnt/file* /mnt/snapshot/file /usr/bin/cp + umount /mnt + + mount -t bcachefs -o fsck ${ktest_scratch_dev[0]} /mnt + umount /mnt +} + main "$@" |