File: test.sh

package info (click to toggle)
btrfs-progs 6.17.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,612 kB
  • sloc: ansic: 127,282; sh: 7,915; python: 1,384; makefile: 900; asm: 296
file content (28 lines) | stat: -rwxr-xr-x 657 bytes parent folder | download | duplicates (3)
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
28
#!/bin/bash
#
# Make sure "btrfs subvolume list -u" shows uuid correctly

source "$TEST_TOP/common" || exit

check_prereq mkfs.btrfs
check_prereq btrfs
check_global_prereq uuidparse

setup_root_helper
prepare_test_dev

tmp=$(_mktemp_dir list_uuid)

run_check_mkfs_test_dev
run_check_mount_test_dev
run_check $SUDO_HELPER "$TOP/btrfs" subvolume create "$TEST_MNT/subv1"
run_check_stdout $SUDO_HELPER "$TOP/btrfs" subvolume list -u "$TEST_MNT" | \
	cut -d\  -f9 > "$tmp/output"

result=$(cat "$tmp/output" | uuidparse -o TYPE -n)
rm -rf -- "$tmp"

if [ "$result" == "invalid" ]; then
	_fail "subvolume list failed to report uuid"
fi
run_check_umount_test_dev