USM Manifest Validate Command
Overview
The usm manifest validate command performs comprehensive validation of USM packages by building and installing them in a temporary environment, then verifying that all declared resources are present and correctly located.
Usage
usm manifest validate [build path]
Parameters
- build path (optional): Directory where the package will be built. If not specified, a temporary directory will be created automatically.
Validation Process
The validate command performs the following checks in sequence:
- Manifest Validation: Verifies that MANIFEST.usm can be read and parsed correctly
- Dependency Check: Ensures all required dependencies are available
- License Check: Warns if no license has been provided
- Build Execution: Runs the build script with progress reporting
- Install Execution: Runs the install script to a temporary directory
- Resource Validation: Verifies all declared resources exist at their expected locations
- Unexpected Resource Detection: Warns about resources found in install directory but not declared
Resource Validation
The command validates each resource based on its path base type:
- as-expected: Checks if the file exists at the expected location in the install directory
- build:: Checks if the file exists at the specified path in the build directory
- source:: Checks if the file exists at the specified path in the source directory
- install:: Checks if the file exists at the specified path in the install directory
Exit Codes
- 0: Validation completed successfully
- 247: Error validating installation result
- 248: Expected resources not found
- 249: Error running install exec
- 250: Could not create temporary install directory
- 251: Error running build exec
- 252: Missing dependencies
- 253: Could not read MANIFEST.usm
- 254: No MANIFEST.usm file found
- 255: Could not create temporary build directory
Examples
Basic validation with automatic temporary directory:
usm manifest validate
Validation with specified build directory:
usm manifest validate /tmp/usm-build
Output
The command provides detailed feedback about:
- Missing dependencies
- License warnings
- Build progress
- Missing expected resources with location details
- Unexpected resources found in install directory
- Final validation status
Integration with CI/CD
The validate command is designed for use in continuous integration environments:
- Non-zero exit codes indicate validation failures
- Detailed error messages help identify issues quickly
- Progress reporting works well with CI logging systems
- Temporary directory cleanup ensures no side effects
Comparison with Other Commands
- autoprovides: Scans and generates the provides section, while validate checks if existing provides are correct
- test: Runs package tests, while validate verifies the package structure and resources
- install: Installs to the system, while validate installs to a temporary directory for verification only