Skip to main content
Version: Current

Validate a Scenario

Use cxc validate to check a CRADLE specification's syntax and structure.

Validate a scenario​

Pass the scenario path to cxc validate with -i. For the Hello World example, run:

cxc validate -i scenarios/HelloWorld.cradle

If the scenario is valid, CradleXC prints a checkmark and a short summary.

Show the successful validation result
✓ scenarios/HelloWorld.cradle is valid
instances: 2
networks: 1
events: 1 (pre=0, main=1, post=0)
objects: 1

The first line confirms that validation succeeded. The remaining lines count the scenario elements CradleXC found:

ResultMeaning
instances: 2Two machines: win7 and router.
networks: 1One network: lan_0.
events: 1 (pre=0, main=1, post=0)One main event and no events in the other phases.
objects: 1One declared object: HelloWorld.

If validation fails, CradleXC prints diagnostics identifying the source that needs to be corrected.

note

Validation checks syntax and structure only. A backend plugin is not required. A successful result does not verify that referenced configurations, heuristics, images or artifacts are available, or that provisioning and events will succeed.

Fix validation errors​

If validation fails, review the diagnostics returned by CradleXC.

The reported information can help identify problems such as:

  • malformed CRADLE syntax
  • incomplete declarations
  • incorrectly structured statements
  • unexpected values or tokens

Correct the relevant .cradle source and run validation again:

cxc validate -i scenarios/HelloWorld.cradle

Repeat this process until the scenario validates successfully.

For broader troubleshooting guidance, see Troubleshooting.

Inspect deployment IR separately​

For compiler inspection, cxc dump-ir writes deployment IR JSON to standard output:

cxc dump-ir -i scenarios/HelloWorld.cradle

This is a separate operation from a syntax and structure check.

Generate backend files separately​

When target-specific files are needed, use a compatible backend plugin:

cxc build -i scenarios/HelloWorld.cradle --target <plugin_name> -o /path/to/output

Backend generation is covered in Use a Backend.

Next steps​