clients/tests: add test for nmcli device wifi output

Thereby, drop unneeded NM_TEST_CLIENT_IN_DBUS_SESSION=0 environment
variable from Makefile.am.
This commit is contained in:
Thomas Haller 2018-05-14 14:18:03 +02:00
parent 320422e4cf
commit beca21be80
13 changed files with 59 additions and 36 deletions

View file

@ -3793,7 +3793,6 @@ check-local-clients-tests-test-client: clients/cli/nmcli clients/tests/test-clie
LD_LIBRARY_PATH="$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}" \
NM_TEST_CLIENT_BUILDDIR="$(abs_builddir)" \
NM_TEST_CLIENT_NMCLI_PATH=clients/cli/nmcli \
NM_TEST_CLIENT_IN_DBUS_SESSION=0 \
$(srcdir)/clients/tests/test-client.py -v &> "$(builddir)/clients/tests/test-client.log" && r=ok; \
cat "$(builddir)/clients/tests/test-client.log"; \
test "$$r" == ok
@ -3828,6 +3827,7 @@ EXTRA_DIST += \
clients/tests/test-client.check-on-disk/test_002-015.expected \
clients/tests/test-client.check-on-disk/test_002-016.expected \
clients/tests/test-client.check-on-disk/test_002-017.expected \
clients/tests/test-client.check-on-disk/test_002-018.expected \
clients/tests/test-client.check-on-disk/test_003-001.expected \
clients/tests/test-client.check-on-disk/test_003-002.expected \
clients/tests/test-client.check-on-disk/test_003-003.expected \

View file

@ -1,11 +1,18 @@
location: clients/tests/test-client.py:522:test_002()/16
cmd: $NMCLI c
cmd: $NMCLI -f ALL d wifi
lang: C
returncode: 0
stdout: 126 bytes
stdout: 1840 bytes
>>>
NAME UUID TYPE DEVICE
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet --
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan0-ap-3 776C616E302D61702D33 A1:A2:78:A7:C5:D5 Infra 1 2412 MHz 54 Mbit/s 61 *** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan0 no /org/freedesktop/NetworkManager/AccessPoint/2
AP[2] wlan0-ap-1 776C616E302D61702D31 EA:BF:C2:09:F9:F9 Infra 1 2412 MHz 54 Mbit/s 34 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan0 no /org/freedesktop/NetworkManager/AccessPoint/0
AP[3] wlan0-ap-2 776C616E302D61702D32 81:28:C5:C2:E5:15 Infra 1 2412 MHz 54 Mbit/s 29 * WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan0 no /org/freedesktop/NetworkManager/AccessPoint/1
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan1-ap-4 776C616E312D61702D34 53:8C:FC:BD:7D:2B Infra 1 2412 MHz 54 Mbit/s 88 **** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan1 no /org/freedesktop/NetworkManager/AccessPoint/3
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
<<<
stderr: 0 bytes

View file

@ -1,30 +1,11 @@
location: clients/tests/test-client.py:524:test_002()/17
cmd: $NMCLI c s con-1
cmd: $NMCLI c
lang: C
returncode: 0
stdout: 990 bytes
stdout: 126 bytes
>>>
connection.id: con-1
connection.uuid: 5fcfd6d7-1e63-3332-8826-a7eda103792d
connection.stable-id: --
connection.type: 802-3-ethernet
connection.interface-name: --
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.auth-retries: -1
connection.timestamp: 0
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
NAME UUID TYPE DEVICE
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet --
<<<
stderr: 0 bytes

View file

@ -0,0 +1,33 @@
location: clients/tests/test-client.py:526:test_002()/18
cmd: $NMCLI c s con-1
lang: C
returncode: 0
stdout: 990 bytes
>>>
connection.id: con-1
connection.uuid: 5fcfd6d7-1e63-3332-8826-a7eda103792d
connection.stable-id: --
connection.type: 802-3-ethernet
connection.interface-name: --
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.auth-retries: -1
connection.timestamp: 0
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
<<<
stderr: 0 bytes
>>>
<<<

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:534:test_003()/1
location: clients/tests/test-client.py:536:test_003()/1
cmd: $NMCLI c add type ethernet ifname '*' con-name con-xx1
lang: C
returncode: 0

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:537:test_003()/2
location: clients/tests/test-client.py:539:test_003()/2
cmd: $NMCLI c s
lang: C
returncode: 0

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:542:test_003()/3
location: clients/tests/test-client.py:544:test_003()/3
cmd: $NMCLI c add type ethernet ifname '*'
lang: C
returncode: 0

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:545:test_003()/4
location: clients/tests/test-client.py:547:test_003()/4
cmd: $NMCLI c s
lang: C
returncode: 0

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:547:test_003()/5
location: clients/tests/test-client.py:549:test_003()/5
cmd: $NMCLI c s
lang: pl_PL.UTF-8
returncode: 0

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:550:test_003()/6
location: clients/tests/test-client.py:552:test_003()/6
cmd: $NMCLI -f ALL c s
lang: C
returncode: 0

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:552:test_003()/7
location: clients/tests/test-client.py:554:test_003()/7
cmd: $NMCLI -f ALL c s
lang: pl_PL.UTF-8
returncode: 0

View file

@ -1,4 +1,4 @@
location: clients/tests/test-client.py:556:test_003()/8
location: clients/tests/test-client.py:558:test_003()/8
cmd: $NMCLI --complete-args -f ALL c s ''
lang: pl_PL.UTF-8
returncode: 0

View file

@ -519,6 +519,8 @@ class TestNmcli(NmTestBase):
self.call_nmcli(['-f', 'AP', '-mode', 'tabular', '-p', 'd', 'show', 'wlan0'], lang = 'pl')
self.call_nmcli(['-f', 'AP', '-mode', 'tabular', '-t', 'd', 'show', 'wlan0'], lang = 'pl')
self.call_nmcli(['-f', 'ALL', 'd', 'wifi'])
self.call_nmcli(['c'])
self.call_nmcli(['c', 's', 'con-1'])