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

  1. Install a fresh version of Fedora.
  2. Install the bzip2 and bzip2-libs packages: sudo dnf install bzip2 bzip2-libs.

How to test

  1. Create a text file for testing: echo "This is a test for bzip2 compression." > ~/test.txt.
  2. Compress the file using bzip2: bzip2 ~/test.txt. This should create a file named test.txt.bz2.
  3. Decompress the file using bunzip2: bunzip2 ~/test.txt.bz2.
  4. Check the contents of the decompressed file: cat ~/test.txt.

Expected Results

  1. After compression, the original test.txt file should no longer be present, but test.txt.bz2 should exist.
  2. After decompression, the test.txt.bz2 file should no longer be present, but test.txt should be back with the original content: "This is a test for bzip2 compression.".

Optional

For deeper testing:

  1. Try compressing and decompressing larger files to test efficiency and speed.
  2. Examine CPU and memory usage during compression of larger files.
  3. Use the bzcat command to view the content of a compressed file without decompressing it.