From Fedora Project Wiki

Revision as of 03:30, 18 August 2023 by Sumantrom (talk | contribs) (Created page with "{{QA/Test_Case |description=This test case ensures that the `dosfstools` utilities are working as expected. It verifies the ability to create a FAT filesystem and to check and repair a FAT filesystem using `mkfs.fat` and `fsck.fat`. |setup= 1. Install the version of Fedora that is to be tested on a bare metal or virtual system. 2. Install the `dosfstools` package using the command: `sudo dnf install dosfstools`. 3. Prepare a test device or file. For safety, this is often...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This test case ensures that the dosfstools utilities are working as expected. It verifies the ability to create a FAT filesystem and to check and repair a FAT filesystem using mkfs.fat and fsck.fat.

Setup

1. Install the version of Fedora that is to be tested on a bare metal or virtual system. 2. Install the dosfstools package using the command: sudo dnf install dosfstools. 3. Prepare a test device or file. For safety, this is often a loopback file rather than a physical device: dd if=/dev/zero of=fat.img bs=1M count=100.

How to test

  1. Create a FAT32 filesystem on the test device or file: sudo mkfs.fat -F 32 fat.img.
  2. Mount the newly created filesystem:mkdir mnt && sudo mount -o loop fat.img mnt/
  3. Write some data to the filesystem: sudo touch mnt/testfile &&sudo echo "This is a test" > mnt/testfile
  4. Unmount the filesystem: sudo umount mnt
  5. Check the filesystem for errors: sudo fsck.fat -v fat.img
  6. (For advanced testing) Intentionally corrupt the file system using a hex editor or similar, then use fsck.fat to attempt to repair it.

Expected Results

  1. The dosfstools package installs without error.
  2. The mkfs.fat command successfully creates a FAT32 filesystem without errors.
  3. The new filesystem can be successfully mounted and written to.
  4. The fsck.fat command checks the FAT filesystem and reports that it is clean, or successfully repairs it if it was intentionally corrupted for testing.

Optional

  1. Test with different FAT types (e.g., -F 12, -F 16, -F 32).
  2. Test on different physical devices (USB sticks, SD cards) as well as loopback files.
  3. Test large filesystems (e.g., greater than 32 GB for FAT32).
  4. Test the behavior when the device is nearly full.
  5. Test additional fsck.fat options for different types of checks and repairs.