Skip to contentSkip to conversation

btrfs/339: test receive dump stream for different user

PATCH Superseded Sidong Yang 2 participants 3 messages Nov 19, 2025 Btrfs file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs/339: test receive dump stream for different user

Test receive to dump stream file from different user.

This is a regression test for the btrfs-progs commit cd933616d485 ("btrfs-progs: receive: don't use O_NOATIME to open stream for dumping").

---
 tests/btrfs/339     | 32 ++++++++++++++++++++++++++++++++
 tests/btrfs/339.out |  2 ++
 2 files changed, 34 insertions(+)
 create mode 100755 tests/btrfs/339
 create mode 100644 tests/btrfs/339.out
tests/btrfs/339 new file +32 -0
new file mode 100755
index 00000000..728f3d9d
@@ -0,0 +1,32 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Sidong Yang.  All Rights Reserved.
+#
+# FS QA Test 339
+#
+# Test btrfs receive dump stream from different user
+#
+. ./common/preamble
+_begin_fstest auto quick send snapshot
+
+. ./common/filter
+. ./common/quota
+
+_require_scratch
+_require_user
+
+_fixed_by_git_commit btrfs-progs cd933616d485 \
+	"btrfs-progs: receive: don't use O_NOATIME to open stream for dumping"
+
+_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount
+
+$BTRFS_UTIL_PROG -q subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch
+$BTRFS_UTIL_PROG -q send -f stream $SCRATCH_MNT/snap
+chmod a+r stream
+_su $qa_user -c "$BTRFS_UTIL_PROG receive --dump -f stream" >> $seqres.full
+rm stream
+
+# success, all done
+echo "Silence is golden"
+_exit 0
tests/btrfs/339.out new file +2 -0
new file mode 100644
index 00000000..293ea808
@@ -0,0 +1,2 @@
+QA output created by 339
+Silence is golden
Signature · 1 line
2.43.0
#1 lore raw
Quoted 34 lines · Sidong Yang

Test receive to dump stream file from different user.

This is a regression test for the btrfs-progs commit cd933616d485 ("btrfs-progs: receive: don't use O_NOATIME to open stream for dumping").

---
  tests/btrfs/339     | 32 ++++++++++++++++++++++++++++++++
  tests/btrfs/339.out |  2 ++
  2 files changed, 34 insertions(+)

create mode 100755 tests/btrfs/339
create mode 100644 tests/btrfs/339.out

tests/btrfs/339 new file +14 -0
new file mode 100755
index 00000000..728f3d9d
@@ -0,0 +1,32 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Sidong Yang.  All Rights Reserved.
+#
+# FS QA Test 339
+#
+# Test btrfs receive dump stream from different user
+#
+. ./common/preamble
+_begin_fstest auto quick send snapshot
+
+. ./common/filter
+. ./common/quota
+

tests/btrfs/339 line 24

Quoted 10 lines
tests/btrfs/339 new file +10 -0
+_require_scratch
+_require_user
+
+_fixed_by_git_commit btrfs-progs cd933616d485 \
+	"btrfs-progs: receive: don't use O_NOATIME to open stream for dumping"
+
+_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount
+
+$BTRFS_UTIL_PROG -q subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch

If you are using "-q" to suppress non-critical messages, you don't need to do the _filter_scratch call.

It's better just to redirect all output to seqres.full without "-q".

tests/btrfs/339 line 25

Quoted 1 line
tests/btrfs/339 new file +1 -0
+$BTRFS_UTIL_PROG -q send -f stream $SCRATCH_MNT/snap

Furthermore, the stream file is at the current working directory, and if the test case is interrupted before "rm stream" call, the file will be left uncleaned.

Please use $tmp or some location inside $TEST_DIR to store the send stream, and have a proper cleanup function.

Thanks,
Qu

Quoted 15 lines
tests/btrfs/339 new file +7 -0
+chmod a+r stream
+_su $qa_user -c "$BTRFS_UTIL_PROG receive --dump -f stream" >> $seqres.full
+rm stream
+
+# success, all done
+echo "Silence is golden"
+_exit 0
tests/btrfs/339.out new file +2 -0
new file mode 100644
index 00000000..293ea808
@@ -0,0 +1,2 @@
+QA output created by 339
+Silence is golden
#2 lore raw
Quoted 51 lines · Qu Wenruo
Quoted 34 lines · Sidong Yang

Test receive to dump stream file from different user.

This is a regression test for the btrfs-progs commit cd933616d485 ("btrfs-progs: receive: don't use O_NOATIME to open stream for dumping").

---
  tests/btrfs/339     | 32 ++++++++++++++++++++++++++++++++
  tests/btrfs/339.out |  2 ++
  2 files changed, 34 insertions(+)

create mode 100755 tests/btrfs/339
create mode 100644 tests/btrfs/339.out

tests/btrfs/339 new file +14 -0
new file mode 100755
index 00000000..728f3d9d
@@ -0,0 +1,32 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Sidong Yang.  All Rights Reserved.
+#
+# FS QA Test 339
+#
+# Test btrfs receive dump stream from different user
+#
+. ./common/preamble
+_begin_fstest auto quick send snapshot
+
+. ./common/filter
+. ./common/quota
+

tests/btrfs/339 line 24

Quoted 10 lines
tests/btrfs/339 new file +10 -0
+_require_scratch
+_require_user
+
+_fixed_by_git_commit btrfs-progs cd933616d485 \
+	"btrfs-progs: receive: don't use O_NOATIME to open stream for dumping"
+
+_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount
+
+$BTRFS_UTIL_PROG -q subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch

If you are using "-q" to suppress non-critical messages, you don't need to do the _filter_scratch call.

Quoted 1 line

It's better just to redirect all output to seqres.full without "-q".

Thanks, I'll use it.

Quoted 9 lines

tests/btrfs/339 line 25

Quoted 2 lines
tests/btrfs/339 new file +1 -0
+$BTRFS_UTIL_PROG -q send -f stream $SCRATCH_MNT/snap

Furthermore, the stream file is at the current working directory, and if the test case is interrupted before "rm stream" call, the file will be left uncleaned.

Please use $tmp or some location inside $TEST_DIR to store the send stream, and have a proper cleanup function.

$tmp would be good to use.

Thanks,
Sidong

Quoted 20 lines

Thanks,
Qu

Quoted 15 lines
tests/btrfs/339 new file +7 -0
+chmod a+r stream
+_su $qa_user -c "$BTRFS_UTIL_PROG receive --dump -f stream" >> $seqres.full
+rm stream
+
+# success, all done
+echo "Silence is golden"
+_exit 0
tests/btrfs/339.out new file +2 -0
new file mode 100644
index 00000000..293ea808
@@ -0,0 +1,2 @@
+QA output created by 339
+Silence is golden