项目作者: andrei-pavel

项目描述 :
👢strap your robot framework with this boilerplate
高级语言: RobotFramework
项目地址: git://github.com/andrei-pavel/robot-framework-boilerplate.git


Robot Framework

Introduction

These tests are written robot framework is a language wrapper over python.
They run on the orchestration manager which has SSH access to all the remote
hosts.


Installation

  • On orchestrator:
    • apt-get install python2-pip
    • pip install pyyaml
    • pip install robotframework
    • pip install robotframework-sshlibrary

Configuration

  • Make sure:
    • all remote hosts are running Ubuntu 16.04 or newer
    • variables are configured in environment.yaml; for
      empty values, surround with single quotes ('); if you need to reference a path
      relative to dt-testing-framework, use _ROOTDIR
    • all hosts have a name prefix and, optionally, a name suffix; the prefix is
      followed by a sequential index starting with 1 which is followed by a suffix
      (e.g. test-host1-x, test-host2-x for prefix test-host and
      suffix -x); prefixes and suffixes are common to all other hosts that
      belong to the same group.
  • Install public SSH key ssh-config/id_rsa.pub on the
    orchestration manager and all the other remote hosts:
    • ssh-copy-id -i ssh-config/id_rsa.pub ${HOST}

Execution

../run-robot [-d|--debug] [-h|--help] [-o|--output-dir $output_directory] [-t|--test $test_name]

OR

robot [-h|--help] [-d|--outputdir $output_directory] [-t|--test $test_name] robot-framework/tests.robot

$output_directory can be any directory with read & write permissions (defaults
to: ./output) and after run it has the following structure:

  1. . +
  2. |- log.html : Log containing debug information for last run test cases
  3. |- output.xml : Same debug log in XML format; used by Robot internally
  4. |- report.html : A report specifying which tests have passed and which have failed
  5. |- Test-Case-1-Testing-Framework-Works + : Directory containing test case 1 information
  6. | |- Test-Case-1-Testing-Framework-Works.log : Log collected with rsyslog
  7. | `- Test-Case-1-Testing-Framework-Works.rla : Log-analyzer result
  8. | `- Test-Case-1-Testing-Framework-Works.rsa : State-analyzer result
  9. |- Test-Case-2-Remote-Hosts-Are-Linux-Distributions + : Directory containing test case 2 information
  10. | |- Test-Case-2-Remote-Hosts-Are-Linux-Distributions.log : Log collected with rsyslog
  11. | `- Test-Case-2-Remote-Hosts-Are-Linux-Distributions.rla : Log-analyzer result
  12. | `- Test-Case-2-Remote-Hosts-Are-Linux-Distributions.rsa : State-analyzer result
  13. `- ...
  • $test_name can have the following values:
    • Test-Case-1-Testing-Framework-Works
    • Test-Case-2-Remote-Hosts-Are-Linux-Distributions

Development sources

Extension of the Robot framework would require changes to the following source
files:

File Description
../environment.yaml global variables that are used in keywords
resources/filesystem_management.robot keywords related to filesystem management
resources/general.robot general or miscellaneous keywords
resources/host_management.robot keywords related to filesystem management
resources/logging.robot log-processing keywords
resources/process_management.robot keywords that handle processes
resources/service_management.robot keywords that handle services
resources/ssh_connectivity.robot keywords that handle SSH connections
tests.robot the implementations of the actual test cases

Support the maintainer