Giter VIP home page Giter VIP logo

ci_autotest's Introduction



Introduction

plinth-autotest is designed to optimize the test work of each module and improve the efficiency of each module testing. It is divided into three modules: SAS, HNS and PCIE and can only be runned in The openlab1.0 and openlab2.0 environment. After running autotest scripts, we can automatically start and connect target board, and automatically runs the test cases for the modules in target boards.

plinth-autotest Directory structure description:

├── Readme.md                        //  Fix readme file.
├── common_tool                      //  Common test tools.
├── config                           //  Common test configuration.
│   ├── common_config                //  Common configuration of test script running enviroment and target boards.
│   └── common_lib                   //  Common test function.
│
├── sas_autotest                     //  SAS module test scripts.
│   ├── case_script
│   ├── config
│   └── sas_main.sh
│
├── xge_autotest                     //  XGE module test scripts.
│   ├── case_script
│   ├── config
│   └── xge_main.sh
│
├── pcie_autotest                    //  PCIE module test scripts.
│   ├── case_script
│   ├── config
│   └── pcie_main.sh
│
├── report                           //  Storing automatic test results for each module.
│
└── test_main.sh                     //  The main running script calls the entry scripts for each module.

Preparation

Board start mode

Local network: To connect hardware boards and host machine, so that they can communicate each other.

Serial cable: To connect hardware board’s serial port to host machine, so that you can access the target board’s UART in host machine.

methods are provided to connect the board's UART port to a host machine, connect the board's UART in openlab environment:

  1. Use board_reboot command to reset the board.(Details please refer to board_reboot --help)
  2. Use board_connect command.(Details please refer to board_connect --help)
  3. When system showing "Press Any key in 10 seconds to stop automatical booting...", press any key except "enter" key to enter UEFI main menu, select the operating system according to grub menu.

UEFI menu introduction

UEFI main menu option is showed as follow:

continue
select Language            <standard English>
>Boot Manager
>Device Manager
>Boot Maintenance Manager

Choose "Boot Manager" and enter into Boot option menu:

EFI Misc Device
EFI Network
EFI Network 1
EFI Network 2
EFI Network 3
EFI Internal Shell
ESL Start OS
Embedded Boot Loader(EBL)

Please select "EFI Network 2" when booting boards via PXE with openlab environment.

  1. Configuring the “config/common_config” file.
  • All module public configuration items:
   SERVER_IP                         //  the automated script running environment's IP address.
   SERVER_USER                       //  automatic script runing environment's user name.
   SERVER_PASSWD                     //  automatic script runing environment's user password.
   BOARD_GRUB_DEFAULT                //  According to the startup item in 'grub.cfg' file,Configure the host board boot environment
   BACK_BOARD_GRUB_DEFAULT           //  According to the startup item in 'grub.cfg' file,Configure the backup board boot environment
  • SAS module configuration item:
   RUN_SAS                           //  config 1 to run sas test case, 0 to cancle sas test case, Default is 1.
   SAS_BORADNO                       //  the host board number for board_connect.
  • HNS module configuration item:
   RUN_XGE                           //  config 1 to run hns test case, 0 to cancle hns test case, Default is 1.
   XGE_BORADNO                       //  the host board number for board_connect.
   BACK_XGE_BORADNO                  //  the backup board number for board_connect.
  • PCIE module configuration item:
   RUN_PCIE                          //  config 1 to run pcie test case, 0 to cancle pcie test case, Default is 1.
   PCIE_BORADNO                      //  the host board number for board_connect.
   BACK_PCIE_BORADNO                 //  the backup board number for board_connect.
  • Configuration sample:
#!/bin/bash

# Module test run switch, 1 - open test case, 0 - close test case, Default is 1.
RUN_SAS=1
RUN_XGE=0
RUN_PCIE=0

# IMAGE Configuration item.
IMAGE_FILE=common_tool/Image
IMAGE_DIR_PATH=~/tftp

## Common Configuration item.
SERVER_IP=192.168.1.107
SERVER_USER=name
SERVER_PASSWD=passwd
# Single board environment username and password.
SYSTEM_USER=root
SYSTEM_PASSWD=root


REPORT_PATH=~/autotest/report
REPORT_FILE=report.csv
AUTOTEST_ZIP_FILE=autotest.tar.gz
# Setting up a single board default startup system.
BOARD_GRUB_DEFAULT=minilinux-D05
# The SAS module does not need to be configured.
BACK_BOARD_GRUB_DEFAULT=

# SAS Module Configuration item.
SAS_MAIN=sas_autotest/sas_main.sh
SAS_REPORT_FILE=sas_report.csv
# Start single board number.
SAS_BORADNO=2
  1. Execute command“bash -x test_main.sh”.

Automation scripts via board Environmentt

a. Start the board that needs to be tested and upload the autotest script tarball to the board.
e.g.:

scp plinth_autotest.tar.gz [email protected]:~/

b. Run the main script of the module that needs to be tested.
e.g.:

root@ubuntu:~# tar -zxvf plinth_autotest.tar.gz
root@ubuntu:~# cd plinth-autotest/sas_autotest/
root@ubuntu:~/plinth-autotest/sas_autotest# bash -x sas_main.sh

ci_autotest's People

Contributors

luojiaxing1991 avatar zhangxiping avatar windtocloud avatar chenliangfei avatar weixiaohui avatar tianjiaoling avatar wanghaifeng0825 avatar belhzy avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.