From Fedora Project Wiki
Description
This test case ensures the proper installation and basic functionality of the bzip2
compression utility and its associated libraries (bzip2-libs
).
Setup
- Install a fresh version of Fedora.
- Install the
bzip2
andbzip2-libs
packages:sudo dnf install bzip2 bzip2-libs
.
How to test
- Create a text file for testing:
echo "This is a test for bzip2 compression." > ~/test.txt
. - Compress the file using
bzip2
:bzip2 ~/test.txt
. This should create a file namedtest.txt.bz2
. - Decompress the file using
bunzip2
:bunzip2 ~/test.txt.bz2
. - Check the contents of the decompressed file:
cat ~/test.txt
.
Expected Results
- After compression, the original
test.txt
file should no longer be present, buttest.txt.bz2
should exist. - After decompression, the
test.txt.bz2
file should no longer be present, buttest.txt
should be back with the original content: "This is a test for bzip2 compression.".
Optional
For deeper testing:
- Try compressing and decompressing larger files to test efficiency and speed.
- Examine CPU and memory usage during compression of larger files.
- Use the
bzcat
command to view the content of a compressed file without decompressing it.