Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New 'netplan status' CLI #290

Merged
merged 24 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
618c8ec
tests: move conflicting dbus tests module
slyon Oct 25, 2022
592f012
GA: add temporary python3-rich dependency
slyon Jan 3, 2023
0a08c29
cli:status: initial skeleton
slyon Oct 26, 2022
b9f7472
cli:status: query basic data
slyon Oct 26, 2022
b3590db
test:cli:status: basic data query tests
slyon Oct 26, 2022
0acdd25
cli:status: structure data into Interface() class, provide JSON output
slyon Oct 26, 2022
f7b8339
test:cli:status: validate Interface() class, JSON output
slyon Oct 26, 2022
e5fa91b
cli:status: query global data, structural output
slyon Oct 26, 2022
83b677b
test:cli:status: validate global data query and structural output
slyon Oct 26, 2022
940f0c1
cli:status: pretty print output, based on JSON data
slyon Oct 26, 2022
1458382
test:cli:status: validate pretty printed output
slyon Oct 26, 2022
dd3a548
tests: bundle CLI unit-tests
slyon Oct 25, 2022
7477004
cli:status: update comments about networkctl --json improvements
slyon Nov 3, 2022
bb242e9
cli:status: order imports according to PEP8
slyon Jan 3, 2023
71cc260
cli:status: helper to extract MAC
slyon Jan 3, 2023
3ad6bf4
cli:status: simplify empty-list checks
slyon Jan 3, 2023
6987726
cli:status: don't crash if NetworkManager is not available
slyon Jan 3, 2023
f8f0e05
meson: install setup cli
slyon Jan 4, 2023
444652f
cli:status: start systemd-networkd to query its data
slyon Jan 4, 2023
6aad1ae
cli:status: avoid printing emojis
slyon Jan 5, 2023
8b1229b
cli:status: use json module to load JSON data
slyon Jan 5, 2023
40d8252
cli:status: simplify some assignments inside expressions
slyon Jan 5, 2023
8feb126
cli:utils: add systemctl_is_masked helper
slyon Jan 5, 2023
acae580
cli:status: faile gracefully if systemd-networkd.service is masked
slyon Jan 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/autopkgtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ jobs:
pull-lp-source netplan.io
cp -r netplan.io-*/debian .
rm -r debian/patches/ # clear any distro patches
# temporary until 'ethtool' is a proper test dependency
sed -i 's/wpasupplicant,/wpasupplicant, ethtool,/g' debian/tests/control
dch -v $(git describe --tags) "Autopkgtest CI testing (Jammy)"
- name: Run autopkgtest (incl. build)
run: |
# using --setup-commands temporarily to install cmocka until it becomes a proper build dependency
sudo autopkgtest . --setup-commands='apt -y install python3-pytest python3-pytest-cov libcmocka-dev' -U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxd autopkgtest/ubuntu/jammy/amd64
# using --setup-commands temporarily to install:
# cmocka/pytest/rich/ethtool until they become proper test-deps
sudo autopkgtest . --setup-commands='apt -y install ethtool python3-rich python3-pytest python3-pytest-cov libcmocka-dev' -U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxd autopkgtest/ubuntu/jammy/amd64
2 changes: 1 addition & 1 deletion .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo sed -i '/deb-src/s/^# //' /etc/apt/sources.list
sudo apt update
sudo apt install python3-coverage python3-pytest python3-pytest-cov curl meson gcovr expect libcmocka-dev
sudo apt install python3-rich python3-coverage python3-pytest python3-pytest-cov curl meson gcovr expect libcmocka-dev
sudo apt build-dep netplan.io

# Runs the unit tests with coverage
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ DOCDIR ?= $(DATADIR)/doc
MANDIR ?= $(DATADIR)/man
INCLUDEDIR ?= $(PREFIX)/include

PYCODE = netplan/ $(wildcard src/*.py) $(wildcard tests/*.py) $(wildcard tests/generator/*.py) $(wildcard tests/dbus/*.py)
PYCODE = netplan/ $(wildcard src/*.py) $(wildcard tests/*.py) $(wildcard tests/generator/*.py) $(wildcard tests/cli/*.py) $(wildcard tests/netplan_dbus/*.py) $(wildcard tests/integration/*.py) $(wildcard tests/parser/*.py)

# Order: Fedora/Mageia/openSUSE || Debian/Ubuntu || null
PYFLAKES3 ?= $(shell command -v pyflakes-3 || command -v pyflakes3 || echo true)
Expand Down Expand Up @@ -109,7 +109,7 @@ clean:
rm -f $(TESTS)

check: default linting $(TESTS)
PYTHONPATH=. LD_LIBRARY_PATH=. tests/cli.py
PYTHONPATH=. LD_LIBRARY_PATH=. tests/cli_legacy.py
PYTHONPATH=. LD_LIBRARY_PATH=. $(PYCOVERAGE) run -a -m pytest -s -v --cov-append
tests/validate_docs.sh

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test('documentation',
find_program('tests/validate_docs.sh'),
workdir: meson.current_source_dir())
test('legacy-tests',
find_program('tests/cli.py'),
find_program('tests/cli_legacy.py'),
timeout: 120,
env: test_env)
#TODO: split out dbus tests into own test() instance, to run in parallel
Expand Down
4 changes: 3 additions & 1 deletion netplan/cli/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from netplan.cli.commands.set import NetplanSet
from netplan.cli.commands.get import NetplanGet
from netplan.cli.commands.sriov_rebind import NetplanSriovRebind
from netplan.cli.commands.status import NetplanStatus

__all__ = [
'NetplanApply',
Expand All @@ -34,5 +35,6 @@
'NetplanInfo',
'NetplanSet',
'NetplanGet',
'NetplanSriovRebind'
'NetplanSriovRebind',
'NetplanStatus',
]
Loading