User's Guide
Reference Manual
Release Notes
PDF
Top

Common Test
Reference Manual
Version 1.11.1

Expand All
Contract All

Table of Contents

- common_test
  - Top of manual page
  - Module:all/0
  - Module:groups/0
  - Module:suite/0
  - Module:init_per_suite/1
  - Module:end_per_suite/1
  - Module:group/1
  - Module:init_per_group/2
  - Module:end_per_group/2
  - Module:init_per_testcase/2
  - Module:end_per_testcase/2
  - Module:Testcase/0
  - Module:Testcase/1
- ct_run
- ct
  - Top of manual page
  - abort_current_testcase/1
  - add_config/2
  - break/1
  - break/2
  - capture_get/0
  - capture_get/1
  - capture_start/0
  - capture_stop/0
  - comment/1
  - comment/2
  - continue/0
  - continue/1
  - decrypt_config_file/2
  - decrypt_config_file/3
  - encrypt_config_file/2
  - encrypt_config_file/3
  - fail/1
  - fail/2
  - get_config/1
  - get_config/2
  - get_config/3
  - get_event_mgr_ref/0
  - get_status/0
  - get_target_name/1
  - get_testspec_terms/0
  - get_testspec_terms/1
  - get_timetrap_info/0
  - install/1
  - listenv/1
  - log/1
  - log/2
  - log/3
  - log/4
  - make_priv_dir/0
  - notify/2
  - pal/1
  - pal/2
  - pal/3
  - pal/4
  - parse_table/1
  - print/1
  - print/2
  - print/3
  - print/4
  - reload_config/1
  - remove_config/2
  - require/1
  - require/2
  - run/1
  - run/2
  - run/3
  - run_test/1
  - run_testspec/1
  - sleep/1
  - start_interactive/0
  - step/3
  - step/4
  - stop_interactive/0
  - sync_notify/2
  - testcases/2
  - timetrap/1
  - userdata/2
  - userdata/3
- ct_master
  - Top of manual page
  - abort/0
  - abort/1
  - basic_html/1
  - get_event_mgr_ref/0
  - progress/0
  - run/1
  - run/3
  - run/4
  - run_on_node/2
  - run_on_node/3
  - run_test/2
- ct_cover
  - Top of manual page
  - add_nodes/1
  - cross_cover_analyse/2
  - remove_nodes/1
- ct_ftp
  - Top of manual page
  - cd/2
  - close/1
  - delete/2
  - get/3
  - ls/2
  - open/1
  - put/3
  - recv/2
  - recv/3
  - send/2
  - send/3
  - type/2
- ct_ssh
  - Top of manual page
  - apread/4
  - apread/5
  - apwrite/4
  - apwrite/5
  - aread/3
  - aread/4
  - awrite/3
  - awrite/4
  - close/2
  - close/3
  - connect/1
  - connect/2
  - connect/3
  - del_dir/2
  - del_dir/3
  - delete/2
  - delete/3
  - disconnect/1
  - exec/2
  - exec/3
  - exec/4
  - get_file_info/2
  - get_file_info/3
  - list_dir/2
  - list_dir/3
  - make_dir/2
  - make_dir/3
  - make_symlink/3
  - make_symlink/4
  - open/3
  - open/4
  - opendir/2
  - opendir/3
  - position/3
  - position/4
  - pread/4
  - pread/5
  - pwrite/4
  - pwrite/5
  - read/3
  - read/4
  - read_file/2
  - read_file/3
  - read_file_info/2
  - read_file_info/3
  - read_link/2
  - read_link/3
  - read_link_info/2
  - read_link_info/3
  - receive_response/2
  - receive_response/3
  - receive_response/4
  - rename/3
  - rename/4
  - send/3
  - send/4
  - send/5
  - send_and_receive/3
  - send_and_receive/4
  - send_and_receive/5
  - send_and_receive/6
  - session_close/2
  - session_open/1
  - session_open/2
  - sftp_connect/1
  - subsystem/3
  - subsystem/4
  - write/3
  - write/4
  - write_file/3
  - write_file/4
  - write_file_info/3
  - write_file_info/4
- ct_netconfc
  - Top of manual page
  - action/2
  - action/3
  - close_session/1
  - close_session/2
  - copy_config/3
  - copy_config/4
  - create_subscription/1
  - create_subscription/2
  - create_subscription/3
  - create_subscription/4
  - create_subscription/5
  - create_subscription/6
  - delete_config/2
  - delete_config/3
  - edit_config/3
  - edit_config/4
  - edit_config/5
  - get/2
  - get/3
  - get_capabilities/1
  - get_capabilities/2
  - get_config/3
  - get_config/4
  - get_event_streams/2
  - get_event_streams/3
  - get_session_id/1
  - get_session_id/2
  - hello/1
  - hello/2
  - hello/3
  - kill_session/2
  - kill_session/3
  - lock/2
  - lock/3
  - only_open/1
  - only_open/2
  - open/1
  - open/2
  - send/2
  - send/3
  - send_rpc/2
  - send_rpc/3
  - unlock/2
  - unlock/3
- ct_rpc
  - Top of manual page
  - app_node/2
  - app_node/3
  - app_node/4
  - call/4
  - call/5
  - call/6
  - cast/4
  - cast/5
- ct_snmp
  - Top of manual page
  - get_next_values/3
  - get_values/3
  - load_mibs/1
  - register_agents/2
  - register_users/2
  - register_usm_users/2
  - set_info/1
  - set_values/4
  - start/2
  - start/3
  - stop/1
  - unload_mibs/1
  - unregister_agents/1
  - unregister_agents/2
  - unregister_users/1
  - unregister_users/2
  - unregister_usm_users/1
  - unregister_usm_users/2
- ct_telnet
  - Top of manual page
  - close/1
  - cmd/2
  - cmd/3
  - cmdf/3
  - cmdf/4
  - expect/2
  - expect/3
  - format_data/2
  - get_data/1
  - open/1
  - open/2
  - open/3
  - open/4
  - send/2
  - send/3
  - sendf/3
  - sendf/4
- unix_telnet
  - Top of manual page
  - connect/6
  - get_prompt_regexp/0
- ct_slave
  - Top of manual page
  - start/1
  - start/2
  - start/3
  - stop/1
  - stop/2
- ct_hooks
  - Top of manual page
  - Module:init/2
  - Module:pre_init_per_suite/3
  - Module:post_init_per_suite/4
  - Module:pre_init_per_group/3
  - Module:post_init_per_group/4
  - Module:pre_init_per_testcase/3
  - Module:post_end_per_testcase/4
  - Module:pre_end_per_group/3
  - Module:post_end_per_group/4
  - Module:pre_end_per_suite/3
  - Module:post_end_per_suite/4
  - Module:on_tc_fail/3
  - Module:on_tc_skip/3
  - Module:terminate/1
  - Module:id/1
- ct_property_test
  - Top of manual page
  - init_per_suite/1
  - quickcheck/2

# ct_run

### COMMAND

ct_run

### COMMAND SUMMARY

Program used for starting Common Test from the OS command line.

### DESCRIPTION

The ct_run program is automatically installed with Erlang/OTP and Common Test (please see the Installation chapter in the Common Test User's Guide for more information). The program accepts a number of different start flags. Some flags trigger ct_run to start the Common Test application and pass on data to it. Some flags start an Erlang node prepared for running Common Test in a particular mode.

There is an interface function that corresponds to this program, called ct:run_test/1, for starting Common Test from the Erlang shell (or an Erlang program). Please see the ct man page for details.

ct_run also accepts Erlang emulator flags. These are used when ct_run calls erl to start the Erlang node (making it possible to e.g. add directories to the code server path, change the cookie on the node, start additional applications, etc).

With the optional flag:

    -erl_args

it's possible to divide the options on the ct_run command line into two groups, one that Common Test should process (those preceding -erl_args), and one it should completely ignore and pass on directly to the emulator (those following -erl_args). Options preceding -erl_args that Common Test doesn't recognize, also get passed on to the emulator untouched. By means of -erl_args the user may specify flags with the same name, but with different destinations, on the ct_run command line.

If -pa or -pz flags are specified in the Common Test group of options (preceding -erl_args), relative directories will be converted to absolute and re-inserted into the code path by Common Test (to avoid problems loading user modules when Common Test changes working directory during test runs). Common Test will however ignore -pa and -pz flags following -erl_args on the command line. These directories are added to the code path normally (i.e. on specified form)

Exit status is set before the program ends. Value 0 indicates a successful test result, 1 indicates one or more failed or auto-skipped test cases, and 2 indicates test execution failure.

If ct_run is called with option:

    -help

it prints all valid start flags to stdout.

### Run tests from command line

    	ct_run -dir TestDir1 TestDir2 .. TestDirN |
    	  [-dir TestDir] -suite Suite1 Suite2 .. SuiteN
    	   [-group Groups1 Groups2 .. GroupsN] [-case Case1 Case2 .. CaseN]
    	 [-step [config | keep_inactive]]
    	 [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
    	 [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
    	  ConfigString2 and .. CallbackModuleN ConfigStringN]
    	 [-decrypt_key Key] | [-decrypt_file KeyFile]
    	 [-label Label]
    	 [-logdir LogDir]
    	 [-logopts LogOpts]
    	 [-verbosity GenVLevel | [Category1 VLevel1 and
    	  Category2 VLevel2 and .. CategoryN VLevelN]]
    	 [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
    	 [-stylesheet CSSFile]
    	 [-cover CoverCfgFile]
    	 [-cover_stop Bool]
    	 [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
             [-event_handler_init EvHandler1 InitArg1 and
    	  EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
    	 [-include InclDir1 InclDir2 .. InclDirN]
    	 [-no_auto_compile]
    	 [-abort_if_missing_suites]
    	 [-muliply_timetraps Multiplier]
    	 [-scale_timetraps]
    	 [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
             [-repeat N] |
             [-duration HHMMSS [-force_stop [skip_rest]]] |
             [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
    	 [-basic_html]
        	 [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
    	  CTHModuleN CTHOptsN]
    	 [-exit_status ignore_config]
    	 [-help]

### Run tests using test specification

    	ct_run -spec TestSpec1 TestSpec2 .. TestSpecN
    	 [-join_specs]
    	 [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
    	 [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
              ConfigString2 and .. and CallbackModuleN ConfigStringN]
    	 [-decrypt_key Key] | [-decrypt_file KeyFile]
    	 [-label Label]
    	 [-logdir LogDir]
    	 [-logopts LogOpts]
    	 [-verbosity GenVLevel | [Category1 VLevel1 and
    	  Category2 VLevel2 and .. CategoryN VLevelN]]
    	 [-allow_user_terms]
    	 [-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
    	 [-stylesheet CSSFile]
    	 [-cover CoverCfgFile]
    	 [-cover_stop Bool]
    	 [-event_handler EvHandler1 EvHandler2 .. EvHandlerN] |
             [-event_handler_init EvHandler1 InitArg1 and
    	  EvHandler2 InitArg2 and .. EvHandlerN InitArgN]
    	 [-include InclDir1 InclDir2 .. InclDirN]
    	 [-no_auto_compile]
    	 [-abort_if_missing_suites]
    	 [-muliply_timetraps Multiplier]
    	 [-scale_timetraps]
    	 [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
             [-repeat N] |
             [-duration HHMMSS [-force_stop [skip_rest]]] |
             [-until [YYMoMoDD]HHMMSS [-force_stop [skip_rest]]]
    	 [-basic_html]
        	 [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
    	  CTHModuleN CTHOptsN]
    	 [-exit_status ignore_config]

### Run tests in web based GUI

            ct_run -vts [-browser Browser]
             [-dir TestDir1 TestDir2 .. TestDirN] |
             [[dir TestDir] -suite Suite [[-group Group] [-case Case]]]
    	 [-config ConfigFile1 ConfigFile2 .. ConfigFileN]
    	 [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
              ConfigString2 and .. and CallbackModuleN ConfigStringN]
    	 [-logopts LogOpts]
    	 [-verbosity GenVLevel | [Category1 VLevel1 and
    	  Category2 VLevel2 and .. CategoryN VLevelN]]
    	 [-decrypt_key Key] | [-decrypt_file KeyFile]
    	 [-include InclDir1 InclDir2 .. InclDirN]
    	 [-no_auto_compile]
    	 [-abort_if_missing_suites]
    	 [-muliply_timetraps Multiplier]
    	 [-scale_timetraps]
    	 [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
    	 [-basic_html]

### Refresh the HTML index files

    	ct_run -refresh_logs [-logdir LogDir] [-basic_html]

### Run CT in interactive mode

    	ct_run -shell
    	 [-config ConfigFile1 ConfigFile2 ... ConfigFileN]
    	 [-userconfig CallbackModule1 ConfigString1 and CallbackModule2
              ConfigString2 and .. and CallbackModuleN ConfigStringN]
    	 [-decrypt_key Key] | [-decrypt_file KeyFile]

### Start a Common Test Master node

    	ct_run -ctmaster

### See also

Please read the Running Test Suites chapter in the Common Test User's Guide for information about the meaning of the different start flags.