cli_tests.cfg #2

  • //
  • guest/
  • perforce_software/
  • sdp/
  • main/
  • test/
  • bsw/
  • cli_tests.cfg
  • View
  • Commits
  • Open Download .zip Download (4 KB)
# Test Data File for Command Line tests.
#
# Each test is a one-line entry of the form:
#
# <TestGroup>|<TestCmd>|<ExitCode>|<TestLog>|<ExpectedStringRegex>|<Comments>
# 
# Where:
# <TestGroup> is an arbitrary name used to apply to a group of tests, allowing that group
# of tests to be executed independently of other configured tests. By default, all
# tests are executed; call run_cli_tests.sh with '-g <TestGroup>' to indicate that the
# specified group of tests are to be run. This is intended to speed up interactive testing
# for a focused group of tests.
#
# <TestCmd> is the Perforce command to execute.  If it starts with 'p4 ', the
# 'p4 ' wll be substituted at runtime with 'p4 -p <port> -u <user> -c <client>',
# where the port/user/client values are dependint test configuration data in
# test_sdp.*.cfg  files.
#
# Alternately, the <TestCmd> can start with 'p4:user:client ', to execute
# commands as a user or in a workspace defined in the test entry.  The user
# is typically 'bruno' or some other user from the Perforce Sample Depot data set.
# 
# If the <TestCmd> does not start with 'p4 ' or 'p4:user:client ', it is deemed
# to be an arbitrary command and it is executed as is.
#
# The <TestCmd> value can also be the special value 'no_cmd', meaning that no
# test command is executed. This allows additional checks of logs to be done based
# on the execution of the most recent executed test.
#
# <ExitCode> is the expected exit code, which must be a whole number (integer 0 or
# greater). If the actual test exist code is not match, the test is deemed to have
# failed.  A special value of 'U' meaning Undefined can be given rather than a
# whole number to indicate that any exit code is accepted.  (The test may still fail
# depending on the <Output>). A special value of 'N' can be given to indicate that
# any non-zero exit code is accepted.
#
# <TestLog> Specify the absolute path to the log containing the expected string,
# or the special value 'output' to scan the output of the command rather than
# a log file.
#
# <ExpectedStringRegex> is a string of text expected of the executed command in
# either the ouptutor a given logfile. The string can be a regular expression.
#
# <Comments> are short comments for the human reviewer of the test, describing what
# is expected in the output, what is being tested, etc.

# Sample: Run 'p4 -s info -s' command. Expect a zero exit code with "Server version"
# in the output:
Info|p4 -s info -s|0|output|Server version|Basic p4 info command.

# Sample: Run 'p4 -s infox -s' (which does not exist). Expect a 1 exit code with "Unknown command"
# in the output:
#
Info|p4 -s infox -s|1|output|error: Unknown command.|Broken p4 info command.

# These next two entries are sample bogus test entries.  These will abort the
# sdp_test_suite.sh test run unless '-f' is used, in which case they'll just be
# ignored:
### p4 -s info -s|BogusExitCode|/p4/1/logs/log|blah|Sample bad test data entry.
### p4x -s info -s|U|/p4/1/logs/log|Blah|Sample bad test data entry.

# This is a real test:
Basic|p4login 1 -v|0|output|^Success:|Login test.
Basic|p4 -s configure show server.depot.root|0|output|^exit: 0$|Check server.depot.root value.
Basic|p4:earl:bruno_ws flush //depot/Jam/MAIN/src/Build.com|0|/p4/1/logs/log|user-flush|Check expected P4LOG writes.

# This example with 'U' (undefined) for expected the exit code and an empty value
# for the expected string would be for informational purposes only, since the
# test would never fail:
Info|p4 info|U||Sample test that should always succeed.

# Test Preflight check with root-owned state.xu file.
P4DPreflight|sudo chown root:root /p4/1/root/state.xu|0|||Test Setup: chown file be bogusly root-owned.
P4DPreflight|sudo systemctl restart p4d_1|U|||Test Setup: Start service
P4DPreflight|sleep 1|0|output||Test Setup: Sleep a bit.
P4DPreflight|no_cmd|U|/p4/1/logs/p4d_init.log|Error: /p4/1/root/state.xu is owned by root, expected perforce.|Should have refused to start service.
P4DPreflight|sudo chown perforce:perforce /p4/1/root/state.xu|0|||Test Cleanup: chown file back to normal.
P4DPreflight|sudo systemctl restart p4d_1|U|||Test Cleanup: Leaving the service running.
P4DPreflight|sleep 3|0|output||Test Cleanup: Sleep a bit to give service time to start.
# Change User Description Committed
#6 32135 C. Thomas Tyler Released SDP 2025.1.32133 (2025/10/29).
Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'.
#5 31566 C. Thomas Tyler Released SDP 2024.2.31564 (2025/05/14).
Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'.
#4 31369 C. Thomas Tyler Released SDP 2024.2.31367 (2025/03/23).
Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'.
#3 31204 Will Kreitzmann Released SDP 2024.2.31193 (2025/01/17).
Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'.
#2 31077 C. Thomas Tyler Released SDP 2024.2.31075 (2024/12/20).
Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'.
#1 30915 C. Thomas Tyler Released SDP 2024.1.30913 (2024/11/20).
Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'.
//guest/perforce_software/sdp/dev/test/bsw/cli_tests.cfg
#5 30747 C. Thomas Tyler Added Test Group concept to run_cli_tests.sh, with same meaning and
usage as in run_scripted_tests.sh. The goal is to allow running
a defined subset of tests.
#4 30742 C. Thomas Tyler Added support for specifying exit code as 'N' for non-zero.
#3 30711 C. Thomas Tyler Added support for 'no_cmd' test.
#2 30686 C. Thomas Tyler Enhanced CLI tests to be able to call arbitrary command lines
rather than just p4 commands.
#1 30622 C. Thomas Tyler Added files for initial SDP BSW test suite.