"Fossies" - the Fresh Open Source Software Archive

Member "btrfs-progs-v5.4.1/tests/mkfs-tests/020-basic-checksums-mount/test.sh" (9 Jan 2020, 964 Bytes) of package /linux/misc/btrfs-progs-v5.4.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test.sh": v5.4_vs_v5.4.1.

    1 #!/bin/bash
    2 #
    3 # Test creating images with all supported checksums followed by mount
    4 
    5 source "$TEST_TOP/common"
    6 
    7 check_prereq mkfs.btrfs
    8 check_prereq btrfs
    9 
   10 setup_root_helper
   11 prepare_test_dev
   12 
   13 test_mkfs_mount_checksum()
   14 {
   15     local csum
   16 
   17     csum="$1"
   18     run_check_stdout $SUDO_HELPER "$TOP/mkfs.btrfs" -f --csum "$csum" "$TEST_DEV" | grep -q "Checksum:.*$csum"
   19     run_check $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV"
   20     run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV"
   21 
   22     run_check_mount_test_dev
   23     run_check "$TOP/btrfs" filesystem df "$TEST_MNT"
   24     run_check $SUDO_HELPER "$TOP/btrfs" filesystem usage "$TEST_MNT"
   25     run_check $SUDO_HELPER "$TOP/btrfs" device usage "$TEST_MNT"
   26     run_check_umount_test_dev
   27 }
   28 
   29 if ! [ -f "/sys/fs/btrfs/features/supported_checksums" ]; then
   30     _not_run "kernel support for checksums missing"
   31 fi
   32 
   33 test_mkfs_mount_checksum crc32c
   34 test_mkfs_mount_checksum xxhash
   35 test_mkfs_mount_checksum sha256
   36 test_mkfs_mount_checksum blake2