From Fedora Project Wiki

Description

This test case ensures that the firewalld service, which provides dynamic firewall management, is functioning correctly alongside the provided filesystem configuration from firewalld-filesystem.

Setup

  1. Ensure that firewalld and firewalld-filesystem packages are installed. If not, install them with the command: sudo dnf install firewalld firewalld-filesystem
  2. Start the firewalld service with: sudo systemctl start firewalld

How to test

  1. Check the status of firewalld: sudo firewall-cmd --state
  2. List the default zones: sudo firewall-cmd --get-default-zone
  3. Add an example service to the default zone, for instance: sudo firewall-cmd --add-service=http
  4. Reload firewalld to apply changes: sudo firewall-cmd --reload
  5. Verify that the service is added: sudo firewall-cmd --list-services
  6. Remove the added service: sudo firewall-cmd --remove-service=http
  7. Reload firewalld to apply changes: sudo firewall-cmd --reload
  8. Verify that the service is removed: sudo firewall-cmd --list-services

Expected Results

  1. The first command should indicate that firewalld is running.
  2. The second command should list the default zone (e.g., public).
  3. After adding the service, the verification command should list the "http" service in the active zone.
  4. After removing the service, the "http" service should no longer be listed for the active zone.