From Fedora Project Wiki

Description

This test case ensures that the cpio utility, used for creating archives of files, functions as expected.

Setup

  1. Install a fresh version of Fedora.
  2. Install cpio: sudo dnf install cpio.
  3. Create a temporary directory for testing: mkdir cpio_test.
  4. Navigate to the directory: cd cpio_test.
  5. Create a few test files: echo "Test1" > file1.txt, echo "Test2" > file2.txt.

How to test

  1. Create an archive using cpio by running: `find . -type f

Expected Results

  1. The cpio -ov command should create an archive without errors and the output should indicate the inclusion of the test files.
  2. cpio -it should list the contents of the archive, showing the test files.
  3. After removal, the test files should no longer be present in the directory.
  4. The cpio -idv command should extract the files from the archive without errors, and the test files should be restored in the directory.

Optional

For extended testing:

  1. Create archives using different formats/options.
  2. Test the archival and extraction of directories with multiple file levels.
  3. Test the -u option to update older files and -F option to specify archive file.