File: test.sh

package info (click to toggle)
btrfs-progs 6.2-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,244 kB
  • sloc: ansic: 114,376; sh: 9,576; python: 1,242; makefile: 820
file content (27 lines) | stat: -rwxr-xr-x 625 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# Crafted image with needs_recovery incompat bit feature set, convert must
# refuse to convert such image

source "$TEST_TOP/common"

check_prereq btrfs-convert
check_prereq btrfs

setup_root_helper
prepare_test_dev

# Override common function
check_image() {
	local features

	TEST_DEV="$1"
	features=$(run_check_stdout dumpe2fs "$TEST_DEV" | grep 'Filesystem features')
	if ! echo "$features" | grep -q 'needs_recovery'; then
		_fail "image does not have the needs_recovery bit set"
	fi
	run_mustfail "convert worked on unclean image" \
		"$TOP/btrfs-convert" "$TEST_DEV"
	rm -f "$TEST_DEV"
}

check_all_images