Metadata-Version: 2.4
Name: osism
Version: 0.20260924.0
Summary: OSISM manager interface
Home-page: https://github.com/osism/python-osism
Author: OSISM GmbH
Author-email: info@osism.tech
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: ClusterShell==1.10.1
Requires-Dist: boto3==1.43.97
Requires-Dist: GitPython==3.1.62
Requires-Dist: Jinja2==3.1.6
Requires-Dist: PyMySQL==1.2.3
Requires-Dist: PyYAML==6.0.3
Requires-Dist: ara==1.8.0
Requires-Dist: celery[redis]==5.6.3
Requires-Dist: cliff==4.16.0
Requires-Dist: deepdiff==9.1.0
Requires-Dist: docker==7.2.0
Requires-Dist: dtrack-auditor==1.5.0
Requires-Dist: fastapi==0.141.1
Requires-Dist: flower==2.1.0
Requires-Dist: hiredis==3.4.1
Requires-Dist: jc==1.26.0
Requires-Dist: keystoneauth1==5.17.0
Requires-Dist: kombu==5.6.2
Requires-Dist: kubernetes==36.0.3
Requires-Dist: loguru==0.7.3
Requires-Dist: nbcli==0.10.0.dev2
Requires-Dist: openstacksdk==4.20.0
Requires-Dist: paramiko==5.0.0
Requires-Dist: pottery==3.0.1
Requires-Dist: prompt-toolkit==3.0.53
Requires-Dist: pynetbox==7.8.0
Requires-Dist: pytest-testinfra==10.2.2
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: python-openstackclient==10.3.0
Requires-Dist: redfish==3.4.0
Requires-Dist: setuptools==84.0.0
Requires-Dist: sqlmodel==0.0.42
Requires-Dist: sushy==5.13.0
Requires-Dist: tabulate==0.10.0
Requires-Dist: transitions==0.9.3
Requires-Dist: uvicorn[standard]==0.53.0
Requires-Dist: validators==0.35.0
Requires-Dist: watchdog==6.0.0
Requires-Dist: websockets==17.1
Provides-Extra: ansible
Requires-Dist: ansible-runner==2.4.3; extra == "ansible"
Requires-Dist: ansible-core==2.19.11; extra == "ansible"
Provides-Extra: openstack-image-manager
Requires-Dist: openstack-image-manager==0.20260722.0; extra == "openstack-image-manager"
Provides-Extra: openstackclient
Requires-Dist: gnocchiclient==7.2.0; extra == "openstackclient"
Requires-Dist: osc-placement==4.9.1; extra == "openstackclient"
Requires-Dist: python-barbicanclient==7.6.0; extra == "openstackclient"
Requires-Dist: python-cinderclient==9.10.0; extra == "openstackclient"
Requires-Dist: python-cloudkittyclient==6.2.0; extra == "openstackclient"
Requires-Dist: python-designateclient==7.0.0; extra == "openstackclient"
Requires-Dist: python-glanceclient==4.13.0; extra == "openstackclient"
Requires-Dist: python-heatclient==5.3.0; extra == "openstackclient"
Requires-Dist: python-ironicclient==6.3.0; extra == "openstackclient"
Requires-Dist: python-keystoneclient==6.0.0; extra == "openstackclient"
Requires-Dist: python-magnumclient==5.0.0; extra == "openstackclient"
Requires-Dist: python-manilaclient==6.3.0; extra == "openstackclient"
Requires-Dist: python-masakariclient==8.9.0; extra == "openstackclient"
Requires-Dist: python-mistralclient==6.3.0; extra == "openstackclient"
Requires-Dist: python-neutronclient==14.0.0; extra == "openstackclient"
Requires-Dist: python-novaclient==18.13.1; extra == "openstackclient"
Requires-Dist: python-octaviaclient==3.15.0; extra == "openstackclient"
Requires-Dist: python-swiftclient==4.11.0; extra == "openstackclient"
Requires-Dist: python-troveclient==8.11.0; extra == "openstackclient"
Requires-Dist: python-watcherclient==4.11.0; extra == "openstackclient"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# python-osism

[![Quay](https://img.shields.io/badge/Quay-osism%2Fosism-blue.svg)](https://quay.io/repository/osism/osism)
[![PyPi version](https://badgen.net/pypi/v/osism/)](https://pypi.org/project/osism/)
[![PyPi license](https://badgen.net/pypi/license/osism/)](https://pypi.org/project/osism/)
[![Documentation](https://img.shields.io/static/v1?label=&message=documentation&color=blue)](https://osism.tech/docs/references/cli)

## Documentation

- [SONiC ConfigDB validation](docs/sonic-config-validation.md) — how
  `osism sonic validate` is built, what it does not check, and the caveat that
  the vendored YANG models are a different SONiC flavour to the devices.

## Running unit tests

Install development dependencies and run the full unit test suite:

```
pipenv install --dev
pipenv run pytest
```

Run a single test module:

```
pipenv run pytest tests/unit/test_smoke.py
```

## Running integration tests

The integration tests in `tests/integration/` exercise the Celery/Redis task
core (broker, queue routing, worker, result backend, Redis streams and locks)
end-to-end. They require a reachable Redis and start a Celery worker from the
same virtualenv; they are skipped automatically when Redis is not running.

```
docker run -d -p 6379:6379 redis:7-alpine
REDIS_HOST=localhost REDIS_DB=15 pipenv run pytest tests/integration
```

> **Warning:** The suite mutates live state on the configured Redis. Most keys
> are per-run (UUID-based), but some are fixed global names on the selected
> `REDIS_DB`: the task-lock test reads, writes and removes `osism:task_lock`,
> and the vault test removes `ansible_vault_password` — which a real deployment
> cannot recover, since no other copy of it exists on the system. Always point
> the suite at a disposable Redis (such as the throwaway container above).
>
> To make that hard to get wrong, the suite refuses to run against `REDIS_DB=0`,
> the database a deployment uses. Set `REDIS_DB` to a spare database as shown
> above, or `OSISM_ALLOW_DEFAULT_REDIS_DB=1` if the Redis itself is disposable.
> `REDIS_DB` moves the direct client, the Celery broker and the result backend
> together.

## Running the SONiC E2E golden test

The end-to-end test in `tests/e2e/` provisions NetBox with a docker compose
stack, seeds it from the fixtures in `tests/e2e/scenario/`, generates the SONiC
`config_db.json` files and compares them against the goldens in
`tests/e2e/golden/`. Besides the development dependencies it needs docker with
the compose plugin, `openssl`, and a `netbox-manager` checkout for the seeding
CLI — a sibling directory by default, `NETBOX_MANAGER_DIR` otherwise.

```
pipenv install --dev
make sonic-e2e
```

A cold run takes roughly ten minutes, most of it starting NetBox. To iterate
without paying that each time, bring the stack up separately and leave it
running:

```
make sonic-e2e-up      # start NetBox and leave it up; sonic-e2e reuses it
make sonic-e2e-down    # stop it again and remove its volumes
```

After an intentional generator change, rewrite the goldens and review the diff
before committing it. Regeneration deliberately refuses to run against a stack
left over from an earlier run, because applying the fixtures over a populated
database can produce goldens that CI — which always starts fresh — would not
reproduce:

```
make sonic-e2e-down
make sonic-e2e-regen
```

How much of the generated config the golden set actually covers is reported
separately, because nothing in CI reports it:

```
make sonic-e2e-coverage
```

That compares the `config_db` tables the generator can emit against the tables
that are non-empty in at least one golden, and names any that no golden covers.
It exits non-zero while that list is non-empty, so it is worth running after
adding a scenario to confirm the new tables landed. It gates nothing on its own
— the golden comparison above is the only check that fails a run.

`tests/e2e/sonic_golden_test.sh` documents the remaining environment overrides
(`NETBOX_PORT`, `KEEP_STACK`, `SEED_PARALLEL` and the regeneration escape
hatch).

> **Warning:** Seeding applies *every* file under
> `tests/e2e/scenario/resources/`, tracked or not, so a stray file there joins
> the fixture set — which either breaks the run or silently changes the
> goldens. Check that directory with `git status --ignored` before regenerating
> or debugging a mismatch.
