From Fedora Project Wiki

(First version)
 
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=This test case tests Apache HTTPd Web server and some modules like mod_php and mod_ssl.
|description=This test case ensures that the `httpd` (Apache HTTP Server) is installed correctly, starts properly, serves content, and can be managed through systemd.
|setup=
|setup=
# Ensure the {{package|git}} package is installed.
# Install the `httpd` package if it is not already installed: `sudo dnf install httpd`
|actions=
|actions=
# Run the following commands:  
# Start the `httpd` service: `sudo systemctl start httpd`
<pre>
# Enable the `httpd` service to start on boot: `sudo systemctl enable httpd`
git clone git://fedorapeople.org/home/fedora/athmane/public_git/testcases-scripts.git
# Verify that the `httpd` service is running: `sudo systemctl status httpd`
cd testcases-scripts/httpd/
# Create a simple HTML file to serve:
./runtests.sh
<code><nowiki>printf '<html><body><h1>Hello, Fedora!</h1></body></html>\n' | sudo tee /var/www/html/index.html</nowiki></code>
</pre>
# Open a web browser and navigate to `http://localhost/` to see the served content.
# Check the Apache configuration file for errors: `sudo apachectl configtest`
# Reload the `httpd` service to apply any configuration changes: `sudo systemctl reload httpd`
|results=
|results=
# All tests should not fail, here an example of the output:
# The `httpd` package should install without errors.
<pre>
# The `httpd` service should start without errors and be enabled to start on boot.
./runtests.sh
# The status command should indicate that `httpd` is active and running.
Starting httpd (via systemctl):                            [  OK  ]
# Navigating to `http://localhost/` should display "Hello, Fedora!" in the web browser.
Running ./httpd_basic_auth.sh - httpd basic authentication test.
# The `apachectl configtest` command should return "Syntax OK".
Adding password for user test
# The `httpd` service should reload without errors.
Reloading httpd configuration (via systemctl):             [  OK  ]
|optional=For additional testing:
==> [ PASS ]
# Configure a virtual host and verify it serves content correctly.
Running ./httpd_php.sh - httpd handle PHP test
# Enable and test SSL support by generating a self-signed certificate.
==> [ PASS ]
# Test serving different types of files (e.g., images, scripts) and using different modules.
Running ./httpd_servehtml.sh - httpd serve html page test.
==> [ PASS ]
Running ./httpd_servehtml_ssl.sh - httpd serve html page test over SSL.
==> [ PASS ]
Running ./httpd_vhost.sh - httpd virtual host test.
Reloading httpd configuration (via systemctl):            [  OK  ]
==> [ PASS ]
</pre>
}}
}}


[[Category:Package_httpd_test_cases]]
[[Category:Package_httpd_test_cases]]
[[Category:Critical_path_test_cases]]

Latest revision as of 08:29, 29 August 2024

Description

This test case ensures that the httpd (Apache HTTP Server) is installed correctly, starts properly, serves content, and can be managed through systemd.

Setup

  1. Install the httpd package if it is not already installed: sudo dnf install httpd

How to test

  1. Start the httpd service: sudo systemctl start httpd
  2. Enable the httpd service to start on boot: sudo systemctl enable httpd
  3. Verify that the httpd service is running: sudo systemctl status httpd
  4. Create a simple HTML file to serve:

printf '<html><body><h1>Hello, Fedora!</h1></body></html>\n' | sudo tee /var/www/html/index.html

  1. Open a web browser and navigate to http://localhost/ to see the served content.
  2. Check the Apache configuration file for errors: sudo apachectl configtest
  3. Reload the httpd service to apply any configuration changes: sudo systemctl reload httpd

Expected Results

  1. The httpd package should install without errors.
  2. The httpd service should start without errors and be enabled to start on boot.
  3. The status command should indicate that httpd is active and running.
  4. Navigating to http://localhost/ should display "Hello, Fedora!" in the web browser.
  5. The apachectl configtest command should return "Syntax OK".
  6. The httpd service should reload without errors.

Optional

For additional testing:

  1. Configure a virtual host and verify it serves content correctly.
  2. Enable and test SSL support by generating a self-signed certificate.
  3. Test serving different types of files (e.g., images, scripts) and using different modules.