LISA is developed and maintained by Microsoft, to empower Linux validation.
Перейти к файлу
Chi Song 9ffefdc866 limit eol of files to LF, and fix platform bug 2020-08-26 14:10:23 +08:00
.github use strong type schema, init azure platform code 2020-08-26 14:10:23 +08:00
examples rename package tool to tools 2020-08-26 14:10:23 +08:00
lisa limit eol of files to LF, and fix platform bug 2020-08-26 14:10:23 +08:00
.flake8 Configure black, flake8, and isort to work together 2020-08-05 14:08:49 -07:00
.gitattributes limit eol of files to LF, and fix platform bug 2020-08-26 14:10:23 +08:00
.gitignore fix most isort errors. 2020-08-06 14:27:09 +08:00
CODE_OF_CONDUCT.md Adopt the Microsoft Open Source Code of Conduct (#921) 2020-07-22 10:56:05 -07:00
CONTRIBUTING.md use strong type schema, init azure platform code 2020-08-26 14:10:23 +08:00
LICENSE-2.0.txt LISAv2 merged changes 2019-04-11 10:53:17 -07:00
README.md use strong type schema, init azure platform code 2020-08-26 14:10:23 +08:00
poetry.lock use strong type schema, init azure platform code 2020-08-26 14:10:23 +08:00
pyproject.toml use strong type schema, init azure platform code 2020-08-26 14:10:23 +08:00

README.md

Linux Integration Services Automation 3.0 (LISAv3)

CI Workflow for LISAv3 Code style: black GitHub license

LISA is a Linux test automation framework with built-in test cases to verify the quality of Linux distributions on multiple platforms (such as Azure, On-prem HyperV, and Linux bare metal).

This version (v3) is a brand new implementation in Python 3, supports running on Windows and Linux distros.

Getting Started

Install Python 3

Install Python 3 from Linux distributions package repositories, or python.org

Install Poetry

On Linux (or WSL):

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
PATH=$PATH:$HOME/.poetry/bin

On Windows (in PowerShell):

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
# the path can be added to system, so it applies to every terminal.
$env:PATH += ";$env:USERPROFILE\.poetry\bin"

TEMP WORKAROUND: poetry cannot handle azure-identity package in current version (1.0.10), so install the preview version, until it's released.

poetry self update --preview 1.1.0a2

Then use Poetry to install LISA v3's Python package dependencies:

cd LISA
poetry install

To obtain the path of the Poetry virtual environment setup for LISA (where the isolated Python installation and packages are located), run:

poetry env list --full-path

Run LISAv3

Run LISAv3 using Poetrys environment:

cd LISA
poetry run python lisa/main.py

Editor Setup

Install and enable ShellCheck to find bash errors locally.

Visual Studio Code

First, click the Python version in the bottom left, then enter the path emitted by the command above. This will point Code to the Poetry virtual environment.

Make sure below settings are in root level of .vscode/settings.json

{
    "python.analysis.typeCheckingMode": "strict",
    "python.formatting.provider": "black",
    "python.linting.enabled": true,
    "python.linting.flake8Enabled": true,
    "python.linting.mypyEnabled": true,
    "python.linting.pylintEnabled": false,
    "editor.formatOnSave": true,
    "python.linting.mypyArgs": [
        "--strict",
        "--namespace-packages",
        "--show-column-numbers",
    ],
    "python.sortImports.path": "isort",
    "python.analysis.useLibraryCodeForTypes": false,
    "python.analysis.autoImportCompletions": false,
    "files.eol": "\n",
}

Emacs

Use the pyvenv package:

(use-package pyvenv
  :ensure t
  :hook (python-mode . pyvenv-tracking-mode))

Then run M-x add-dir-local-variable RET python-mode RET pyvenv-activate RET <path/to/virtualenv> where the value is the path given by the command above. This will create a .dir-locals.el file which looks like this:

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((python-mode . ((pyvenv-activate . "~/.cache/pypoetry/virtualenvs/lisa-s7Q404Ij-py3.8"))))