Johann Hoffmann 4372b93f55 [WIFI-7277] Switch to dynamic virtual AP EC2 instance (#430)
* Create composite action for dynamic virtual AP EC2 instance deployment

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Fix output description

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Fix step output name

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Checkout repo before using composite action

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Switch to inputs in composite action since secrets do not work

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Move env variable definition to step section

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Remove top level env section

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Fix job and step outputs

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Use SSH option to start ucentral in background

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Switch to SSH password until config override option is ready

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Adapt workflow to previous changes

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Remove key reference in SSH command line options

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Add instance_id output and switch to cut to get firmware version

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Fix terminate-instances command

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Switch back to awk command to get firmware version

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Wait for automated ucentral start before stopping and fix awk command

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Add owner tag to run-instances command

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>

* Remove branch reference

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-03-22 14:31:12 +01:00
2021-07-26 15:59:07 +05:30
2021-08-24 23:22:47 +05:30
2022-03-21 18:54:57 +05:30
2022-03-21 18:54:57 +05:30
2021-04-15 00:08:24 +05:30
2020-07-06 10:38:51 -04:00
2022-03-21 18:54:57 +05:30
2021-05-26 02:07:52 -05:00

TIP Open WiFi Test Automation

Overview

This repository contains the test automation framework and scripts for TIP Open WiFi. Test Framework is implemented in pytest

Automation Overview

The vision is to create an open test framework to ensure production grade Open Wifi Solution.

This test automation tied into our overall tooling at TIP as shown below:

Tools and Test Automation

General guidelines

This testing code adheres to generic pep8 style guidelines, most notably:

  1. Documentation strings
  2. Naming conventions
  3. Sphynx docstring format

Using pytest as the test execution framework.

Using pylint for code quality monitoring.

We are using the pylint package to do the linting. Documentation for it can be found here. In general, the customizations are possible via the .pylintrc file:

  1. Line length below 120 characters is fine (search for max-line-length)
  2. No new line at the end of file is fine (search for missing-final-newline)
  3. Multiple new lines at the end of file are fine (search for trailing-newlines)
  4. Indent using 4 spaces (search for indent-string)

In future we should enforce a policy, where we cannot merge a code where the pylint scoe goes below 7:

pylint --fail-under=7 *py

the command above would produce a non-zero exit code if the score drops below 7.

TIP Controller Integration

Using Swagger Autogenerated CloudSDK Library pypi package (implemented with swagger codegen).

Reporting

Currently we use the pytest allure integration to create visual reports for the test outcomes.

Additionally we generate overview pages, e.g. like this one to consolidate multiple test reports of the same test type.

These overview pages are being deployed by this workflow and their configuration is set in this file.

Miscellaneous

  1. Do not use old style string formatting: "Hello %s" % var; use f"Hello {var} instead
  2. use """ in Docstrings

https://docs.pytest.org/en/latest/example/markers.html
https://docs.pytest.org/en/latest/usage.html
http://pythontesting.net/framework/pytest/pytest-introduction/

Test status

total test count

R1.x sanity testing sanity test count

interop testing interop test count

performance testing performance test count

RF Testing Advance test count

regression testing Regression test count

interop regression testing Interop Regression test count

Best Practice

  1. Ensure to have a python version > 3
  2. We strongly recommend to use virtualenv to ensure that your dev environment sandbox is created.

Code style

All code must be written in python 3 and conform to PEP 8 style guide. The test framework is built using pytest.

made-with-python PEP8

Directory Structure

├── lanforge              - /* to be migrated */
├── libs
│   ├── controller_tests  -/* Library Support for controller_tests part  */
    ├── apnos             -/* Library Support for Access Points (uses AP SSH)  */
│   ├── lanforge          -/* Library Support for LanForge Traffic Generator */
│   ├── perfecto          -/* Library Support for Perfecto Systems */
│   ├── testrails         -/* Result Visualization (will be depreciated ) */
├── tests                 -/* Pytest cases Directory */
│   ├── _basic_test_setup
│   ├── access_point_tests
│   ├── controller_tests
│   ├── e2e
      ├── advanced
      ├── basic
      ├── interOp
      ├── mdu
      |── mesh
      |── scale
    |── README.md         -/* Pytest framework and testcases information */

Test Automation Setup Instructions

# Let's assume '~/automation' directory for setting wlan-testing
cd ~/
mkdir automation
cd automation
git clone https://github.com/Telecominfraproject/wlan-testing
git clone https://github.com/Telecominfraproject/wlan-lanforge-scripts
cd wlan-testing
./sync_repos.bash
mkdir ~/.pip
echo "[global]" > ~/.pip/pip.conf
echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf
echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf
pip3 install -r requirements.txt

cd tests
vim configuration.py    # Setup your testbed data info here

# Check if everything is good 
pytest --collect-only 


# for visualizing allure reports, Install nodejs
# Set Java home

# install allure command
npm install -g allure-commandline --save-dev

Executing and Contributing new test cases

Follow instructions provided here to understand the Testing Framework, and How to run and write new tests

Issue Reporting

Please submit issues using our JIRA project here

Use the Test Automation backlog

Description
No description provided
Readme BSD-3-Clause 228 MiB
Languages
Python 99%
Shell 0.6%
Roff 0.4%