This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| automation:test-the-network [2025/07/06 07:27] – jotasandoku | automation:test-the-network [2025/07/18 22:04] (current) – jotasandoku | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| * **Unit testing (atomic level)** - individual functions/ | * **Unit testing (atomic level)** - individual functions/ | ||
| * Component testing - groups of related units working together | * Component testing - groups of related units working together | ||
| - | * **Integration testing** - multiple components | + | * **Integration testing** - multiple components |
| * System testing - entire application | * System testing - entire application | ||
| + | ---- | ||
| + | |||
| + | ====PYATS=== | ||
| + | * {{ : | ||
| + | * {{ : | ||
| + | * {{ : | ||
| + | |||
| + | Topics | ||
| + | * ' | ||
| + | * TestScripts: | ||
| + | * Jobs: executes TestScripts as tasks. Also allows to execute multiple TestScripts in parallel | ||
| + | |||
| + | * pyATS library (Genie): Data PARSING. Tooling used to extract the network data. | ||
| + | * Genie Harness: Used to build **test cases using YAML datafiles** | ||
| + | |||
| + | * Easypy - Runtime | ||
| + | * Others: Blitz, Clean, ' | ||
| + | * AEtest (Easy Testing): scaffolding/ | ||
| + | |||
| + | |||
| + | === TESTSCRIPT === | ||
| + | Is the python file that holds all your tests. | ||
| + | |||
| + | * Common setup: Initial configuration and device initialization including loops - decorator : '' | ||
| + | * Testcases: ' | ||
| + | * Cleanup: Resets the testing environment after the test - decorator: '' | ||
| + | |||
| + | ** see slides 46,47 for examples (classes..)) ** | ||
| + | \\ | ||
| + | Test Parameters: TestScript > Testcase > TestSection | ||
| + | |||
| + | * Callable | ||
| + | * Test Parameters - decorator : '' | ||
| + | * Test Execution: | ||
| + | * Standalone: all logging is sent to stdout. See slide 64-65 | ||
| + | * Easypy: Standardized runtime env within pyATS. Helpful for regression testing | ||
| + | |||
| + | ---- | ||
| ---- | ---- | ||
| ==== OPTIONS ==== | ==== OPTIONS ==== | ||
| === Classic1: Unittest / **pytest** libraries === | === Classic1: Unittest / **pytest** libraries === | ||
| - | TODO | ||
| - | |||
| == Assertions == | == Assertions == | ||
| * **Definition: | * **Definition: | ||
| Line 98: | Line 134: | ||
| - | ---- | ||
| ===== Further Reading ===== | ===== Further Reading ===== | ||
| - | | + | * [[https:// |
| - | + | | |
| - | | + | |
| - | + | | |
| - | | + | * [[https:// |
| - | + | ||
| - | | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | == Parametrization == | + | |
| - | * **Definition: | + | |
| - | * **Usage:** Implemented with < | + | |
| - | * **Example: | + | |
| - | <code python> | + | |
| - | @pytest.mark.parametrize(" | + | |
| - | def test_ping(ip): | + | |
| - | assert ping(ip) | + | |
| - | </ | + | |
| - | * **Purpose: | + | |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | == Other Relevant Concepts == | + | |
| - | * **Testcase/ | + | |
| - | * A testcase is a Python class, often subclassing < | + | |
| - | * A testscript is a file containing one or more testcases. | + | |
| - | * **Sections: | + | |
| - | * Special methods within a testcase, such as < | + | |
| - | * **Testbed: | + | |
| - | * A YAML or Python file describing devices and connections used in tests. | + | |
| - | * **Loggers: | + | |
| - | * Used for reporting test steps and results (< | + | |
| - | * **aetest:** | + | |
| - | * Core pyATS test harness module for organizing and running tests. | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | == Examples == | + | |
| - | * NUTS (network unit tests): | + | |