Compare commits
4
Commits
0f57745725
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5742349742 | ||
|
|
ca03b6dd99 | ||
|
|
cfe730ccea | ||
|
|
d61086ff5f |
@@ -0,0 +1,50 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["**"]
|
||||||
|
pull_request:
|
||||||
|
branches: ["**"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10", "3.11", "3.12"]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
cache: pip
|
||||||
|
|
||||||
|
- name: Install package with dev extras
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
# napalm-device-types lives in git.netork.io/NAPALM, not on PyPI: without this
|
||||||
|
# pip looks there, finds an unrelated 0.1.0 and the job dies before any test.
|
||||||
|
python -m pip install "napalm-device-types @ git+https://git.netork.io/NAPALM/napalm-device-types.git"
|
||||||
|
# napalm-linux, which this driver builds on, is not on PyPI either.
|
||||||
|
python -m pip install "napalm-linux @ git+https://git.netork.io/NAPALM/napalm-linux.git"
|
||||||
|
python -m pip install -e ".[dev]"
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
run: |
|
||||||
|
python -m pytest -q --tb=short
|
||||||
|
|
||||||
|
- name: Build wheel and sdist
|
||||||
|
run: |
|
||||||
|
python -m pip install build
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
- name: Upload dist artifacts
|
||||||
|
# v4 refuses to run on Gitea ("not currently supported on GHES").
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist-${{ matrix.python-version }}
|
||||||
|
path: dist/*
|
||||||
@@ -53,6 +53,10 @@ class OpenMediaVaultDriver(StorageDriver, LinuxDriver):
|
|||||||
|
|
||||||
TYPE_LABEL = "Storage"
|
TYPE_LABEL = "Storage"
|
||||||
DRIVER_NAME = "openmediavault"
|
DRIVER_NAME = "openmediavault"
|
||||||
|
#: "Upgrade everything" must be a full upgrade: OMV's own packages and the
|
||||||
|
#: kernel are held back by a plain ``apt-get upgrade`` (``omv-upgrade`` is a
|
||||||
|
#: dist-upgrade). netOrk reads this when it upgrades the host.
|
||||||
|
FULL_UPGRADE = True
|
||||||
driver_name = "openmediavault"
|
driver_name = "openmediavault"
|
||||||
SSH_FINGERPRINT = [
|
SSH_FINGERPRINT = [
|
||||||
FingerprintRule("debian", weight=4.0),
|
FingerprintRule("debian", weight=4.0),
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ dependencies = [
|
|||||||
"napalm-linux>=0.1.0",
|
"napalm-linux>=0.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = ["pytest"]
|
||||||
|
|
||||||
[project.entry-points."napalm.drivers"]
|
[project.entry-points."napalm.drivers"]
|
||||||
openmediavault = "napalm_openmediavault:OpenMediaVaultDriver"
|
openmediavault = "napalm_openmediavault:OpenMediaVaultDriver"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
"""OMV says that "upgrade everything" must be a full upgrade on it.
|
||||||
|
|
||||||
|
A plain ``apt-get upgrade`` holds back OMV's own packages and the kernel;
|
||||||
|
``omv-upgrade`` runs a dist-upgrade. netOrk reads ``FULL_UPGRADE`` to choose.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from napalm_openmediavault.openmediavault import OpenMediaVaultDriver
|
||||||
|
|
||||||
|
|
||||||
|
def test_a_full_upgrade_is_declared():
|
||||||
|
assert OpenMediaVaultDriver.FULL_UPGRADE is True
|
||||||
Reference in New Issue
Block a user