blob: a2e04a3f378d25f3a37cdcce280fd723a7a40949 (
plain)
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
29
30
31
32
33
34
35
|
#!/bin/bash
# verify that mkfs fills the uuid and otime for FS_TREE
source "$TEST_TOP/common"
check_prereq mkfs.btrfs
check_prereq btrfs
setup_root_helper
prepare_test_dev
# item 3 key (FS_TREE ROOT_ITEM 0) itemoff 14949 itemsize 439
# generation 4 root_dirid 256 bytenr 30408704 level 0 refs 1
# lastsnap 0 byte_limit 0 bytes_used 16384 flags 0x0(none)
# uuid 322826f3-817a-4111-89ff-5481bfd516e2
# ctime 1521656113.0 (2018-03-21 19:15:13)
# otime 1521656113.0 (2018-03-21 19:15:13)
# drop key (0 UNKNOWN.0 0) level 0
run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$@" "$TEST_DEV"
# match not-all-zeros in the first part
uuid=$(run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t root "$TEST_DEV" | \
grep -A 3 "FS_TREE ROOT_ITEM 0" | grep 'uuid ')
if [ $? != 0 ]; then
_fail "uuid for FS_TREE not found"
fi
if [ "$uuid" = '00000000-0000-0000-0000-000000000000' ]; then
_fail "uuid for FS_TREE is null"
fi
run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree -t root "$TEST_DEV" | \
grep -A 5 "FS_TREE ROOT_ITEM 0" | grep -q 'otime ' || \
_fail "otime for FS_TREE not found"
|