Script Testing

Oracle FS CLI commands can have complex option settings. Oracle FS CLI provides a mean to test individual commands before placing them in a script.

Validate the syntax of a command before adding it your script using the global verify option. You can also use the global example option to display a sample list reply (xml or text) of the command.

-verify Option

When included with any command, the verify option inspects the syntax of the command.

The verify option does not perform semantic checks of option operands or execute the command. When a command fails during an Oracle FS CLI session, the Oracle FS System generates an error message and displays that error message in the command line. If there are no errors, the Oracle FS System returns a Valid : True statement.

The following is a code sample of the values returned using the verify option.
$ fscli account -list -verify

Valid : True
Valid : True

When Oracle FS CLI checks the syntax of a command, Oracle FS CLI may make more than one call in the background. If more than one call is made, the Oracle FS CLI returns more than one validity statement. No matter how many validity statements Oracle FS CLI returns, as long as all of them are Valid : True, the syntax is valid.

-example Option

To display a sample list reply (xml or text) of the command, use the example option. To get the XML example, add the -output option and the xml value to the command. The default example is the textual output. The following code samples demonstrate the syntax for the option as used with a command.

To display the example output for account list details in XML, use the following command:
account –list –details –example -outputformat xml
To display the example output for account list in plain text, include the -output option and the value text or do not specify any -output option at all:
fscli host_group -list -details -example -outputformat text
fscli account -list -details -example
Note: The example option only works with the list subcommand. Oracle FS CLI if the example option used with any other subcommand.