ESGF / esgf-test-suite

Python nosetest scripts for ESGF
https://pypi.python.org/pypi/esgf-test-suite
0 stars 2 forks source link

esgf-test-suite

Python (and bash) nosetests scripts for ESGF integration tests and validation

TLDR

Well, it is nearly impossible to run esgf-test-suite without reading entirely this man. Sorry.

Recommanded tests for a classical ESGF installation

Don't forget to configure the superset to the value classic in the configuration file.

Recommanded tests for a ESGF docker deployement

python3 esgf-test.py -v --nocapture --nologcapture --tc-file my_config.ini -a 'basic,!compute' -a 'slcs' --with-id

Don't forget to configure the superset to the value docker in the configuration file (see section Configuration).

Understanding the result of the tests

Purpose and limits of this tool:

ESGF Test Suite is a full python application.

It is designed to perform integration tests on ESGF nodes. The tests are organized as a acyclic graph and they can be refered to with a set of attributes. In the ./esgf-test-suite/doc/test_plan.pdf, the leaf are the tests and the non terminal nodes are the attributes. The underlined tests are implemented.

ESGF Test Suite offers to run high level tests from a desktop so the tested node can be validated from the end user perspective. Current developments will also let admins to test and validate the stack by running tests on the node itself.

Requirements:

Installation

Linux

Tested on CentOS 7.

Command for Red Hat / CentOS / Scientifix Linux 7:

 yum install openssl-devel libxml2-devel libxslt-devel globus-gass-copy-progs firefox myproxy

Just download the latest version of the binary here (according to your OS) and add the path of the binary into the PATH environment variable.

export PATH=/path/to/geckodriver:$PATH
pip install -U nose pyopenssl MyProxyClient selenium requests nose-testconfig nose-htmloutput lxml

Then cd to the directory [parent_directory]/esgf-test-suite/esgf-test-suite/ (yes twice, it is not a mistake).

Note: the branch master is always at the last stable version.

git clone https://github.com/ESGF/esgf-test-suite.git
cd ./esgf-test-suite/esgf-test-suite

MacOSX

Untested on MacOSX. Sorry, waiting for feedback...

Just download the latest version of the binary here (according to your OS) and add the path of the binary into the PATH environment variable.

export PATH=/path/to/geckodriver:$PATH

OR

Install Geckodriver via Homebrew:

 brew install geckodriver

Globus-url-copy is part of the Globus Toolkit. You can install Globus Toolkit via: The offical Globus Toolkit package (here) or Homebrew:

  brew install globus-toolkit
pip install -U nose pyopenssl MyProxyClient selenium requests nose-testconfig nose-htmloutput lxml

Then cd to the directory [parent_directory]/esgf-test-suite/esgf-test-suite/ (yes twice, it is not a mistake).

Note: the branch master is always at the last stable version.

git clone https://github.com/ESGF/esgf-test-suite.git
cd ./esgf-test-suite/esgf-test-suite

Singularity

Tested with Singularity 2.5.2-dist on CentOS 7.

A Singularity image of container is also available. At the moment, it only packages the dependencies (python, pip packages, etc.) of the esgf-test-suite and not the test-suite itself. This image is built from the offical docker image of the latest version of LTS Ubuntu (Singularity recipe is described here).

Configuration:

Configuration file is meant to be modified according to your needs and save as with a different name (like my_config.ini). Git ignores files with the following pattern my_config*.ini

 vi [installation_dir]/esgf-test-suite/esgf-test-suite/default.ini   

esgf-test-suite raises a ConfigurationException if the configuration file is wrong or incomplete. However, you don't have to fullfill the entire configuration file: you just have to give the information needed for the tests that you want to execute.

Specify the full qualified address of your nodes. You may leave some entries empty, but ESGF-test-suite won't let you run the tests that need the missing addresses.

This section describes the user account to be used for the login and downloading tests (cog, myproxy and http download tests).

Note: The creation of an account (test named: cog_create_user) through the CoG interface is not possible until the captcha is disable. Both user creation and user login tests rely on the section account. You cannot create a user that already exists.

This section let you configure the browser used to test CoG and other services.

Testing CoG requires some information. This section provides the required information.

Testing SLCS requires some information. This section provides the required information.

This section configures the development options.

Understanding the result of the tests

Usage:

The following examples except that you run the command in the [installation_dir]/esgf-test-suite/esgf-test-suite/ directory (yes twice, it is not a mistake) and the configuration file is named my_config.ini. ESGF-test-suite is based on the nose attributes, for more information about them, visit this page

The nosetest doc is available here

export NOSE_TESTCONFIG_AUTOLOAD_INI=/path/to/my_config.ini
python3 esgf-test.py -v --nocapture --nologcapture

This command line executes only the basic tests:

python3 esgf-test.py -v --nocapture --nologcapture --tc-file my_config.ini -a 'basic'

Note: see the section test selection for more information about nose attributes.

This command line executes only the basic tests for the index node configured in my_config.ini (basic set intersect index set):

python3 esgf-test.py -v --nocapture --nologcapture --tc-file my_config.ini -a 'basic,index'

Note: You may provide as many attributes as you want (the operator is still intersect).

This command line executes the basic tests for all types of node except the basic tests of the compute node:

python3 esgf-test.py -v --nocapture --nologcapture --tc-file my_config.ini -a 'basic,!compute'

This example runs the union of the set of tests for the idp node and the set of tests for the index node (idp set plus index set):

python3 esgf-test.py -v --nocapture --nologcapture --tc-file my_config.ini -a 'idp' -a 'index'

Note: You may provide as many '-a' expressions as you want (the operator is still plus).

Note: -a '!compute' -a '!cog_create_user' is helpless to avoid the tests for the compute node and the test case 'create user'.

This example runs the tests located in test/test_node_components/test_index (the tests for index node).

python3 esgf-test.py -v --nocapture --nologcapture --tc-file my_config.ini utils ./test/test_node_components/test_index

Note: the utils directory is mandatory (esgf-test-suite python libraries).

This example run the basic tests for index node, overring the index node value from the default configuration: it tests the index node of LLNL:

python3 esgf-test.py -v --nocapture --nologcapture --tc-file default.ini -a 'basic,index' --tc='nodes.index_node:esgf-node.llnl.gov'

Note: the nodes.index_node corresponds to the section nodes and the key index_node in the configuration file.

This example runs the basic tests for the index node of LLNL:

python3 esgf-test.py -v --nocapture --nologcapture -a 'basic,index' --tc='nodes.index_node:esgf-node.llnl.gov'

More informations about the command line options concerning the configuration here.

Test selection

Attributes and set of test cases are described in ./esgf-test-suite/doc/plan_test.pdf .

This pdf describes the sets of test cases by means of a mind map (or a tree). Each non-terminal node is a set of test cases. For example the node labeled 'node_components' is a set of test cases that is the union of the sets of test cases corresponding to the nodes labeled 'compute', 'data', 'index' and 'idp' (fully recursive except for the terminal nodes). The label of these nodes is the attribute to be referred to when you want to execute the corresponding set of test cases.

The terminal nodes are the test cases. they also have a label and they can be selectively executed but the label doesn't correspond to their attribute. The attribute is composed of the label of the terminal node prefixed with the label of the parent node, the name separator is the underscore. For example the attribute for the http download test case (see data node) is 'dl_http'. This rule doesn't apply for the set of basic test cases (the parent node is labeled 'basic'): the basic test cases don't have any attribute.

Recommanded tests for a classical ESGF installation

Don't forget to configure the superset to the value classic in the configuration file.

Recommanded tests for a ESGF docker deployement

python3 esgf-test.py -v --nocapture --nologcapture --tc-file my_config.ini -a 'basic,!compute' -a 'slcs' --with-id

Don't forget to configure the superset to the value docker in the configuration file (see section Configuration).

Remarks:

DISCLAIMER - the scripts in this repo are provided as is - use at your own risk - they have been tested only on a single system and may require modification to work correctly on other systems.