Testing: IHS Scenarios
Relevant source files
The following files were used as context for generating this wiki page:
The Testing: IHS Scenarios framework provides a structured methodology for validating the deployment, configuration, and patching of IBM HTTP Server (IHS) within the SPM Middleware project. Utilizing Molecule as the primary testing engine, these scenarios automate the lifecycle of an IHS instance—from infrastructure creation to the verification of installed packages and security configurations.
The scope of IHS testing covers multiple versions (v8.5 and v9.0) and distributions (e.g., Rocky Linux 8, CentOS 7), ensuring that the Ansible roles maintain idempotency and correctly handle complex dependencies like the IBM Installation Manager (IIM).
Sources: CONTRIBUTING.md:27-38, roles/ihs/README.md:1-12
Testing Infrastructure and Environment
The project employs a Molecule-based development environment that can be executed either via a Python virtual environment or within a Docker-in-Docker (DinD) container. This allows for consistent testing across different developer machines and CI/CD pipelines.
Molecule Test Lifecycle
The testing process follows the standard Molecule sequence to ensure the reliability of the IHS role. This sequence includes dependency resolution, linting, instance creation, role convergence (execution), idempotency checks, and final verification.
The diagram shows the standard Molecule test sequence used to validate IHS roles.
Sources: CONTRIBUTING.md:27-38
Execution Examples
To run tests for a specific IHS scenario, developers use the molecule test command with the appropriate scenario name.
| Scenario Name | Description |
|---|---|
ihs-v90-rockylinux8 | Tests IHS v9.0 installation on Rocky Linux 8 |
ihs-v85-centos-7 | Tests IHS v8.5 installation on CentOS 7 |
Sources: CONTRIBUTING.md:36, CONTRIBUTING.md:154
Installation and Upgrade Logic
Testing scenarios for IHS involve a multi-stage installation process managed through the roles/ihs/tasks/main.yml. The logic determines whether to perform a base installation or apply a fixpack based on the current state of the target system.
Deployment Workflow
The deployment logic checks for existing packages using the iim_info module and conditionally includes the relevant installation tasks.
This flowchart illustrates the decision logic within the IHS role to handle base installs vs. fixpacks.
Sources: roles/ihs/tasks/main.yml:1-32
Component Installation Details
During a base installation (e.g., v9.0), the system installs three primary components using IBM Installation Manager:
- IHS: IBM HTTP Server core.
- PLG: WebServer Plug-ins for IBM WebSphere Application Server.
- WCT: WebSphere Customization Toolbox.
Sources: roles/ihs/tasks/v90_base_install.yml:76-118
Configuration and Security Verification
The testing scenarios include a configure.yml stage that applies security settings and generates necessary certificates. These steps are verified during the verify phase of Molecule.
Security and Admin Configuration
The IHS testing scenarios validate the following configuration elements:
- Admin Authentication: Creation of the
admin.passwdfile usinghtpasswd. - Config Drop-ins: Verification that
httpd.confcorrectly includes theconf.d/*.confdirectory. - SSL/TLS: Creation of a Key Database (KDB) and generation of self-signed certificates for the WebSphere plugin.
| Task | Tool/Module | Target Path |
|---|---|---|
| Create Password | bin/htpasswd | conf/admin.passwd |
| Create KDB | bin/gskcapicmd | config/key.kdb |
| Generate Cert | bin/gskcapicmd | config/key.kdb (label: websphere) |
| PCT Definition | wctcmd.sh | WCT/ihs_responsefile.txt |
Sources: roles/ihs/tasks/configure.yml:1-55
Automated Verification
The verify.yml playbook (as seen in parallel WebSphere scenarios) typically asserts that:
- The
iim_info.packageslist contains the expected product IDs. - Configuration files contain specific required strings (e.g., environment variables in
/opt/profile.d/websphere.sh). - Necessary service ports are listening or binaries are patched correctly.
Sources: molecule/__websphere-v90/verify.yml:25-50
Scenario Variables and Parameters
IHS scenarios rely on version-specific variables defined in YAML files (e.g., v9.0.5.22.yml). These variables define the installer paths, product IDs (PIDs), and archive lists.
| Variable | Description |
|---|---|
ihs_install_path | Root directory for IHS installation (default: /opt/IBM/HTTPServer) |
ihs_pid | The specific version identifier for Installation Manager (e.g., v90~9.0.5022...) |
ihs_installer_archive_list | List of zip files required for base installation |
ihs_fp_installer_path | Directory path on the download server for fixpacks |
Sources: roles/ihs/README.md:14-40, roles/ihs/tasks/v90_base_install.yml:11-20
Summary
Testing IHS scenarios within the SPM Middleware project ensures that the IBM HTTP Server and its associated components are deployed consistently across various Linux distributions. By leveraging Molecule, the project automates the verification of complex IBM Installation Manager workflows, SSL certificate generation, and performance tuning configurations. This automated approach guarantees that changes to the middleware roles do not break the idempotency or functional correctness of the web server tier.