From Fedora Project Wiki
Description
This test case ensures that the cpio
utility, used for creating archives of files, functions as expected.
Setup
- Install a fresh version of Fedora.
- Install
cpio
:sudo dnf install cpio
. - Create a temporary directory for testing:
mkdir cpio_test
. - Navigate to the directory:
cd cpio_test
. - Create a few test files:
echo "Test1" > file1.txt
,echo "Test2" > file2.txt
.
How to test
- Create an archive using
cpio
by running: `find . -type f
Expected Results
- The
cpio -ov
command should create an archive without errors and the output should indicate the inclusion of the test files. cpio -it
should list the contents of the archive, showing the test files.- After removal, the test files should no longer be present in the directory.
- 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:
- Create archives using different formats/options.
- Test the archival and extraction of directories with multiple file levels.
- Test the
-u
option to update older files and-F
option to specify archive file.