expliot.core.ui.cli

Command-line and console feature for EXPLIoT.

Package Contents

Classes

TestSuite

Test Suite class inherits from dict and stores all the test cases

Cli

The main command line interpreter for EXPLIoT console. It inherits Cmd2

class expliot.core.ui.cli.TestSuite(pkgname='expliot.plugins')

Bases: dict

Test Suite class inherits from dict and stores all the test cases from plugins package name specified in __init__().

testcls
import_plugins(pkgname)

Import all tests from the specified package into a dict.

Parameters

pkgname – The package to load all test case plugins from

Returns

class expliot.core.ui.cli.Cli(prompt=None, intro=None)

Bases: cmd2.Cmd

The main command line interpreter for EXPLIoT console. It inherits Cmd2 package for commandline functionality and adds EXPLIoT specific commands. It also initializes the plugins for execution.

Current EXPLIoT commands defined are:

  1. list: To list available plugins (test cases)

  2. run: Execute a specific plugin (test case)

  3. exit: An alias for Cmd2 quit command

do_exit
del_defaultcmds()

Delete/remove the default commands from cmd2.

Args:

None

Returns:

Nothing

do_list(args)

List the available plugins (test cases)

do_run(arglist)

Execute a specific plugin (test case). For details: ef> run -h

complete_run(text, line, start_index, end_index)

Tab completion method for run command. It shows the list of available plugins that match the subcommand specified by the user.

Args:

text (str): Run subcommand string specified by the user line (str): The whole run command string typed by the user start_index (int): Start index subcommand in the line end_index (int): End index of the subcommand in the line

Returns:

List of matching subcommands(plugins)

runtest(name, arglist)

Run a single test case from the TestSuite if it exists.

Args:

name (str): Name of the plugin (test case) to run arglist (list): Argument list to be passed to the plugin for parsing

Returns:

Nothing