Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-nmcli for openSUSE:Factory checked in at 2026-01-13 21:26:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-nmcli (Old) and /work/SRC/openSUSE:Factory/.python-nmcli.new.1928 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-nmcli" Tue Jan 13 21:26:16 2026 rev:4 rq:1326738 version:1.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-nmcli/python-nmcli.changes 2025-12-28 19:21:10.515769657 +0100 +++ /work/SRC/openSUSE:Factory/.python-nmcli.new.1928/python-nmcli.changes 2026-01-13 21:26:18.823510569 +0100 @@ -1,0 +2,9 @@ +Fri Jan 9 12:25:09 UTC 2026 - John Paul Adrian Glaubitz <[email protected]> + +- Update to 1.7.0 + * Added nmcli.connection.show_all method with active filtering support + * Added nmcli.device.up and nmcli.device.down methods + * Added nmcli.general.reload method with configuration flags support +- Use Python 3.11 on SLE-15 by default + +------------------------------------------------------------------- Old: ---- nmcli-1.6.0.tar.gz New: ---- nmcli-1.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-nmcli.spec ++++++ --- /var/tmp/diff_new_pack.IUdpfp/_old 2026-01-13 21:26:20.367574298 +0100 +++ /var/tmp/diff_new_pack.IUdpfp/_new 2026-01-13 21:26:20.375574628 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-nmcli # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,8 +16,9 @@ # +%{?sle15_python_module_pythons} Name: python-nmcli -Version: 1.6.0 +Version: 1.7.0 Release: 0 Summary: A python wrapper library for the network-manager cli client License: MIT ++++++ nmcli-1.6.0.tar.gz -> nmcli-1.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/.github/RELEASE.md new/nmcli-1.7.0/.github/RELEASE.md --- old/nmcli-1.6.0/.github/RELEASE.md 1970-01-01 01:00:00.000000000 +0100 +++ new/nmcli-1.7.0/.github/RELEASE.md 2026-01-03 02:55:41.000000000 +0100 @@ -0,0 +1,159 @@ +# Release Process + +This document describes the process for releasing a new version of nmcli. + +## Current Release Flow (Phase 1: GitHub Release) + +Currently, only GitHub Release automation is implemented. PyPI publishing automation will be added in the future. + +## Pre-Release Checklist + +- [ ] All tests pass (`python -m pytest tests`) +- [ ] Type checking passes (`python -m mypy nmcli`) +- [ ] Lint checks pass (`python -m pylint nmcli`) +- [ ] README.md Change Log is updated +- [ ] README.md API documentation is up to date +- [ ] README.md Compatibility table is up to date + +## Release Steps + +### 1. Determine Version Number + +Follow semantic versioning: +- **MAJOR**: Incompatible API changes +- **MINOR**: Backwards-compatible functionality additions +- **PATCH**: Backwards-compatible bug fixes + +Example: Current `1.6.0` → Next `1.7.0` (for feature additions) + +### 2. Update pyproject.toml Version + +```toml +[project] +version = "1.7.0" # ← Update this +``` + +### 3. Update README.md Change Log + +Add the new version's changes to the "Change Log" section in README.md: + +```markdown +### 1.7.0 + +- Added support for `connection.show_all` with active filtering +- Added support for `device.up` and `device.down` commands +- Added support for `general.reload` with configuration flags +``` + +### 4. Commit Changes + +```bash +git add pyproject.toml README.md +git commit -m "Release v1.7.0" +``` + +### 5. Create and Push Tag + +```bash +# Push to main branch +git push origin main + +# Create tag +git tag v1.7.0 + +# Push tag (this triggers GitHub Actions) +git push origin v1.7.0 +``` + +### 6. Verify GitHub Actions Completion + +1. Check workflow execution status at https://github.com/ushiboy/nmcli/actions +2. Verify all tests pass +3. Verify build succeeds + +### 7. Edit and Publish Draft Release + +1. Go to https://github.com/ushiboy/nmcli/releases +2. Open the auto-created draft release +3. Edit release notes: + - Review auto-generated content + - Add main changes as bullet points in the "What's Changed" section + - Clean up commit history if needed +4. Click "Publish release" to publish + +### 8. Manual PyPI Publishing (Current) + +PyPI publishing is currently done manually: + +```bash +# Build (requires Python 3.10+) +python -m build + +# Upload to PyPI +twine upload dist/nmcli-1.7.0* +``` + +## Troubleshooting + +### Tag and Version Mismatch Error + +``` +Error: Package version (1.6.0) does not match tag version (1.7.0) +``` + +**Cause**: Forgot to update version in pyproject.toml + +**Solution**: +1. Delete tag: `git tag -d v1.7.0 && git push origin :v1.7.0` +2. Fix pyproject.toml and commit +3. Create and push tag again + +### Test Failures + +**Solution**: +1. Delete tag (see above) +2. Fix tests and commit +3. Create and push tag again + +### Build Failures + +Recommended to verify locally before tagging: + +```bash +# Clean build verification +rm -rf dist/ +python -m build + +# Check generated files +ls -lh dist/ +``` + +## Future Extension (Phase 2: PyPI Auto-Publishing) + +The following will be added in the future: + +1. **PyPI Trusted Publishers Setup** + - Register GitHub repository as a trusted publisher on PyPI + - No token management needed, more secure + +2. **Workflow Extension** + - Automatically publish to PyPI after GitHub Release + - Or make PyPI publishing optional at draft stage + +3. **TestPyPI Validation** + - Validate on TestPyPI before production release + +## Release Checklist + +Before releasing, verify: + +- [ ] Updated pyproject.toml version +- [ ] Updated README.md Change Log +- [ ] All tests pass locally +- [ ] Committed changes +- [ ] Pushed to main +- [ ] Created and pushed tag +- [ ] Verified GitHub Actions completion +- [ ] Edited draft release +- [ ] Published release +- [ ] (Current) Manually uploaded to PyPI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/.github/workflows/release.yml new/nmcli-1.7.0/.github/workflows/release.yml --- old/nmcli-1.6.0/.github/workflows/release.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/nmcli-1.7.0/.github/workflows/release.yml 2026-01-03 02:55:41.000000000 +0100 @@ -0,0 +1,98 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + +permissions: + contents: write + +jobs: + # Run tests first to ensure quality + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - python-version: '3.7' + os: ubuntu-22.04 + - python-version: '3.8' + os: ubuntu-latest + - python-version: '3.9' + os: ubuntu-latest + - python-version: '3.10' + os: ubuntu-latest + - python-version: '3.11' + os: ubuntu-latest + - python-version: '3.12' + os: ubuntu-latest + - python-version: '3.13' + os: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install -U pip + pip install -r develop-requirements.txt + - name: Check mypy + run: python -m mypy nmcli + - name: Check lint + run: python -m pylint nmcli + - name: Run unit tests + run: python -m pytest tests + + # Build and create release after tests pass + build-and-release: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install build dependencies + run: | + python -m pip install -U pip + pip install build + + - name: Build package + run: python -m build + + - name: Extract version from tag + id: version + run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + + - name: Verify version matches + run: | + PKG_VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2) + TAG_VERSION="${{ steps.version.outputs.version }}" + if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then + echo "Error: Package version ($PKG_VERSION) does not match tag version ($TAG_VERSION)" + exit 1 + fi + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + # Auto-generate release notes (editable after creation) + generate_release_notes: true + # Create as draft (publish after manual review) + draft: true + # Attach build artifacts + files: | + dist/*.whl + dist/*.tar.gz + # Release body template (shown before auto-generated notes) + body: | + ## What's Changed + + <!-- Add main changes as bullet points here --> + + **Full Changelog**: https://github.com/${{ github.repository }}/compare/v${{ steps.version.outputs.version }}...v${{ steps.version.outputs.version }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/README.md new/nmcli-1.7.0/README.md --- old/nmcli-1.6.0/README.md 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/README.md 2026-01-03 02:55:41.000000000 +0100 @@ -44,6 +44,7 @@ | general | hostname | supported | | general | permissions | not supported | | general | logging | not supported | +| general | reload | supported | | networking | | supported | | networking | on | supported | | networking | off | supported | @@ -61,6 +62,7 @@ | connection | clone | not supported | | connection | edit | not supported | | connection | delete | supported | +| connection | monitor | not supported | | connection | reload | supported | | connection | load | not supported | | connection | import | not supported | @@ -69,17 +71,20 @@ | device | status | supported | | device | show | supported | | device | set | not supported | +| device | up | supported | | device | connect | supported | | device | reapply | supported | | device | modify | not supported | +| device | down | supported | | device | disconnect | supported | | device | delete | supported | | device | monitor | not supported | -| device | wifi | supported | -| device | wifi connect | supported | -| device | wifi rescan | supported | -| device | wifi hotspot | supported | -| device | lldp | not supported | +| device | wifi | supported | +| device | wifi connect | supported | +| device | wifi rescan | supported | +| device | wifi hotspot | supported | +| device | wifi show-password | not supported | +| device | lldp | not supported | | agent | | not supported | | agent | secret | not supported | | agent | polkit | not supported | @@ -160,6 +165,16 @@ nmcli.connection.show(name: str, show_secrets: bool = False, active: bool = False) -> ConnectionDetails ``` +#### nmcli.connection.show_all + +Show all connections. + +Use `active` argument to show only active connections. + +``` +nmcli.connection.show_all(active: bool = False) -> List[Connection] +``` + #### nmcli.connection.reload Reload all connection files from disk. @@ -206,6 +221,16 @@ nmcli.device.show_all(fields: str = None) -> List[DeviceDetails] ``` +#### nmcli.device.up + +Connect the device. + +The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed. + +``` +nmcli.device.up(ifname: str, wait: int = None) -> None +``` + #### nmcli.device.connect Connect the device. @@ -216,6 +241,16 @@ nmcli.device.connect(ifname: str, wait: int = None) -> None ``` +#### nmcli.device.down + +Disconnect a device and prevent the device from automatically activating further connections without user/manual intervention. + +The `wait` argument applies the same effect to the command as the `--wait` option. If it is omitted, the default behavior is followed. + +``` +nmcli.device.down(ifname: str, wait: int = None) -> None +``` + #### nmcli.device.disconnect Disconnect devices. @@ -320,6 +355,21 @@ nmcli.general.set_hostname(hostname: str) -> None ``` +#### nmcli.general.reload + +Reload NetworkManager's configuration and perform certain updates. + +The `flags` argument specifies which configurations to reload. Valid flags are: +- `conf`: Reload NetworkManager.conf configuration from disk +- `dns-rc`: Update DNS configuration (equivalent to SIGUSR1) +- `dns-full`: Restart the DNS plugin + +If no flags are provided, everything that is supported is reloaded. + +``` +nmcli.general.reload(flags: Optional[List[str]] = None) -> None +``` + ### networking #### nmcli.networking @@ -459,6 +509,12 @@ ## Change Log +### 1.7.0 + +- Added `nmcli.connection.show_all` method with active filtering support +- Added `nmcli.device.up` and `nmcli.device.down` methods +- Added `nmcli.general.reload` method with configuration flags support + ### 1.6.0 - Added active option to `nmcli.connection.show` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/nmcli/_connection.py new/nmcli-1.7.0/nmcli/_connection.py --- old/nmcli-1.6.0/nmcli/_connection.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/nmcli/_connection.py 2026-01-03 02:55:41.000000000 +0100 @@ -34,6 +34,9 @@ def show(self, name: str, show_secrets: bool = False, active: bool = False) -> ConnectionDetails: raise NotImplementedError + def show_all(self, active: bool = False) -> List[Connection]: + raise NotImplementedError + def reload(self) -> None: raise NotImplementedError @@ -104,5 +107,17 @@ results[key] = None if value in ('--', '""') else value return results + def show_all(self, active: bool = False) -> List[Connection]: + cmd = ['connection', 'show'] + if active: + cmd += ['--active'] + r = self._syscmd.nmcli(cmd) + results = [] + for row in r.split('\n')[1:]: + if len(row) == 0: + continue + results.append(Connection.parse(row)) + return results + def reload(self) -> None: self._syscmd.nmcli(['connection', 'reload']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/nmcli/_device.py new/nmcli-1.7.0/nmcli/_device.py --- old/nmcli-1.6.0/nmcli/_device.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/nmcli/_device.py 2026-01-03 02:55:41.000000000 +0100 @@ -52,9 +52,15 @@ def show_all(self, fields: str = None) -> List[DeviceDetails]: raise NotImplementedError + def up(self, ifname: str, wait: int = None) -> None: + raise NotImplementedError + def connect(self, ifname: str, wait: int = None) -> None: raise NotImplementedError + def down(self, ifname: str, wait: int = None) -> None: + raise NotImplementedError + def disconnect(self, ifname: str, wait: int = None) -> None: raise NotImplementedError @@ -131,11 +137,21 @@ details[key] = None if value in ('--', '""') else value return results + def up(self, ifname: str, wait: int = None) -> None: + cmd = add_wait_option_if_needed( + wait) + ['device', 'up', ifname] + self._syscmd.nmcli(cmd) + def connect(self, ifname: str, wait: int = None) -> None: cmd = add_wait_option_if_needed( wait) + ['device', 'connect', ifname] self._syscmd.nmcli(cmd) + def down(self, ifname: str, wait: int = None) -> None: + cmd = add_wait_option_if_needed( + wait) + ['device', 'down', ifname] + self._syscmd.nmcli(cmd) + def disconnect(self, ifname: str, wait: int = None) -> None: cmd = add_wait_option_if_needed( wait) + ['device', 'disconnect', ifname] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/nmcli/_general.py new/nmcli-1.7.0/nmcli/_general.py --- old/nmcli-1.6.0/nmcli/_general.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/nmcli/_general.py 2026-01-03 02:55:41.000000000 +0100 @@ -1,3 +1,5 @@ +from typing import List, Optional + from ._system import SystemCommand, SystemCommandInterface from .data import General @@ -16,9 +18,14 @@ def set_hostname(self, hostname: str): raise NotImplementedError + def reload(self, flags: Optional[List[str]] = None) -> None: + raise NotImplementedError + class GeneralControl(GeneralControlInterface): + VALID_RELOAD_FLAGS = ['conf', 'dns-rc', 'dns-full'] + def __init__(self, syscmd: SystemCommandInterface = None): self._syscmd = syscmd or SystemCommand() @@ -35,3 +42,16 @@ def set_hostname(self, hostname: str): self._syscmd.nmcli(['general', 'hostname', hostname]) + + def reload(self, flags: Optional[List[str]] = None) -> None: + if flags is not None: + for flag in flags: + if flag not in self.VALID_RELOAD_FLAGS: + raise ValueError( + f"Invalid reload flag '{flag}'. " + f"Valid flags are: {', '.join(self.VALID_RELOAD_FLAGS)}" + ) + cmd = ['general', 'reload'] + if flags: + cmd += flags + self._syscmd.nmcli(cmd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/nmcli/dummy/_connection.py new/nmcli-1.7.0/nmcli/dummy/_connection.py --- old/nmcli-1.6.0/nmcli/dummy/_connection.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/nmcli/dummy/_connection.py 2026-01-03 02:55:41.000000000 +0100 @@ -32,22 +32,29 @@ return self._show_args @property + def show_all_args(self): + return self._show_all_args + + @property def called_reload(self) -> int: return self._called_reload def __init__(self, result_call: List[Connection] = None, result_show: ConnectionDetails = None, + result_show_all: List[Connection] = None, raise_error: Exception = None): self._raise_error = raise_error self._result_call = result_call or [] self._result_show = result_show + self._result_show_all = result_show_all or [] self._add_args: List[Tuple] = [] self._modify_args: List[Tuple] = [] self._delete_args: List[Tuple] = [] self._up_args: List[Tuple] = [] self._down_args: List[Tuple] = [] self._show_args: List[Tuple] = [] + self._show_all_args: List[Tuple] = [] self._called_reload = 0 def __call__(self) -> List[Connection]: @@ -86,6 +93,11 @@ return self._result_show raise ValueError("'result_show' is not properly initialized") + def show_all(self, active: bool = False) -> List[Connection]: + self._raise_error_if_needed() + self._show_all_args.append((active,)) + return self._result_show_all + def reload(self) -> None: self._raise_error_if_needed() self._called_reload += 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/nmcli/dummy/_device.py new/nmcli-1.7.0/nmcli/dummy/_device.py --- old/nmcli-1.6.0/nmcli/dummy/_device.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/nmcli/dummy/_device.py 2026-01-03 02:55:41.000000000 +0100 @@ -5,17 +5,25 @@ from ..data.hotspot import Hotspot -class DummyDeviceControl(DeviceControlInterface): +class DummyDeviceControl(DeviceControlInterface): # pylint: disable=too-many-public-methods @property def show_args(self): return self._show_args @property + def up_args(self): + return self._up_args + + @property def connect_args(self): return self._connect_args @property + def down_args(self): + return self._down_args + + @property def disconnect_args(self): return self._disconnect_args @@ -57,7 +65,9 @@ self._result_show_all = result_show_all or [] self._result_wifi_hotspot = result_wifi_hotspot self._show_args: List[Tuple] = [] + self._up_args: List[Tuple] = [] self._connect_args: List[Tuple] = [] + self._down_args: List[Tuple] = [] self._disconnect_args: List[Tuple] = [] self._reapply_args: List[str] = [] self._delete_args: List[Tuple] = [] @@ -85,10 +95,18 @@ self._raise_error_if_needed() return self._result_show_all + def up(self, ifname: str, wait: int = None) -> None: + self._raise_error_if_needed() + self._up_args.append((ifname, wait)) + def connect(self, ifname: str, wait: int = None) -> None: self._raise_error_if_needed() self._connect_args.append((ifname, wait)) + def down(self, ifname: str, wait: int = None) -> None: + self._raise_error_if_needed() + self._down_args.append((ifname, wait)) + def disconnect(self, ifname: str, wait: int = None) -> None: self._raise_error_if_needed() self._disconnect_args.append((ifname, wait)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/nmcli/dummy/_general.py new/nmcli-1.7.0/nmcli/dummy/_general.py --- old/nmcli-1.6.0/nmcli/dummy/_general.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/nmcli/dummy/_general.py 2026-01-03 02:55:41.000000000 +0100 @@ -1,4 +1,4 @@ -from typing import List +from typing import List, Optional from .._general import GeneralControlInterface from ..data.general import General @@ -10,6 +10,10 @@ def set_hostname_args(self): return self._set_hostname_args + @property + def reload_args(self): + return self._reload_args + def __init__(self, result_call: General = None, result_status: General = None, @@ -20,6 +24,7 @@ self._result_status = result_status self._result_hostname = result_hostname self._set_hostname_args: List[str] = [] + self._reload_args: List[Optional[List[str]]] = [] def __call__(self) -> General: self._raise_error_if_needed() @@ -41,6 +46,10 @@ self._raise_error_if_needed() self._set_hostname_args.append(hostname) + def reload(self, flags: Optional[List[str]] = None) -> None: + self._raise_error_if_needed() + self._reload_args.append(flags) + def _raise_error_if_needed(self): if not self._raise_error is None: raise self._raise_error diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/pyproject.toml new/nmcli-1.7.0/pyproject.toml --- old/nmcli-1.6.0/pyproject.toml 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/pyproject.toml 2026-01-03 02:55:41.000000000 +0100 @@ -4,7 +4,7 @@ [project] name = "nmcli" -version = "1.6.0" +version = "1.7.0" description = "A python wrapper library for the network-manager cli client" readme = "README.md" authors = [{name = "ushiboy"}] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/tests/dummy/test_connection.py new/nmcli-1.7.0/tests/dummy/test_connection.py --- old/nmcli-1.6.0/tests/dummy/test_connection.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/tests/dummy/test_connection.py 2026-01-03 02:55:41.000000000 +0100 @@ -134,6 +134,28 @@ c.show('MyHome') +def test_show_all(): + result_show_all = [ + Connection('AP1', '3eac760c-de77-4823-9ab8-773c276daca3', + 'wifi', 'wlan0'), + Connection('Home', '700f5b18-cbb3-4d38-9c61-e3bc3a3852b9', + 'ethernet', 'eth0') + ] + c = DummyConnectionControl(result_show_all=result_show_all) + + assert c.show_all() == result_show_all + assert c.show_all_args[0] == (False,) + + c.show_all(active=True) + assert c.show_all_args[1] == (True,) + + +def test_show_all_when_raise_error(): + c = DummyConnectionControl(raise_error=Exception) + with pytest.raises(Exception): + c.show_all() + + def test_reload(): c = DummyConnectionControl() c.reload() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/tests/test_connection.py new/nmcli-1.7.0/tests/test_connection.py --- old/nmcli-1.6.0/tests/test_connection.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/tests/test_connection.py 2026-01-03 02:55:41.000000000 +0100 @@ -132,6 +132,28 @@ 'connection', 'show', "--active", name] +def test_show_all(): + s = DummySystemCommand('''NAME UUID TYPE DEVICE +AP1 3eac760c-de77-4823-9ab8-773c276daca3 wifi wlan0 +Home 700f5b18-cbb3-4d38-9c61-e3bc3a3852b9 ethernet eth0 +Wired connection 1 700f5b18-cbb3-4d38-9c61-999999999999 ethernet eth1''') + connection = ConnectionControl(s) + + r = connection.show_all() + assert s.passed_parameters == ['connection', 'show'] + assert r == [ + Connection('AP1', '3eac760c-de77-4823-9ab8-773c276daca3', + 'wifi', 'wlan0'), + Connection('Home', '700f5b18-cbb3-4d38-9c61-e3bc3a3852b9', + 'ethernet', 'eth0'), + Connection('Wired connection 1', + '700f5b18-cbb3-4d38-9c61-999999999999', 'ethernet', 'eth1') + ] + + connection.show_all(active=True) + assert s.passed_parameters == ['connection', 'show', '--active'] + + def test_reload(): s = DummySystemCommand() connection = ConnectionControl(s) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/tests/test_device.py new/nmcli-1.7.0/tests/test_device.py --- old/nmcli-1.6.0/tests/test_device.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/tests/test_device.py 2026-01-03 02:55:41.000000000 +0100 @@ -171,6 +171,17 @@ assert s2.passed_parameters == ['-f', 'all', 'device', 'show'] +def test_up(): + s = DummySystemCommand() + device = DeviceControl(s) + ifname = 'eth0' + device.up(ifname) + assert s.passed_parameters == ['device', 'up', ifname] + + device.up(ifname, wait=10) + assert s.passed_parameters == ['--wait', '10', 'device', 'up', ifname] + + def test_connect(): s = DummySystemCommand() device = DeviceControl(s) @@ -182,6 +193,18 @@ assert s.passed_parameters == ['--wait', '10', 'device', 'connect', ifname] +def test_down(): + s = DummySystemCommand() + device = DeviceControl(s) + ifname = 'eth0' + device.down(ifname) + assert s.passed_parameters == ['device', 'down', ifname] + + device.down(ifname, wait=10) + assert s.passed_parameters == [ + '--wait', '10', 'device', 'down', ifname] + + def test_disconnect(): s = DummySystemCommand() device = DeviceControl(s) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nmcli-1.6.0/tests/test_general.py new/nmcli-1.7.0/tests/test_general.py --- old/nmcli-1.6.0/tests/test_general.py 2025-12-14 05:51:05.000000000 +0100 +++ new/nmcli-1.7.0/tests/test_general.py 2026-01-03 02:55:41.000000000 +0100 @@ -1,3 +1,5 @@ +import pytest + from nmcli._const import NetworkConnectivity, NetworkManagerState from nmcli._general import GeneralControl from nmcli.data import General @@ -37,3 +39,41 @@ general = GeneralControl(s) general.set_hostname('test') assert s.passed_parameters == ['general', 'hostname', 'test'] + + +def test_reload_without_flags(): + s = DummySystemCommand() + general = GeneralControl(s) + general.reload() + assert s.passed_parameters == ['general', 'reload'] + + +def test_reload_with_single_flag(): + s = DummySystemCommand() + general = GeneralControl(s) + general.reload(['conf']) + assert s.passed_parameters == ['general', 'reload', 'conf'] + + +def test_reload_with_all_valid_flags(): + s = DummySystemCommand() + general = GeneralControl(s) + general.reload(['conf', 'dns-rc', 'dns-full']) + assert s.passed_parameters == ['general', 'reload', 'conf', 'dns-rc', 'dns-full'] + + +def test_reload_with_invalid_flag(): + s = DummySystemCommand() + general = GeneralControl(s) + with pytest.raises(ValueError) as exc_info: + general.reload(['invalid-flag']) + assert "Invalid reload flag 'invalid-flag'" in str(exc_info.value) + assert "Valid flags are: conf, dns-rc, dns-full" in str(exc_info.value) + + +def test_reload_with_mixed_valid_and_invalid_flags(): + s = DummySystemCommand() + general = GeneralControl(s) + with pytest.raises(ValueError) as exc_info: + general.reload(['conf', 'invalid']) + assert "Invalid reload flag 'invalid'" in str(exc_info.value)
