
-------------------------------------------General Introduce--------- -------------------------
This script contains several test cases, including android and linux release compilation tests
and binary check.


-----------------------------  ------------Directory Structure---------------------------------
"""
.
├── Profile
│   ├── android_build_test_config.yaml               # Android cases configuration file
│   ├── Jenkinsfile                                  # The jenkinsfile corresponding to the
                                                       following two jenkins jobs
│   ├── linux_build_test_config.yaml                 # Linux cases configuration file
│   └── prvfile.yaml                                 # binary list
├── README.md
├── run_test.py                                      # Program execution entry
├── test_script
│   ├── android_release_build.py                     # Android release build case
│   ├── code_init.sh
│   ├── linux_release_build.py                       # Linux release build case
│   ├── linux_release_check_package_tool_binary.py   # Check Linux package tool binarys
│   ├── linux_release_private_binary_check.py        # Check Linux release binary(ko/lib/so)
│   ├── logcheck.sh
│   ├── multi_build_clean.py                         # Cross-compilation testing for linux
│   ├── ptc.sh
│   ├── remove_source_dir.sh
│   └── reversion_init.sh
└── utilities
    ├── CixConfig.ini
    ├── CixConfig.py
    ├── CixPublic.py
    └── cix_run_test_log                             # All logs after execution will be stored here
        └── result_record.log                        # The log after filtering is saved here

4 directories, 20 files
"""

------------------------------------------------Usage--------------------------------------------
1: pre-condition
(1). Advised to use the configured jenkins job to execute the corresponding cases.
     Android: https://ci.cixtech.com/view/Android-14-build/job/android-repo-ci-release-build-test/
     Linux: https://ci.cixtech.com/view/linux-ci/job/linux-repo-ci-release_build_test/
(2). If using on a personal machine, make sure you have git access permission for cix, sec and
     private groups.If no permission, please contact CAD team Su Jing to add it.

2: Usage
The help information:
"""
usage: run_test.py [-h] [-n [NAME [NAME ...]]] [-a] [-d DIR] [-u URL] [-b BRANCH] [-m MANIFEST]
                   [-g GROUPS] [-c CONFIG] [-x NEXUS] [index [index ...]]

Cix AATM Run Test Entry

positional arguments:
  index                 Test case indexes

optional arguments:
  -h, --help            show this help message and exit
  -n [NAME [NAME ...]], --name [NAME [NAME ...]]
                        Test case names
  -a, --run-all         Run all available testcases in the test list
  -d DIR, --dir DIR     Initialize the directory for code
  -u URL, --url URL     source code url
  -b BRANCH, --branch BRANCH
                        source code branch
  -m MANIFEST, --manifest MANIFEST
                        source code manifest
  -g GROUPS, --groups GROUPS
                        source code groups
  -c CONFIG, --config CONFIG
                        Yaml name of test config
  -x NEXUS, --nexus NEXUS
                        release nexus url of images/rootfs.ext4
"""

3: Example
(1). If the case is executed through jenkins job, enter the corresponding parameters as prompted.
(2). If the case is executed on a local machine. Here are a few ways to do it.
    1. run all case
     python3 run_test.py -a -d /home/workspace-test \
    -u ssh://git@gitmirror.cixcomputing.com/linux_repo/cix-manifest -b cix_sky1_alpha0.9_dev \
    -m release/cix_sky1_Alpha0.9-rc2/default.xml -g cix,notdefault,ddk,sec \
    -c linux_build_test_config \
    -x linux-release/cix_sky1_alpha0.9/RC2/cix-fpga/2024030415-0001496/images/rootfs.ext4

    2. Run the case with the specified index.
     python3 run_test.py 21,22 -d /home/workspace-test \
    -u ssh://git@gitmirror.cixcomputing.com/linux_repo/cix-manifest -b cix_sky1_alpha0.9_dev \
    -m release/cix_sky1_Alpha0.9-rc2/default.xml -g cix,notdefault,ddk,sec \
    -c linux_build_test_config \
    -x linux-release/cix_sky1_alpha0.9/RC2/cix-fpga/2024030415-0001496/images/rootfs.ext4

    3. Run the case with the specified name.
     python3 run_test.py -n linux_release_private_binary_check -d /home/workspace-test \
    -u ssh://git@gitmirror.cixcomputing.com/linux_repo/cix-manifest -b cix_sky1_alpha0.9_dev \
    -m release/cix_sky1_Alpha0.9-rc2/default.xml -g cix,notdefault,ddk,sec \
    -c linux_build_test_config \
    -x linux-release/cix_sky1_alpha0.9/RC2/cix-fpga/2024030415-0001496/images/rootfs.ext4

    4. Case is specified at run time.
     python3 run_test.py -d /home/workspace-test \
    -u ssh://git@gitmirror.cixcomputing.com/linux_repo/cix-manifest -b cix_sky1_alpha0.9_dev \
    -m release/cix_sky1_Alpha0.9-rc2/default.xml -g cix,notdefault,ddk,sec \
    -c linux_build_test_config \
    -x linux-release/cix_sky1_alpha0.9/RC2/cix-fpga/2024030415-0001496/images/rootfs.ext4

    A list of cases for the selected configuration will be printed, and you can select
    which case to execute by entering index.
   """
    0 docker_build_and_clean_all_sec_serial
    1 docker_build_and_clean_all_private_serial
    2 docker_build_and_clean_all_serial
    3 docker_build_and_clean_all_sec_parallel
    4 docker_build_and_clean_all_private_parallel
    5 docker_build_and_clean_all_parallel
    6 docker_build_and_clean_all_sec_parallel_and_serial
    7 docker_build_and_clean_all_private_parallel_and_serial
    8 docker_build_and_clean_all_parallel_and_serial
    9 native_build_and_clean_all_sec_serial
    10 native_build_and_clean_all_private_serial
    11 native_build_and_clean_all_serial
    12 native_build_and_clean_all_sec_parallel
    13 native_build_and_clean_all_private_parallel
    14 native_build_and_clean_all_parallel
    15 native_build_and_clean_all_sec_parallel_and_serial
    16 native_build_and_clean_all_private_parallel_and_serial
    17 native_build_and_clean_all_parallel_and_serial
    18 switch_build_and_clean_all_private_docker_and_native
    19 switch_build_and_clean_all_sec_docker_and_native
    20 switch_build_and_clean_all_docker_and_native
    21 linux_release_check_package_tool_binary
    22 linux_release_private_binary_check
    Please select the testcase:

   """
-----------------------------------Result Check----------------------------------------
(1). If you select jenkins job execution, you can directly view some html format reports
     and result_record.log. You can also download the detailed log file.
(2). If executing on a local machine, view all logs under ./utilities/cix_run_test_log/
