You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Automatics - Introduction

Automatics is a test setup for verifying RDK builds. It can be integrated with CI flow to validate new changes checked in by user. Also, user can trigger automated tests against given RDK builds.

Hence, Automatics helps in faster release of RDK builds by validating builds using automated test execution. The results of test execution can be viewed from results page of Automatics.

Automatics Setup

Setup details will guide the user to setup Automatics system in their environment.  It includes following details.

  • Setup details of Automatics Orchestration
  • Setup for Automatics Core
  • Configuration of Jenkins jobs for test execution
  • Setup details of Automatics Property

Automatics Orchestration

Software Requirement

  • JDK 1.7
  • MySql 5.0.6
  • Tomcat 7.0.92
  • Maven 3

Mysql Configuration           

  • Create database with name ‘automatics’.
  • Execute the script 'Automatics_DB.sql' that is available with Orchestration source at 'automatics\resources\'. Now the Automatics tables are created with basic configuration data.

WAR Generation

  • Pull the latest Automatics Orchestration tool project from the repository (rdk/tools/automatics) with branch “rdk-next”.
  • After taking the pull, do “mvn clean install” then war file will be generated and will be present inside Automatics/release/Automatics-v0.1/ folder inside the project.
  • Rename war to Automatics.war.

War Deployment

  • Copy the Automatics.war file to the apache-tomcat/webapps folder.
  • Copy the restartTMR.sh file which is inside Automatics/config to apache-tomcat/bin folder.
  • Copy “hibernate.cfg.xml”(inside Automatics/config folder) and “log4j.properties”(inside Automatics) files to any specific location,
  • Update “hibernate.cfg.xml” with database user name and password. And the password updating in "hibernate.cfg.xml” should be Base64 encoded. And, the DB name should be 'automatics'.
  • Add the following params to JAVA_OPTS inside apache-tomcat/bin/catalina.sh file   

-DAutomatics -DhibernateUI.config.file = {path to hibernate config file} -DloggerUI.properties.file = {path to log properties file} 

  • Create empty files childUI.jmd and mainUI.jmd in apache-tomcat/bin/. This is required by orchestration for job scheduling.
  • Navigate to apache-tomcat/bin directory and start the server by executing command.

./startup.sh

  • To verify the server logs, navigate to logs directory (apache-tomcat/logs) under tomcat. 
    • catalina.out - server start up logs
    • automatics_{time_stamp} - Automatics logs
    • traces/trace_automatics_{time_stamp} - Automatics trace logs
  • Automatics Orchestration can be launched from “{protocol}://{host:port}/Automatics/login.htm
  • To stop the server type ./shutdown.sh.

Configuration

  • Launch  Automatics Orchestration.
  • For the first time, login with username as "admin" without password using Self Authentication.
  • After a successful login, we need to setup the following configuration.


System Configuration

  • From Automatics UI, go to Settings -> System Configuration page.

           The system configuration page has following parameters and partner has to configure values for their environment. The description of each parameter is provided below which helps to configure them.

System Config Param

Description

DEFAULT_SYNDICATION_PARTNER

Default syndication partner.

SYNDICATION_PARTNERS

Syndication partner names in comma separated format

DEVICE_INVENTORY_BASE_URL

Base URL which is having the rest implementation of device management

EXECUTION_ENVIRONMENT_TYPES

Execution environment types in comma separated format. Supported values are RDKV, RDKB

JUN

Jenkins Username 

JUP

Jenkins Password 

LDAP

LDAP Configuration values

Test_Types

Test Types supported by Automatics, QUICK, 1HOUR, 4HOUR, FAST_QUICK

EXECUTION_PRIORITY

Test cases will be executed based on the priority. Default provided values in comma separated format for execution priority are P0,P1,P2,P3

JOB_NAME_PREFIX

Prefix of the Jenkins job name. Default provided value is “GENERIC_RDKM_JOB”

RDK_PORTAL_AUTH

Authentication token to access the RDK portal

MINIMUM_FAIL_PERCENTAGE_TO_RETRY_TEST

The percentage limit to test retry the failed tests. Default provided value is 20

USER_DEFAULT_MODULES

Values of the default modules that can be accessed by the guest user. Default provided values separated by hyphen -3-5-6-8-9-13-

MASTER

Comma separated string keywords to identify a build name as master

SPRINT

Comma separated string keywords to identify a build name as sprint

STABLE

Comma separated string keywords to identify a build name as stable

CI_BUILD

Comma separated string keywords to identify a build name as CI build

TM_TYPE

Automatics deployment environment. Valid values DEV or PROD

HEAD_ENDS

Device head end values provided in comma separated format

SERVICE_CI_VERIFICATION_VALUE

Value for service CI_VERFICATION. Supported value CI_VERIFICATION.

SERVICE_FUNCTIONAL_VERIFICATION_VALUE

Value for service FUNCTIONAL_VERIFICATION. Supported value FUNCTIONAL _VERIFICATION.

REASON_TYPES

Reasons for adding/updating/deleting scripts added in comma separated format

 

Device Models

  • From Automatics UI, navigate to Settings -> Manage Scripts -> Run on Models

User needs to configure all device models that is going to execute from Automatics. 

Automatics identifies a device model from its build name. For this, admin user has to configure device model and its corresponding build name. It requires only to map the device model and initial starting sub string of build name.

    • Click on Add Device Name
    • Enter the Device Name.
    • Enter the Image Prefix Name. The build name prefix which will be unique to identify a device model. Automatics identify a device model from the build name.
    • Select the device category.
    • Check-in isClientDevice, if the device is a RDKV client device.

Device Group

  • From Automatics UI, navigate to Settings -> Device Groups

For Automatics to use devices from partner's inventory, device groups have to be configured. The device group name in inventory should be added here so that user can execute tests on devices from configured device groups only. Admin user can map device groups to users so that only those users mapped to device group can execute tests on device.

    • Go to Settings -> Device Groups
    • Click on Add New Device Group Name
    • Enter the Device Group Name. Devices should be present in this Group Name.


Resource Details

  • From Automatics UI, navigate to Settings ->  Resource Details

User can configure Jenkins details in resource details. The test execution happens at jenkins.

    • Click on Add Resource Details.
    • Enter the Jenkins resource base URL
    • Select the Category type from the dropdown (Select if jenkins is configured for RDKV or RDKV execution).
    • Maximum Parallel Jobs :- It represents the number of jobs configured in Jenkins for Automatics. It also requires, the configured jenkins jobs should have pre-defined name which is configurable from system property 'JOB_NAME_PREFIX'. For, eg: If "JOB_NAME_PREFIX" is set to AUTO_JOB, then in jenkins, jobs dedicated for Automatics execution should have names AUTO_JOB1, AUTO_JOB2, AUTO_JOB3. Here, the Maximum Parallel Jobs configured will be 3.

Source Code Repository

            User can configure source repository of test project in Automatics. Test project repository path and branch are passed to jenkins during execution. Jenkins will clone the repository and execute the tests. It requires user to add details from database.

  • Update the Source Code Repository Details, by executing sql command on 'source_code_details' table in database.
    • Ex: insert into source_code_details (NAME, CATEGORY_TYPE, SOURCE_REPO, SOURCE_BRANCH, DELETED_DATE, UPDATED_BY, UPDATED_DATE) values ('{generic category name}','{category type}',{repo details of the project been deployed}','{branch name of the project where it is pulled}','NULL', 'admin', now());

            Job Settings

  • From Automatics UI, navigate to Settings ->  Job Settings

            For each test type in Automatics, job will be created during test execution. The jobs are created based on job templates. For each test type, a job template need to be created.

    • Click on Add New Job
    • Enter Job Name: Enter the Job Name with the prefix of AUTO followed by TEST_TYPE and JOB, all are separated by “_”.                                

Eg: AUTO_1HOUR_JOB

    • And fill all the necessary details.
    • Click on Save.

Admin Only Features

Following features should be given permission only to Admin.

Upgrade Automatics

Admin can upgrade the Automatics by going to Settings -> Upgrade Automatics

Automatics provides support for automated deployment.

  • Click on Browse button, now select the following Automatics.war file and click on Open.
  • Click on Upgrade button to upgrade the Automatics.

User Management

  • From Automatics UI, navigate to Settings ->  User Management

Admin can manage all the users of the Automatics.

Admin can Add/Delete the user details and groups. Also, manages the user group module access.

  • Click on Add New User
    • Enter Preferred User Id: “guest”
    • Enter the user name: “guest”
    • Enter email: guest@automatics.com
    • Select user group: GUEST
  • Click on Add New User Group
    • Enter User Group name: GUEST_1
  • Click on Delete User Group
    • Select the User Group, you want to delete and click on Delete
  • Click on User Group Module Access
    • Select the User Group and click on Fetch Access Rights.
    • Select the access right checkbox of the Module Name, you want to provide access.
    • Click on Save.

Automatics Core

  • Pull the Automatics Core project from the repository (rdk/tools/automatics/automatics-core) with branch (“rdk-next”)
  • In pom.xml and update the url in distributionManagement with the respective artifact repository url in the place as mentioned below. Automatics core is required to be deployed to partner's repository. Partner implementation project requires core to be added as maven dependency for using its APIs.

<distributionManagement>

             <repository>

                          <url></url>

            </repository>

 </distributionManagement>     

  • Execute “mvn clean deploy” on project. This will deploy the Core project to the partner's repository.

Automatics Generic Tests

This project contains the generic test cases which will be executed by Automatics. The automation id and manual id in automated tests should be matching with the automation Id and manual Id present in Automatics orchestration. During test execution the execution status of each test step will be updated to Automatics orchestration. And, at the end final execution status will be updated to Automatics.

Set up

  • Pull the latest AutomaticsGeneric Test project from the repository (rdk/tools/automatics/generic-automation-tests) with branch (“rdk-next”).
  • Update pom.xml with partner project as a dependency.
  • Merge the changes so that it will be available during tests execution.

Automatics Properties

This project contains the properties as a key value pair, which will be used to run the Automatics Core/Partner Implementation/Rest Implementation Projects for executing the test cases.

 

1.1  Automatics Props Set up:

Automatics system holds configuration data required for test execution in Automatics Props application.

There are two types of configuration data in Automatics Props

  • Automatics properties - key value pair data used for configuring data required by Automatics system.
  • Device Props – Json file containing device configuration for each model.

Automatics properties file

  • Launch {protocol}//{host:port}/AutomaticsProps/automatics/props.
  • User will be redirected to automatics properties page where it contains all the Properties which can be changed based on the requirements.
  • Automatics Core/Partner Implementation/Rest Implementation Projects will read configuration values from this file.
  • To edit the values, please click on “unlocked” button. Update the values and click on submit. This will save the configuration values.

 Device properties file

  • Launch {protocol}// {host:port}/AutomaticsProps/deviceProps.
  • User will be redirected to device json page, where it contains the device model based configuration.
  • To edit device properties, user has to update the file device_config.json deployed in tomcat server at path apache-tomcat/webapps/automatics/

Setup

  • Clone AutomaticsProps project from the repository (rdk/tools/automatics/automatics-props) with branch (“rdk-next”).
  • Execute “mvn clean install”, and war file will be generated at target directory.
  • Copy automaticsProps.war file to apache-tomcat/webapps directory
  • Create a directory named “back_up”, in apache-tomcat and place the sample “automatics.properties” file.  When ever user edits automatics properties, a backup file will be generated inside this directory.
  • Create a directory “automatics” inside apache-tomcat/webapps.
  • Copy “automatics.properties”, "device_config.json" and “config.properties” from automatics-props\src
  • Configure“config.properties” with username and password required for Automatics Properties UI login.
  •  Start the server using command ./startup.sh.

Automatics Partner Implementation

  • Add the “Automatics Core” project as the dependency to the pom.xml of Partner Project.
  • After partner project development is completed, deploy the project to partner repository by executing “mvn clean deploy”.

Partner XML configuration file

  • Partner can inject their implementation classes to Automatics core using Spring Dependency Injection. 
  • Automatics core expects spring configuration file partner-applicationContext.xml to be provided by partner project and it should be available at classpath during test execution.
  • All Java API implementations to be injected should be configured in partner-applicationContext.xml.
  • partner-applicationContext.xml file contains predefined bean id with respective implementation class. All beans uses "lazy-init" set to true so that bean instance will be created on demand only. And, for beans that requires separate instance for each device, property "scope" is set to value "prototype".

  partner-applicationContext.xml

Automatics Rest Implementation

  • Partner needs to provide REST based implementation for APIs in device management that is consumed by Automatics orchestration.
  • Other device management APIs consumed by Automatics core can be implemented using Java API or REST.
  • Automatics core provides rest clients for device management and hardware providers like Power Provider. Partner can provide REST implementation for them based on API specification. Automatics core, by default, will use rest implementation. However, if partners prefers to go with Java API implementation, then in Automatics Properties, update the following properties as shown.

"partner.impl.deviceManager=true”  - When set to true, Automatics expects Java based implementation of device management and it should be configured in partner-applicationContext.xml against bean "deviceProvider".

partner.impl.powerProvider=true”  - When set to true, Automatics expects Java based implementation of power provider and it should be configured in partner-applicationContext.xml against bean "powerProvider".

Automatics Orchestration - User Manual




  • No labels