gparted/tests
Mike Fleetwood fde76a949f Add CreateAndWriteUUIDAndReadLabel unit test (!104)
During review and testing of this patchset it was discovered that using
GParted to set a new UUID on a FAT16 or FAT32 file system that there was
a new unwanted side effect of clearing the label.

Add unit test to cover this error scenario.  It does the following:
1. Creates a file system with a known label;
2. Writes a new UUID;
3. Reads the label and confirms it matches the initial label.

This new unit test captures the fault like this:
    $ ./test_SupportedFileSystems --gtest_filter='*CreateAndWriteUUIDAndReadLabel*'
    ...
    [ RUN      ] My/SupportedFileSystemsTest.CreateAndWriteUUIDAndReadLabel/fat16
    test_SupportedFileSystems.cc:645: Failure
    Expected equality of these values:
      fs_label
        Which is: "TEST_LABEL"
      m_partition.get_filesystem_label().c_str()
        Which is: ""
    [  FAILED  ] My/SupportedFileSystemsTest.CreateAndWriteUUIDAndReadLabel/fat16, where GetParam() = 13 (21 ms)
    [ RUN      ] My/SupportedFileSystemsTest.CreateAndWriteUUIDAndReadLabel/fat32
    test_SupportedFileSystems.cc:645: Failure
    Expected equality of these values:
      fs_label
        Which is: "TEST_LABEL"
      m_partition.get_filesystem_label().c_str()
        Which is: ""
    [  FAILED  ] My/SupportedFileSystemsTest.CreateAndWriteUUIDAndReadLabel/fat32, where GetParam() = 14 (22 ms)

Don't forget to exclude this unit test for file systems which need a
loop device but which fails to be created inside the docker CI image.
Reference:
    39fdfe51da
    Exclude unit tests needing losetup in Docker CI image (!59)

Closes !104 - Add Alpine Linux CI jobs and resolve label and UUID issues
              with FAT16/32
2022-07-04 17:50:25 +00:00
..
Makefile.am Report busy status of bcache (#183) 2022-03-01 16:58:46 +00:00
makedev.sh Add /dev/disk/by-id/ symlink in CI for test_BlockSpecial 2020-03-14 15:31:37 +00:00
test_BlockSpecial.cc Fix test (dentry->d_name is invalidated by closedir...) (!41) 2019-05-31 19:32:52 +01:00
test_PasswordRAMStore.cc Erase correct key in unit test PasswordRAMStoreTest.TooLongPassword 2019-07-18 15:27:43 +00:00
test_PipeCapture.cc Remove custom main() from test_PipeCapture (!22) 2019-01-21 16:41:31 +00:00
test_SupportedFileSystems.cc Add CreateAndWriteUUIDAndReadLabel unit test (!104) 2022-07-04 17:50:25 +00:00
test_dummy.cc Add unit test suites with initial successful dummy test (#781978) 2017-06-02 10:13:16 -06:00