Search Results

How can I add tags to a test package being executed from the command line?

The cdrouter command line interface (CLI) allows tags to be specified for the current package being executed by supplying a -tags argument. The -tags argument accepts a comma separated list. Tags may include spaces and other characters.

Here is an example demonstrating four tags, each specified in a different manner:

cdrouter -tags tag1,"tag2 has spaces",\`date +%A\`,\$USERNAME -package demo\_test

In this example, four tags are specified while executing the demo_test package.

  • The first tag is set to tag1.

  • The second tag demonstrates that spaces are allowable characters: tag2 has spaces. Note that it must be enclosed in quotation marks to be passed as a single argument from the shell, however.

  • The third tag is an example of a subshell. The backtick ` signifies that a command should first be run, and its output will replace the original call to the command. In this example, the date command will print the name of today, so for today the third tag will be Wednesday, but tomorrow Thursday, and so on. The effect of this is that one can create dynamic tags that may show trends in behavior. Consider if the firmware version was dynamically output. A test engineer could easily correlate behavior based upon revision history.

  • The fourth tag is the user running the cdrouter command, which provides a simple audit trail for very little work.