From 89824cd80189c45fa56b7856d9946de2f8e75897 Mon Sep 17 00:00:00 2001 From: Yedaya Katsman Date: Tue, 17 Jun 2025 00:14:31 +0300 Subject: [PATCH] test(interfaces): Test completion of veth peers Follow up to https://github.com/scop/bash-completion/pull/1393 Depends on https://github.com/scop/bash-completion/pull/1394 --- test/fixtures/shared/bin/ifconfig | 19 ++++++++++++++++++- test/fixtures/shared/bin/ip | 12 ++++++++++++ .../test_unit_compgen_available_interfaces.py | 5 ++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/test/fixtures/shared/bin/ifconfig b/test/fixtures/shared/bin/ifconfig index 59c9140b9d5..c31481a571f 100755 --- a/test/fixtures/shared/bin/ifconfig +++ b/test/fixtures/shared/bin/ifconfig @@ -1,6 +1,6 @@ #!/bin/sh -# Dummy "ifconfig -a" emulator +# Dummy "ifconfig -a" emulator, from net-tools 1.60, ifconfig 1.42 (2001-04-13) cat < mtu 1500 qdisc noqueue state UP mode DEFAULT group default link/ether 33:33:33:33:33:33 brd ff:ff:ff:ff:ff:ff link-netnsid 0 +5: peer2@peer1: mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 + link/ether 33:33:33:33:33:33 brd ff:ff:ff:ff:ff:ff +6: peer1@peer2: mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 + link/ether 33:33:33:33:33:33 brd ff:ff:ff:ff:ff:ff EOF exit 0 ;; @@ -27,6 +31,14 @@ EOF valid_lft forever preferred_lft forever inet6 fe80::000:0000:0000:0000/64 scope link valid_lft forever preferred_lft forever +5: peer2@peer1: mtu 1500 qdisc noqueue state UP group default qlen 1000 + link/ether 33:33:33:33:33:33 brd ff:ff:ff:ff:ff:ff + inet6 fe80::000:0000:0000:0000/64 scope link + valid_lft forever preferred_lft forever +6: peer1@peer2: mtu 1500 qdisc noqueue state UP group default qlen 1000 + link/ether 33:33:33:33:33:33 brd ff:ff:ff:ff:ff:ff + inet6 fe80::000:0000:0000:0000/64 scope link + valid_lft forever preferred_lft forever EOF exit 0 ;; diff --git a/test/t/unit/test_unit_compgen_available_interfaces.py b/test/t/unit/test_unit_compgen_available_interfaces.py index f6548feb1a4..5e487283d10 100644 --- a/test/t/unit/test_unit_compgen_available_interfaces.py +++ b/test/t/unit/test_unit_compgen_available_interfaces.py @@ -42,4 +42,7 @@ def test_2_correct_interfaces(self, bash, functions, remove_one_tool): "_comp__test_compgen available_interfaces", want_output=True, ) - assert all(iface in output for iface in ["", ""]) + assert all( + iface in output + for iface in ["", "", "", ""] + )