clients/tests: don't include the source line number with client tests output

The client tests compare the test output with a .expected file that is
commit to git and that contains the expected output.

The expected output contains data like

    size: 395
    location: clients/tests/test-client.py:842:test_001()/1
    cmd: $NMCLI
    lang: C
    returncode: 0
    stdout: 277 bytes
    >>>
    ...

Note that there is the line number (clients/tests/test-client.py:842) of
the source code where nmcli is called. This is to help correlate the output
with the test code.

However, Python 3.8 changes behavior and for function calls that span multiple
lines, frame.f_lineno will give now the starting line (previously, it gave the last
line) (see [1]).

No longer include the line number, as it is not stable accross Python versions.

If you really care, you can set NM_TEST_WITH_LINENO to get the line numbers back.
Of course, then the expected output won't match anymore, and you'd have to regenerate
it first. This is only useful if you debug tests, and want to have it easier to
correlate output with the tests while developing them.

[1] https://bugs.python.org/issue38283

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/292
(cherry picked from commit ad3ef326aa)
This commit is contained in:
Thomas Haller 2019-09-26 13:45:15 +02:00
parent 460ed8112f
commit 275a7c46a1
5 changed files with 33725 additions and 31248 deletions

View file

@ -1,5 +1,5 @@
size: 395
location: clients/tests/test-client.py:842:test_001()/1
size: 391
location: clients/tests/test-client.py:test_001()/1
cmd: $NMCLI
lang: C
returncode: 0
@ -14,8 +14,8 @@ Use "nmcli device show" to get complete information about known devices and
Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.
<<<
size: 438
location: clients/tests/test-client.py:842:test_001()/2
size: 434
location: clients/tests/test-client.py:test_001()/2
cmd: $NMCLI
lang: pl_PL.UTF-8
returncode: 0
@ -32,8 +32,8 @@ Strony podręcznika nmcli(1) i nmcli-examples(7) zawierają pełne informacje
o użyciu.
<<<
size: 188
location: clients/tests/test-client.py:844:test_001()/3
size: 184
location: clients/tests/test-client.py:test_001()/3
cmd: $NMCLI -f AP -mode multiline -p d show wlan0
lang: C
returncode: 10
@ -42,8 +42,8 @@ stderr: 33 bytes
Error: Device 'wlan0' not found.
<<<
size: 214
location: clients/tests/test-client.py:844:test_001()/4
size: 210
location: clients/tests/test-client.py:test_001()/4
cmd: $NMCLI -f AP -mode multiline -p d show wlan0
lang: pl_PL.UTF-8
returncode: 10
@ -52,8 +52,8 @@ stderr: 49 bytes
Błąd: Nie odnaleziono urządzenia „wlan0”.
<<<
size: 120
location: clients/tests/test-client.py:846:test_001()/5
size: 116
location: clients/tests/test-client.py:test_001()/5
cmd: $NMCLI c s
lang: C
returncode: 0
@ -62,8 +62,8 @@ stdout: 1 bytes
<<<
size: 130
location: clients/tests/test-client.py:846:test_001()/6
size: 126
location: clients/tests/test-client.py:test_001()/6
cmd: $NMCLI c s
lang: pl_PL.UTF-8
returncode: 0
@ -72,8 +72,8 @@ stdout: 1 bytes
<<<
size: 192
location: clients/tests/test-client.py:848:test_001()/7
size: 188
location: clients/tests/test-client.py:test_001()/7
cmd: $NMCLI bogus s
lang: C
returncode: 2
@ -82,8 +82,8 @@ stderr: 68 bytes
Error: argument 'bogus' not understood. Try passing --help instead.
<<<
size: 221
location: clients/tests/test-client.py:848:test_001()/8
size: 217
location: clients/tests/test-client.py:test_001()/8
cmd: $NMCLI bogus s
lang: pl_PL.UTF-8
returncode: 2
@ -92,8 +92,8 @@ stderr: 87 bytes
Błąd: nie zrozumiano parametru „bogus”. Można użyć „--help” zamiast tego.
<<<
size: 1488
location: clients/tests/test-client.py:851:test_001()/9
size: 1484
location: clients/tests/test-client.py:test_001()/9
cmd: $NMCLI general permissions
lang: C
returncode: 0
@ -119,8 +119,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1517
location: clients/tests/test-client.py:851:test_001()/10
size: 1513
location: clients/tests/test-client.py:test_001()/10
cmd: $NMCLI general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -146,8 +146,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1618
location: clients/tests/test-client.py:851:test_001()/11
size: 1614
location: clients/tests/test-client.py:test_001()/11
cmd: $NMCLI --color yes general permissions
lang: C
returncode: 0
@ -173,8 +173,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1646
location: clients/tests/test-client.py:851:test_001()/12
size: 1642
location: clients/tests/test-client.py:test_001()/12
cmd: $NMCLI --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -200,8 +200,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1695
location: clients/tests/test-client.py:851:test_001()/13
size: 1691
location: clients/tests/test-client.py:test_001()/13
cmd: $NMCLI --pretty general permissions
lang: C
returncode: 0
@ -231,8 +231,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1753
location: clients/tests/test-client.py:851:test_001()/14
size: 1749
location: clients/tests/test-client.py:test_001()/14
cmd: $NMCLI --pretty general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -262,8 +262,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1824
location: clients/tests/test-client.py:851:test_001()/15
size: 1820
location: clients/tests/test-client.py:test_001()/15
cmd: $NMCLI --pretty --color yes general permissions
lang: C
returncode: 0
@ -293,8 +293,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1882
location: clients/tests/test-client.py:851:test_001()/16
size: 1878
location: clients/tests/test-client.py:test_001()/16
cmd: $NMCLI --pretty --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -324,8 +324,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1094
location: clients/tests/test-client.py:851:test_001()/17
size: 1090
location: clients/tests/test-client.py:test_001()/17
cmd: $NMCLI --terse general permissions
lang: C
returncode: 0
@ -350,8 +350,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 1104
location: clients/tests/test-client.py:851:test_001()/18
size: 1100
location: clients/tests/test-client.py:test_001()/18
cmd: $NMCLI --terse general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -376,8 +376,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 1224
location: clients/tests/test-client.py:851:test_001()/19
size: 1220
location: clients/tests/test-client.py:test_001()/19
cmd: $NMCLI --terse --color yes general permissions
lang: C
returncode: 0
@ -402,8 +402,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 1234
location: clients/tests/test-client.py:851:test_001()/20
size: 1230
location: clients/tests/test-client.py:test_001()/20
cmd: $NMCLI --terse --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -428,8 +428,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 1504
location: clients/tests/test-client.py:851:test_001()/21
size: 1500
location: clients/tests/test-client.py:test_001()/21
cmd: $NMCLI --mode tabular general permissions
lang: C
returncode: 0
@ -455,8 +455,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1532
location: clients/tests/test-client.py:851:test_001()/22
size: 1528
location: clients/tests/test-client.py:test_001()/22
cmd: $NMCLI --mode tabular general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -482,8 +482,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1633
location: clients/tests/test-client.py:851:test_001()/23
size: 1629
location: clients/tests/test-client.py:test_001()/23
cmd: $NMCLI --mode tabular --color yes general permissions
lang: C
returncode: 0
@ -509,8 +509,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1661
location: clients/tests/test-client.py:851:test_001()/24
size: 1657
location: clients/tests/test-client.py:test_001()/24
cmd: $NMCLI --mode tabular --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -536,8 +536,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1710
location: clients/tests/test-client.py:851:test_001()/25
size: 1706
location: clients/tests/test-client.py:test_001()/25
cmd: $NMCLI --mode tabular --pretty general permissions
lang: C
returncode: 0
@ -567,8 +567,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1768
location: clients/tests/test-client.py:851:test_001()/26
size: 1764
location: clients/tests/test-client.py:test_001()/26
cmd: $NMCLI --mode tabular --pretty general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -598,8 +598,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1839
location: clients/tests/test-client.py:851:test_001()/27
size: 1835
location: clients/tests/test-client.py:test_001()/27
cmd: $NMCLI --mode tabular --pretty --color yes general permissions
lang: C
returncode: 0
@ -629,8 +629,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check unknown
org.freedesktop.NetworkManager.wifi.scan unknown
<<<
size: 1897
location: clients/tests/test-client.py:851:test_001()/28
size: 1893
location: clients/tests/test-client.py:test_001()/28
cmd: $NMCLI --mode tabular --pretty --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -660,8 +660,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check nieznane
org.freedesktop.NetworkManager.wifi.scan nieznane
<<<
size: 1109
location: clients/tests/test-client.py:851:test_001()/29
size: 1105
location: clients/tests/test-client.py:test_001()/29
cmd: $NMCLI --mode tabular --terse general permissions
lang: C
returncode: 0
@ -686,8 +686,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 1119
location: clients/tests/test-client.py:851:test_001()/30
size: 1115
location: clients/tests/test-client.py:test_001()/30
cmd: $NMCLI --mode tabular --terse general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -712,8 +712,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 1239
location: clients/tests/test-client.py:851:test_001()/31
size: 1235
location: clients/tests/test-client.py:test_001()/31
cmd: $NMCLI --mode tabular --terse --color yes general permissions
lang: C
returncode: 0
@ -738,8 +738,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 1249
location: clients/tests/test-client.py:851:test_001()/32
size: 1245
location: clients/tests/test-client.py:test_001()/32
cmd: $NMCLI --mode tabular --terse --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -764,8 +764,8 @@ org.freedesktop.NetworkManager.enable-disable-connectivity-check:unknown
org.freedesktop.NetworkManager.wifi.scan:unknown
<<<
size: 2464
location: clients/tests/test-client.py:851:test_001()/33
size: 2460
location: clients/tests/test-client.py:test_001()/33
cmd: $NMCLI --mode multiline general permissions
lang: C
returncode: 0
@ -807,8 +807,8 @@ PERMISSION: org.freedesktop.NetworkManager.wifi.scan
VALUE: unknown
<<<
size: 2481
location: clients/tests/test-client.py:851:test_001()/34
size: 2477
location: clients/tests/test-client.py:test_001()/34
cmd: $NMCLI --mode multiline general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -850,8 +850,8 @@ PERMISSION: org.freedesktop.NetworkManager.wifi.scan
VALUE: nieznane
<<<
size: 2593
location: clients/tests/test-client.py:851:test_001()/35
size: 2589
location: clients/tests/test-client.py:test_001()/35
cmd: $NMCLI --mode multiline --color yes general permissions
lang: C
returncode: 0
@ -893,8 +893,8 @@ PERMISSION: org.freedesktop.NetworkManager.wifi.scan
VALUE: unknown
<<<
size: 2610
location: clients/tests/test-client.py:851:test_001()/36
size: 2606
location: clients/tests/test-client.py:test_001()/36
cmd: $NMCLI --mode multiline --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -936,8 +936,8 @@ PERMISSION: org.freedesktop.NetworkManager.wifi.scan
VALUE: nieznane
<<<
size: 4046
location: clients/tests/test-client.py:851:test_001()/37
size: 4042
location: clients/tests/test-client.py:test_001()/37
cmd: $NMCLI --mode multiline --pretty general permissions
lang: C
returncode: 0
@ -999,8 +999,8 @@ VALUE: unknown
-------------------------------------------------------------------------------
<<<
size: 4068
location: clients/tests/test-client.py:851:test_001()/38
size: 4064
location: clients/tests/test-client.py:test_001()/38
cmd: $NMCLI --mode multiline --pretty general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -1062,8 +1062,8 @@ VALUE: nieznane
-------------------------------------------------------------------------------
<<<
size: 4175
location: clients/tests/test-client.py:851:test_001()/39
size: 4171
location: clients/tests/test-client.py:test_001()/39
cmd: $NMCLI --mode multiline --pretty --color yes general permissions
lang: C
returncode: 0
@ -1125,8 +1125,8 @@ VALUE: unknown
-------------------------------------------------------------------------------
<<<
size: 4197
location: clients/tests/test-client.py:851:test_001()/40
size: 4193
location: clients/tests/test-client.py:test_001()/40
cmd: $NMCLI --mode multiline --pretty --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -1188,8 +1188,8 @@ VALUE: nieznane
-------------------------------------------------------------------------------
<<<
size: 1401
location: clients/tests/test-client.py:851:test_001()/41
size: 1397
location: clients/tests/test-client.py:test_001()/41
cmd: $NMCLI --mode multiline --terse general permissions
lang: C
returncode: 0
@ -1231,8 +1231,8 @@ PERMISSION:org.freedesktop.NetworkManager.wifi.scan
VALUE:unknown
<<<
size: 1411
location: clients/tests/test-client.py:851:test_001()/42
size: 1407
location: clients/tests/test-client.py:test_001()/42
cmd: $NMCLI --mode multiline --terse general permissions
lang: pl_PL.UTF-8
returncode: 0
@ -1274,8 +1274,8 @@ PERMISSION:org.freedesktop.NetworkManager.wifi.scan
VALUE:unknown
<<<
size: 1530
location: clients/tests/test-client.py:851:test_001()/43
size: 1526
location: clients/tests/test-client.py:test_001()/43
cmd: $NMCLI --mode multiline --terse --color yes general permissions
lang: C
returncode: 0
@ -1317,8 +1317,8 @@ PERMISSION:org.freedesktop.NetworkManager.wifi.scan
VALUE:unknown
<<<
size: 1540
location: clients/tests/test-client.py:851:test_001()/44
size: 1536
location: clients/tests/test-client.py:test_001()/44
cmd: $NMCLI --mode multiline --terse --color yes general permissions
lang: pl_PL.UTF-8
returncode: 0

View file

@ -1,5 +1,5 @@
size: 377
location: clients/tests/test-client.py:857:test_002()/1
size: 373
location: clients/tests/test-client.py:test_002()/1
cmd: $NMCLI d
lang: C
returncode: 0
@ -13,8 +13,8 @@ wlan1 wifi unavailable --
wlan1 wifi unavailable --
<<<
size: 392
location: clients/tests/test-client.py:857:test_002()/2
size: 388
location: clients/tests/test-client.py:test_002()/2
cmd: $NMCLI d
lang: pl_PL.UTF-8
returncode: 0
@ -28,8 +28,8 @@ wlan1 wifi niedostępne --
wlan1 wifi niedostępne --
<<<
size: 978
location: clients/tests/test-client.py:859:test_002()/3
size: 974
location: clients/tests/test-client.py:test_002()/3
cmd: $NMCLI -f all d
lang: C
returncode: 0
@ -43,8 +43,8 @@ wlan1 wifi unavailable unknown unknown /org/freedesk
wlan1 wifi unavailable unknown unknown /org/freedesktop/NetworkManager/Devices/5 -- -- --
<<<
size: 993
location: clients/tests/test-client.py:859:test_002()/4
size: 989
location: clients/tests/test-client.py:test_002()/4
cmd: $NMCLI -f all d
lang: pl_PL.UTF-8
returncode: 0
@ -58,8 +58,8 @@ wlan1 wifi niedostępne nieznane nieznane /org/freedes
wlan1 wifi niedostępne nieznane nieznane /org/freedesktop/NetworkManager/Devices/5 -- -- --
<<<
size: 739
location: clients/tests/test-client.py:861:test_002()/5
size: 735
location: clients/tests/test-client.py:test_002()/5
cmd: $NMCLI
lang: C
returncode: 0
@ -94,8 +94,8 @@ Use "nmcli device show" to get complete information about known devices and
Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.
<<<
size: 812
location: clients/tests/test-client.py:861:test_002()/6
size: 808
location: clients/tests/test-client.py:test_002()/6
cmd: $NMCLI
lang: pl_PL.UTF-8
returncode: 0
@ -132,8 +132,16 @@ Strony podręcznika nmcli(1) i nmcli-examples(7) zawierają pełne informacje
o użyciu.
<<<
<<<<<<< HEAD
size: 1250
location: clients/tests/test-client.py:863:test_002()/7
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 1424
location: clients/tests/test-client.py:863:test_002()/7
=======
size: 1420
location: clients/tests/test-client.py:test_002()/7
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode multiline d show wlan0
lang: C
returncode: 0
@ -165,8 +173,16 @@ AP[3].BARS: **
AP[3].SECURITY: WPA1 WPA2
<<<
<<<<<<< HEAD
size: 1287
location: clients/tests/test-client.py:863:test_002()/8
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 1461
location: clients/tests/test-client.py:863:test_002()/8
=======
size: 1457
location: clients/tests/test-client.py:test_002()/8
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode multiline d show wlan0
lang: pl_PL.UTF-8
returncode: 0
@ -198,8 +214,16 @@ AP[3].BARS: **
AP[3].SECURITY: WPA1 WPA2
<<<
<<<<<<< HEAD
size: 1704
location: clients/tests/test-client.py:864:test_002()/9
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 1878
location: clients/tests/test-client.py:864:test_002()/9
=======
size: 1874
location: clients/tests/test-client.py:test_002()/9
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode multiline -p d show wlan0
lang: C
returncode: 0
@ -237,8 +261,16 @@ AP[3].SECURITY: WPA1 WPA2
-------------------------------------------------------------------------------
<<<
<<<<<<< HEAD
size: 1749
location: clients/tests/test-client.py:864:test_002()/10
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 1923
location: clients/tests/test-client.py:864:test_002()/10
=======
size: 1919
location: clients/tests/test-client.py:test_002()/10
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode multiline -p d show wlan0
lang: pl_PL.UTF-8
returncode: 0
@ -276,8 +308,16 @@ AP[3].SECURITY: WPA1 WPA2
-------------------------------------------------------------------------------
<<<
<<<<<<< HEAD
size: 581
location: clients/tests/test-client.py:865:test_002()/11
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 671
location: clients/tests/test-client.py:865:test_002()/11
=======
size: 667
location: clients/tests/test-client.py:test_002()/11
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode multiline -t d show wlan0
lang: C
returncode: 0
@ -309,8 +349,16 @@ AP[3].BARS:**
AP[3].SECURITY:WPA1 WPA2
<<<
<<<<<<< HEAD
size: 618
location: clients/tests/test-client.py:865:test_002()/12
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 708
location: clients/tests/test-client.py:865:test_002()/12
=======
size: 704
location: clients/tests/test-client.py:test_002()/12
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode multiline -t d show wlan0
lang: pl_PL.UTF-8
returncode: 0
@ -342,8 +390,16 @@ AP[3].BARS:**
AP[3].SECURITY:WPA1 WPA2
<<<
<<<<<<< HEAD
size: 455
location: clients/tests/test-client.py:866:test_002()/13
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 531
location: clients/tests/test-client.py:866:test_002()/13
=======
size: 527
location: clients/tests/test-client.py:test_002()/13
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode tabular d show wlan0
lang: C
returncode: 0
@ -355,8 +411,16 @@ AP[2] wlan0-ap-1 Infra 1 54 Mbit/s 44 ** WPA1
AP[3] wlan0-ap-2 Infra 1 54 Mbit/s 34 ** WPA1 WPA2
<<<
<<<<<<< HEAD
size: 499
location: clients/tests/test-client.py:866:test_002()/14
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 575
location: clients/tests/test-client.py:866:test_002()/14
=======
size: 571
location: clients/tests/test-client.py:test_002()/14
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode tabular d show wlan0
lang: pl_PL.UTF-8
returncode: 0
@ -368,8 +432,16 @@ AP[2] wlan0-ap-1 Infrastruktura 1 54Mb/s 44 ** WPA1
AP[3] wlan0-ap-2 Infrastruktura 1 54Mb/s 34 ** WPA1 WPA2
<<<
<<<<<<< HEAD
size: 614
location: clients/tests/test-client.py:867:test_002()/15
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 709
location: clients/tests/test-client.py:867:test_002()/15
=======
size: 705
location: clients/tests/test-client.py:test_002()/15
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode tabular -p d show wlan0
lang: C
returncode: 0
@ -385,8 +457,16 @@ AP[2] wlan0-ap-1 Infra 1 54 Mbit/s 44 ** WPA1
AP[3] wlan0-ap-2 Infra 1 54 Mbit/s 34 ** WPA1 WPA2
<<<
<<<<<<< HEAD
size: 694
location: clients/tests/test-client.py:867:test_002()/16
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 789
location: clients/tests/test-client.py:867:test_002()/16
=======
size: 785
location: clients/tests/test-client.py:test_002()/16
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode tabular -p d show wlan0
lang: pl_PL.UTF-8
returncode: 0
@ -402,8 +482,16 @@ AP[2] wlan0-ap-1 Infrastruktura 1 54Mb/s 44 ** WPA1
AP[3] wlan0-ap-2 Infrastruktura 1 54Mb/s 34 ** WPA1 WPA2
<<<
<<<<<<< HEAD
size: 309
location: clients/tests/test-client.py:868:test_002()/17
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 378
location: clients/tests/test-client.py:868:test_002()/17
=======
size: 374
location: clients/tests/test-client.py:test_002()/17
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode tabular -t d show wlan0
lang: C
returncode: 0
@ -414,8 +502,16 @@ AP[2]: :wlan0-ap-1:Infra:1:54 Mbit/s:44:** :WPA1
AP[3]: :wlan0-ap-2:Infra:1:54 Mbit/s:34:** :WPA1 WPA2
<<<
<<<<<<< HEAD
size: 346
location: clients/tests/test-client.py:868:test_002()/18
||||||| parent of ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
size: 415
location: clients/tests/test-client.py:868:test_002()/18
=======
size: 411
location: clients/tests/test-client.py:test_002()/18
>>>>>>> ad3ef326aa7a... clients/tests: don't include the source line number with client tests output
cmd: $NMCLI -f AP -mode tabular -t d show wlan0
lang: pl_PL.UTF-8
returncode: 0
@ -426,8 +522,8 @@ AP[2]: :wlan0-ap-1:Infrastruktura:1:54Mb/s:44:** :WPA1
AP[3]: :wlan0-ap-2:Infrastruktura:1:54Mb/s:34:** :WPA1 WPA2
<<<
size: 1973
location: clients/tests/test-client.py:870:test_002()/19
size: 1969
location: clients/tests/test-client.py:test_002()/19
cmd: $NMCLI -f ALL d wifi
lang: C
returncode: 0
@ -444,8 +540,8 @@ AP[1] wlan1-ap-4 776C616E312D61702D34 EE:52:8B:49:A1:96 Infra 1 2412 MH
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
<<<
size: 2041
location: clients/tests/test-client.py:870:test_002()/20
size: 2037
location: clients/tests/test-client.py:test_002()/20
cmd: $NMCLI -f ALL d wifi
lang: pl_PL.UTF-8
returncode: 0
@ -462,8 +558,8 @@ AP[1] wlan1-ap-4 776C616E312D61702D34 EE:52:8B:49:A1:96 Infrastruktura 1
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
<<<
size: 246
location: clients/tests/test-client.py:872:test_002()/21
size: 242
location: clients/tests/test-client.py:test_002()/21
cmd: $NMCLI c
lang: C
returncode: 0
@ -473,8 +569,8 @@ NAME UUID TYPE DEVICE
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet --
<<<
size: 256
location: clients/tests/test-client.py:872:test_002()/22
size: 252
location: clients/tests/test-client.py:test_002()/22
cmd: $NMCLI c
lang: pl_PL.UTF-8
returncode: 0
@ -484,8 +580,8 @@ NAME UUID TYPE DEVICE
con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet --
<<<
size: 1267
location: clients/tests/test-client.py:874:test_002()/23
size: 1263
location: clients/tests/test-client.py:test_002()/23
cmd: $NMCLI c s con-1
lang: C
returncode: 0
@ -517,8 +613,8 @@ connection.llmnr: -1 (default)
connection.wait-device-timeout: -1
<<<
size: 1279
location: clients/tests/test-client.py:874:test_002()/24
size: 1275
location: clients/tests/test-client.py:test_002()/24
cmd: $NMCLI c s con-1
lang: pl_PL.UTF-8
returncode: 0

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -61,6 +61,13 @@ ENV_NM_TEST_CLIENT_CHECK_L10N = 'NM_TEST_CLIENT_CHECK_L10N'
# on disk with the expected output.
ENV_NM_TEST_REGENERATE = 'NM_TEST_REGENERATE'
# whether the file location should include the line number. That is useful
# only for debugging, to correlate the expected output with the test.
# Obviously, since the expected output is commited to git without line numbers,
# you'd have to first NM_TEST_REGENERATE the test expected data, with line
# numbers enabled.
ENV_NM_TEST_WITH_LINENO = 'NM_TEST_WITH_LINENO'
#
###############################################################################
@ -287,6 +294,8 @@ class Configuration:
# which we assert. That is useful, if there are intentional changes and
# we want to regenerate the expected output.
v = (os.environ.get(ENV_NM_TEST_REGENERATE, '0') == '1')
elif name == ENV_NM_TEST_WITH_LINENO:
v = (os.environ.get(ENV_NM_TEST_WITH_LINENO, '0') == '1')
else:
raise Exception()
self._values[name] = v
@ -561,7 +570,10 @@ class TestNmcli(NmTestBase):
# the file, so that the user can easier find the source (when looking at the .expected files)
self.assertTrue(os.path.abspath(frame.f_code.co_filename).endswith('/'+PathConfiguration.canonical_script_filename()))
calling_location = '%s:%d:%s()/%d' % (PathConfiguration.canonical_script_filename(), frame.f_lineno, frame.f_code.co_name, calling_num)
if conf.get(ENV_NM_TEST_WITH_LINENO):
calling_location = '%s:%d:%s()/%d' % (PathConfiguration.canonical_script_filename(), frame.f_lineno, frame.f_code.co_name, calling_num)
else:
calling_location = '%s:%s()/%d' % (PathConfiguration.canonical_script_filename(), frame.f_code.co_name, calling_num)
if lang is None or lang == 'C':
lang = 'C'
@ -1106,13 +1118,6 @@ class TestNmcli(NmTestBase):
def main():
global dbus_session_inited
if sys.version_info.major == 3 and sys.version_info.minor == 8 and sys.version_info.releaselevel == 'beta':
# 3.8-beta changed behavior for the line numbers, which
# breaks the tests (https://bugs.python.org/issue38283)
# skip the test for now.
print("WARNING: skip client test with python 3.8-beta")
sys.exit(0)
if len(sys.argv) >= 2 and sys.argv[1] == '--started-with-dbus-session':
dbus_session_inited = True
del sys.argv[1]