-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,075 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ popd > /dev/null # ${MY_DIR} | |
# Therefore in that case it warns you but doesnt' chnage to that version, which could cause your tests to break. | ||
# Change this to upgrade your ut-control Major versions. Non ABI Changes 1.x.x are supported, between major revisions | ||
|
||
UT_CONTROL_PROJECT_VERSION="1.5.1" # Fixed version | ||
UT_CONTROL_PROJECT_VERSION="1.6.0" # Fixed version | ||
|
||
# Clone the Unit Test Requirements | ||
[email protected]:rdkcentral/ut-control.git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Overview for release-test-script-platform.sh | ||
|
||
This Bash script is designed for automating the process of cloning a PR branch from platform test suite Git repository, building software, and validating build artifacts across multiple environments. It simplifies testing and development workflows by managing repository setup, environment-specific builds, and post-build checks for required binaries and libraries. | ||
It also checks for the existence of various third party packages like openssl, curl, cmake, gtest etc for various environments listed below. | ||
With these validations, it ensures if the PR is good for merge and has not broken the basic requirements. | ||
|
||
Following table gives the overview: | ||
|
||
|#|Target|Docker|Expectation | ||
|---|-----|-----------|--------- | ||
|1|./build_ut.sh TARGET=arm|rdk-dunfell|builds hal for target arm | ||
|2|./build_ut.sh TARGET=arm|rdk-kirkstone|builds hal for target arm | ||
|3|./build_ut.sh TARGET=linux|vm-sync|builds hal for target linux | ||
|4|./build_ut.sh TARGET=linux|none|builds hal for target linux | ||
|5|./build_ut.sh -C tests/ TARGET=arm|rdk-dunfell|builds hal tests for target arm | ||
|6|./build_ut.sh -C tests/ TARGET=arm|rdk-kirkstone|builds hal tests for target arm | ||
|7|./build_ut.sh -C tests/ TARGET=linux|vm-sync|builds hal tests for target linux | ||
|8|./build_ut.sh -C tests/ TARGET=linux|none|builds hal tests for target linux | ||
|
||
## Key Objectives: | ||
1. **Automated Repository Setup**: | ||
Clones a given Git repository (or a default one if not specified) for different target environments (e.g., Ubuntu, VM-SYNC, Dunfell Linux, Dunfell ARM). | ||
|
||
where: | ||
VM-SYNC : is a docker simulating the RDK linux environment | ||
Dunfell Linux : is a docker with linux environment | ||
Dunfell ARM : is a docker simulating the arm environment for yocto version dunfell | ||
Kirkstone ARM : is a docker simulating the arm environment for yocto version kirkstone | ||
|
||
2. **Environment-Specific Builds**: | ||
Runs a customized build process based on the environment. It supports branching logic to switch and build from a specific branch (`UT_CORE_BRANCH_NAME`) when provided. | ||
|
||
3. **Post-Build Checks**: | ||
After compiling, the script verifies: | ||
- The current branch matches the target branch. | ||
- The existence of specific libraries such as: | ||
- [ ] - **CURL static library** (`libcurl.a`) | ||
- [ ] - **OpenSSL static library** (`libssl.a`) | ||
- [ ] - **CMake binary** | ||
- [ ] - **HAL binary** | ||
- Each check outputs either `PASS` or `FAIL`, depending on whether the conditions are met. | ||
- The checks vary based on the environment, allowing for customized validation for each setup. | ||
|
||
4. **Cross-Environment Testing**: | ||
Supports testing on multiple environments for following packages: | ||
|
||
|
||
|#|ENV/PACKAGES|CMAKE(Host)|CURL(Target)|OPENSSL(Target)|GTEST(Target) | ||
|-----|----|--------|------|---------|----------| | ||
|1|Ubuntu+build essentials|NO|YES|NO|YES | ||
|2|VM-SYNC|YES|YES|YES|YES | ||
|3|RDK-DUNFELL(arm)|NO|YES|YES|YES | ||
|4|RDK-DUNFELL(linux)|NO|YES|NO|YES | ||
|5|RDK-KIRKSTONE(arm)|NO|YES|YES|YES | ||
|6|RDK-KIRKSTONE(linux)|NO|YES|NO|YES | ||
|
||
For ex: | ||
On env 1, the script will check for availability of CURL library, OpenSSL libraraies and Gtest libraries for Target.It would however would not look for CMAKE binary for host as this environment already provides cmake support which is provided by build essentials. | ||
On env 2, on the other hand, none of the packages are present , hence the script will check for all of the packages listed above. | ||
|
||
5. **Error Handling**: | ||
Provides error messaging and graceful exits if any step (cloning, building, or checking) fails, ensuring robust automation. | ||
|
||
6. **Output and Logs**: | ||
Generates detailed output, including build logs (`build_log.txt`), and provides real-time feedback about successes and failures for each environment. | ||
|
||
## Execution Flow: | ||
1. **Clone the repository** for each environment. | ||
2. **Run environment-specific builds** using the provided or default branch. | ||
3. **Perform checks** on the build output to ensure that necessary files are present. | ||
4. **Print results** for all environments in a summary format for review. | ||
|
||
This script is a powerful tool for managing multi-environment development workflows, allowing seamless switching between branches, running builds, and verifying output in a repeatable, automated fashion. | ||
|
||
## Caveats: | ||
- Observed that during some of the runs the build_log.txt have undefined reference error, however same is not observed while runing it on terminal (w/o using the script). | ||
In the rare case of the above occurence, user can run manually change to the respective directory, remove `ut/ut-core` and `ut/build/`, and trigger the command : `build_ut.sh TARGET=<TARGET>`.To print the results user can comment all the 4 commands at the end of the bash script except print_results and run the script as usual. | ||
- This script doesnot handle the case of `build_ut.sh TARGET=<TARGET> VARIANT=CPP` as this change is not available from platform test-suit as of now. This script only checks that the PR changes doesnot break the platform test-suit as it exists today. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Overview of release-test-script-ut-core.sh | ||
|
||
## Purpose | ||
This Bash script automates the process of cloning the PR branch on ut-core Git repository, building code, and validating build artifacts across multiple environments. It is designed to handle different system architectures (like ARM and x86) and environments (like Ubuntu, VM-SYNC, Dunfell Linux, Dunfell ARM), simplifying testing, building, and validation processes. | ||
where: | ||
VM-SYNC : is a docker simulating the RDK linux environment | ||
Dunfell Linux : is a docker with linux environment | ||
Dunfell ARM : is a docker simulating the arm environment for yocto version dunfell | ||
Kirkstone ARM : is a docker simulating the arm environment for yocto version kirkstone | ||
It checks for the existence of various third party packages like openssl, curl, cmake, gtest etc for various environments listed above. | ||
With these validations, it ensures if the PR is good for merge and has not broken the basic requirements. | ||
|
||
Following table gives the overview: | ||
|
||
|#|Target|Docker|Expectation | ||
|---|-----|-----------|--------- | ||
|1|make TARGET=arm|rdk-dunfell|builds ut-core for target arm | ||
|2|make TARGET=arm|rdk-kirkstone|builds ut-core for target arm | ||
|3|make TARGET=linux|vm-sync|builds ut-core for target linux | ||
|4|make TARGET=linux|none|builds ut-core for target linux | ||
|5|make -C tests/ TARGET=arm|rdk-dunfell|builds ut-core tests for target arm | ||
|6|make -C tests/ TARGET=arm|rdk-kirkstone|builds ut-core tests for target arm | ||
|7|make -C tests/ TARGET=linux|vm-sync|builds ut-core tests for target linux | ||
|8|make -C tests/ TARGET=linux|none|builds ut-core tests for target linux | ||
|
||
## Key Features | ||
|
||
1. **Repository Cloning**: | ||
- The script clones a specified branch from ut-core Git repository. | ||
- A default repository (`[email protected]:rdkcentral/ut-core.git`) is used if none is provided. | ||
|
||
2. **Environment-Specific Build Setup**: | ||
- Supports different environments such as Ubuntu, VM-SYNC, Dunfell Linux, and Dunfell ARM. | ||
- The script runs platform-specific build commands (e.g., `make` for Linux or ARM) in each environment. | ||
|
||
3. **Logging Build Outputs**: | ||
- The script runs the `make` command for different targets (e.g., `linux`, `arm`) and variants (`CPP`), and logs all outputs to files such as `make_log.txt`, `make_cpp_log.txt`, etc. | ||
- Logs can be reviewed in case of build failure. | ||
|
||
4. **Build Verification**: | ||
- After building, the script checks if key artifacts : | ||
- [ ] - static libraries - CURL, OpenSSL, GTest exist | ||
- [ ] - binaries - CMake exist. | ||
- Each environment has customized checks based on expected outputs (for instance, checking for the OpenSSL static library in some environments and not in others). | ||
|
||
5. **Error Handling**: | ||
- If any part of the process (cloning, building, or checking) fails, the script provides detailed error messages and exits. | ||
|
||
6. **Environment Support**: | ||
Supports testing on multiple environments for following packages: | ||
|
||
|
||
|#|ENV/PACKAGES|CMAKE(Host)|CURL(Target)|OPENSSL(Target)|GTEST(Target) | ||
|---|----|--------|------|---------|----------| | ||
|1|Ubuntu+build essentials|NO|YES|NO|YES | ||
|2|VM-SYNC|YES|YES|YES|YES | ||
|3|RDK-DUNFELL(arm)|NO|YES|YES|YES | ||
|4|RDK-DUNFELL(linux)|NO|YES|NO|YES | ||
|5|RDK-KIRKSTONE(arm)|NO|YES|YES|YES | ||
|6|RDK-KIRKSTONE(linux)|NO|YES|NO|YES | ||
|
||
For ex: | ||
On env 1, the script will check for availability of CURL library, OpenSSL libraraies and Gtest libraries for Target.It would however would not look for CMAKE binary for host as this environment already provides cmake support which is provided by build essentials. | ||
On env 2, on the other hand, none of the packages are present , hence the script will check for all of the packages listed above. | ||
|
||
|
||
|
||
## Usage Example | ||
```bash | ||
./release-test-script-ut-core.sh -t <BRANCH_NAME_TO_BE_TESTED_ON_UT_CORE_REPO> |
Oops, something went wrong.