GithubHelp home page GithubHelp logo

tungsten-pytest's Introduction

Gerrit-CI BuildStatus

Tungsten-pytest

Tunsgten Fabric tests for MCP KaaS.

Overview

The tungsten-pytest repository contains the pytest-based tests for validating integration of Tungsten Fabric with OpenStack within Mirantis KaaS environment. Tests can be run directly or using appropriate docker image.

Limitations

Python 2.7 is only supported (due to contrail-api-client limitations).

Configuration

Tungsten-pytest uses following configuration files:

  • tungsten-pytest.cfg - contains main settings for access to tungsten/openstack api and some data about k8s environment
  • kubeconfig - kube config file are used to access to k8s environment Examples of configuration files can be found in etc/ directory

Running tests

There are two way to running tests: directly from repository and using docker image

Run tests from repository

To run tunsgten-pytest against your KaaS environment with Openstack+TungstenFabric:

  1. Install and activate virtual environment with python 2.7
virtualenv .venv
source .venv/bin/activate
  1. Install required packages pip install -r requirements.txt
  2. Create configuration file with parameters and put it to etc/tungsten-pytest.cfg Or you can set another place using TFT_CONF env variable.
  3. Copy kube config file to etc/kubeconfig Or you can set another place using TFT_KUBECONFIG env variable.
  4. Run smoke tests and save results to xml: pytest --junit-xml=data/results.xml -m smoke

Run tests from docker image

To run tunsgten-pytest against your KaaS environment with Openstack+TungstenFabric using docker image:

  1. Pull docker image from dockerhub docker push bumarskov/tungsten-pytest:<tagname>
  2. Create directory with following structure:
    user@user-pc:~/tft$ tree
    .
    ├── data
    │   ├── images
    │   └── keys
    └── etc
  1. Create configuration file with parameters and put it to etc/tungsten-pytest.cfg
  2. Copy kube config file to etc/kubeconfig
  3. Run smoke tests using docker with mounted etc and data folders: docker run -v '<path_to_data_dir>:/tungsten-pytest/data' -v '<path_to_etc_dir>:/tungsten-pytest/etc' -e PYTEST_ARGS='-m smoke' --network=host tungsten-pytest

How to build docker image

Before build docker image from local copy of repository remove all .*pyc files and __pycache__ folder:

find tungsten_tests/ -name "*.pyc" -exec rm -f {} \; rm -rf tungsten_tests/tests/__pycache__

Make sure you don't have any sensitive data in etc/ and data/ folders Then build image as usually: docker build --tag=tungsten-pytest .

tungsten-pytest's People

Contributors

ibumarskov avatar

Watchers

 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.