- Scope
- System Requirements
- Quick Start
- Makefile Reference
- Development Workflow
- Integration Testing
- Additional Resources
- Developing New Redfish Integration Tests
- Test Organization Best Practices
- Advanced Testing Techniques
- Debugging Tests
- Continuous Integration
- Common Pitfalls
- Test Maintenance
- Resources
- Examples
This repository focuses on Redfish OpenAPI tooling and DMTF schema sources.
- OpenAPI source schemas:
openapi/dmtf - Tooling scripts and Make targets:
openapi/infra - Local generated outputs (not committed):
openapi/artifacts
Integration tests require the Console repository. Set CONSOLE_REPO to point to your local checkout:
- Example:
/path/to/console/redfish/tests/run_tests.sh - Run with:
make -C openapi/infra rf-integration-test CONSOLE_REPO=/path/to/console
- Operating System: Ubuntu 22.04 or later
- Go: 1.24 or higher
- Python 3.x
- PyYAML package
- Node.js 16 or higher
- npm
- Newman (
npm install -g newman) - curl
Optional:
newman-reporter-htmlextra(npm install -g newman-reporter-htmlextra)
All commands below should be run from openapi/infra:
cd openapi/infraEquivalent from repository root:
make -C openapi/infra <target>Check environment and install dependencies:
make rf-check-tools
make rf-depsRun the complete workflow:
make rf-allRun integration tests:
make -C openapi/infra rf-integration-test CONSOLE_REPO=/path/to/consoleCustom test port example:
HTTP_PORT=9090 make rf-integration-test CONSOLE_REPO=/path/to/consolemake help: show all available targetsmake rf-check-tools: verify required tools
make rf-deps: install and verify required dependenciesmake rf-install-missing-tools: install only missing dependencies
make rf-merge: merge DMTF YAML files into a single OpenAPI specmake rf-validate: validate merged OpenAPI specmake rf-generate: generate Go code from merged OpenAPI specmake rf-auth: add Basic Auth security to OpenAPI spec and regeneratemake rf-metadata-generate: generate metadata.xml from DMTF schemas
make rf-all: full pipeline (merge, generate, validate, auth, metadata)make rf-clean: remove generated files
make rf-integration-test: run Newman integration tests via sibling Console runner
From repository root:
make -C openapi/infra rf-integration-test CONSOLE_REPO=/path/to/console
-
Verify environment:
make rf-check-tools
-
Install dependencies if needed:
make rf-deps
-
Make API/schema changes:
- Edit YAML in
openapi/dmtf - Keep schema references consistent
- Follow DMTF Redfish schema format
- Edit YAML in
-
Regenerate local artifacts:
make rf-all
-
Run tests:
make -C openapi/infra rf-integration-test CONSOLE_REPO=/path/to/console
make rf-merge
make rf-validate
make rf-generate
make rf-auth
make rf-metadata-generateIntegration tests provide black-box HTTP API validation for Redfish behavior and regressions using Newman.
- Type: Black-box API tests
- Framework: Newman (Postman CLI)
- Test Data: Mock WSMAN repository (in sibling Console project)
- Default Port: 8181 (configurable with
HTTP_PORT)
From this repository:
make -C openapi/infra rf-integration-test CONSOLE_REPO=/path/to/consoleFrom Console repository directly:
cd /path/to/console
bash redfish/tests/run_tests.shEndpoint coverage:
- Service Root (
/redfish/v1/) - OData Service Document (
/redfish/v1/odata) - Metadata Document (
/redfish/v1/$metadata) - Systems Collection (
/redfish/v1/Systems) - Individual System (
/redfish/v1/Systems/{id}) - Power Control Actions
Functional coverage:
- Authentication behavior (public and protected endpoints)
- Power actions (
On,ForceOff,ForceRestart,GracefulShutdown,PowerCycle) - Error handling (
400,401,404,405) - DMTF compliance checks (headers, response structure)
- Edge cases (invalid IDs, malformed payloads)
- Build application from source
- Start test server with mock data
- Wait for readiness on
/redfish/v1/ - Execute Newman collection
- Generate reports
- Cleanup server process
- CLI output: terminal output
- JSON report:
/path/to/console/redfish/tests/postman/results/newman-report.json - Server log:
/tmp/redfish_test_server.log
Server fails to start:
cat /tmp/redfish_test_server.log
lsof -i :8181Tests fail:
- Verify Newman installation:
newman --version - Ensure no process is bound to test port
- Review server logs for startup or auth issues
Version checks:
go version
python3 --version
node --version
newman --versionInstall Newman:
npm install -g newman
npm install -g newman-reporter-htmlextraIntegration tests use Newman collections in sibling Console repository to validate Redfish API conformance with deterministic mock-backed test data.
Primary components (sibling Console repository):
- Collection:
/path/to/console/redfish/tests/postman/redfish-collection.json - Environment:
/path/to/console/redfish/tests/postman/test-environment.json - Runner script:
/path/to/console/redfish/tests/run_tests.sh - Mock repository:
/path/to/console/redfish/internal/mocks/mock_repo.go
Recommended from this repository:
cd openapi/infra
make rf-integration-test CONSOLE_REPO=/path/to/consoleDirect Newman execution from sibling Console repository:
cd /path/to/console
newman run redfish/tests/postman/redfish-collection.json \
--environment redfish/tests/postman/test-environment.jsonStep 1: Identify scenario
- New endpoint
- Error handling path
- Authentication behavior
- DMTF compliance behavior
Step 2: Add request in collection
{
"name": "Get System by ID",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"pm.test('Status code is 200', function () {",
" pm.response.to.have.status(200);",
"});"
]
}
}
],
"request": {
"method": "GET",
"auth": {
"type": "basic"
},
"url": "{{base_url}}/redfish/v1/Systems/{{system_id}}"
}
}Step 3: Add assertions
pm.test('OData-Version header is 4.0', function () {
pm.expect(pm.response.headers.get('OData-Version')).to.equal('4.0');
});
pm.test('Response includes standard odata fields', function () {
var jsonData = pm.response.json();
pm.expect(jsonData).to.have.property('@odata.id');
pm.expect(jsonData).to.have.property('@odata.type');
});Step 4: Organize folders
- Public Endpoints
- Protected Endpoints
- Power Control Actions
- Authentication Tests
- Error Handling Tests
Step 5: Update mock data if required
- Modify
/path/to/console/redfish/internal/mocks/mock_repo.go
Step 6: Test locally
cd openapi/infra
make rf-integration-test CONSOLE_REPO=/path/to/consoleStep 7: Update environment variables if needed
- Add new keys to
/path/to/console/redfish/tests/postman/test-environment.json
Redfish API Tests
|-- Public Endpoints (no auth)
|-- Protected Endpoints (Basic Auth)
|-- Power Control Actions
|-- Authentication Tests
`-- Error Handling Tests
- Folder names: endpoint/function category
- Request names: Action + Resource
- Test names: precise assertion purpose
For each endpoint, verify:
- Success path (
200/202) - Required headers
- Response schema fields
- Unauthorized request behavior (
401) - Invalid request behavior (
400) - Not found behavior (
404) - Method not allowed (
405) - Error payload format
var jsonData = pm.response.json();
pm.collectionVariables.set('extracted_id', jsonData.Id);var timestamp = new Date().getTime();
pm.collectionVariables.set('timestamp', timestamp);pm.test('Optional property validation', function () {
var jsonData = pm.response.json();
if (jsonData.PowerState === 'On') {
pm.expect(jsonData).to.have.property('ProcessorSummary');
}
});pm.test('Response time under 200ms', function () {
pm.expect(pm.response.responseTime).to.be.below(200);
});View server logs:
cat /tmp/redfish_test_server.logRun one folder only:
cd /path/to/console/redfish/tests/postman
newman run redfish-collection.json --environment test-environment.json --folder "Power Control Actions"Verbose Newman output:
cd /path/to/console/redfish/tests/postman
newman run redfish-collection.json --environment test-environment.json --verboseIntegration tests are designed to run in CI and fail builds if assertions fail.
Typical CI steps:
- Checkout
- Setup Go
- Run test script
- Upload test results
- Publish summary
- Authentication mismatch between endpoint and auth mode
- Startup timing and first-request latency
- JSON structure assumptions without null checks
- Port conflicts on
8181 - Stateful test ordering interactions
Update tests when:
- New endpoints are added
- Existing API behavior changes
- Schema updates introduce or remove properties
- Regressions are fixed (add regression tests)
- DMTF updates require additional checks
Keep tests aligned with API spec:
- Paths should match OpenAPI definitions
- Security requirements should match endpoint behavior
- Response checks should match generated types and schema intent
- Status code assertions should include documented outcomes
{
"name": "Get Specific System",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', function () {",
" pm.response.to.have.status(200);",
"});",
"pm.test('Body has required fields', function () {",
" var body = pm.response.json();",
" pm.expect(body).to.have.property('Id');",
" pm.expect(body).to.have.property('Name');",
"});"
]
}
}
],
"request": {
"method": "GET",
"url": "{{base_url}}/redfish/v1/Systems/{{system_id}}"
}
}{
"name": "Reset System - ForceOff",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\"ResetType\":\"ForceOff\"}"
},
"url": "{{base_url}}/redfish/v1/Systems/{{system_id}}/Actions/ComputerSystem.Reset"
}
}{
"name": "Get System - Invalid ID",
"request": {
"method": "GET",
"url": "{{base_url}}/redfish/v1/Systems/invalid-id-12345"
},
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 404', function () {",
" pm.response.to.have.status(404);",
"});",
"pm.test('Redfish error object exists', function () {",
" var body = pm.response.json();",
" pm.expect(body).to.have.property('error');",
" pm.expect(body.error).to.have.property('code');",
" pm.expect(body.error).to.have.property('message');",
"});"
]
}
}
]
}