tree: 511e4a5c4b100664a0d90f86aa0aa15e6699f22e [path history] [tgz]
  1. testdata/
  2. utils/
  3. .gitignore
  4. FTC1.sh
  5. FTC10.sh
  6. FTC100.sh
  7. FTC110.sh
  8. FTC150.sh
  9. FTC300.sh
  10. FTC301.sh
  11. FTC310.sh
  12. FTC800.sh
  13. FTC810.sh
  14. FTC900.sh
  15. README.md
  16. Suite-interfaces.sh
test/auto-test/README.md

Automated test Description

This auto-test repo stores test script for automated test cases for Policy Agent. Each of the testcase script will bring up a containerized test enviroment for Policy Agent, CBS, consul, and simulator(TBD).

Overview

Right now, test cases are written in bash scripts.
Each test case script(ex. FTC1.sh) will call functions defined in ../common.
The environment vriables are set intest_env.sh.
The automated test support both local build Policy Agent image testing and remote image stored in Nexus.

# Local image
export POLICY_AGENT_LOCAL_IMAGE=o-ran-sc/nonrtric-policy-agent
# Remote image
export POLICY_AGENT_REMOTE_IMAGE=nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent

Test Cases Description(more TBD)

FTC1.sh: Test policy-agent can refresh configurations from consul

Logs

All log files are stored at logs/<testcase id>.
The logs include the application.log and the container log from Policy Agent, the container logs from each simulator and the test case log (same as the screen output).
In the test cases the logs are stored with a prefix so the logs can be stored at different steps during the test. All test cases contains an entry to save all logs with prefix 'END' at the end of each test case.

Manual

Test case command:

./<testcase-id>.sh local | remote

Discription:
local: test image: POLICY_AGENT_LOCAL_IMAGE=o-ran-sc/nonrtric-policy-agent
remote: test image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent

Test case categories

1-99 - Basic sanity tests

100-199 - API tests

300-399 - Config changes and sync

800-899 - Stability and capacity test

900-999 - Misc test

Suites

Test case file

A test case file contains a number of steps to verify a certain functionality. A description of the test case should be given to the TC_ONELINE_DESCR var. The description will be printed in the test result.

The empty template for a test case files looks like this:

(Only the parts noted with < and > shall be changed.)


#!/usr/bin/env bash

TC_ONELINE_DESCR="<test case description>"

. ../common/testcase_common.sh $1

#### TEST BEGIN ####


<tests here>


#### TEST COMPLETE ####

store_logs          END


The ../common/testcase_common.sh contains all functions needed for the test case file. See the README.md file in the ../common dir for a description of all available functions.