diff options
author | Thomas Haller <thaller@redhat.com> | 2019-12-13 09:32:23 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-12-13 13:19:31 +0100 |
commit | ffc235c30d40ccf375130a638b2c9cc18f5971c5 (patch) | |
tree | bcc63c728548cd8af23d5e08604f4c3d4ed10893 /clients | |
parent | 70ebdc77307d9710673d83e52ea5a13480f8988a (diff) | |
download | NetworkManager-ffc235c30d40ccf375130a638b2c9cc18f5971c5.tar.gz |
clients/tests: rename "replace_stdout" variable to "replace_uuids"
The variable name should say what it is, not what it is used for.
E.g. we would use the very same replacements for stderr. Rename
so that it can (by its name) used for different purposes.
Diffstat (limited to 'clients')
-rwxr-xr-x | clients/tests/test-client.py | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/clients/tests/test-client.py b/clients/tests/test-client.py index 10739239b8..7daab013b8 100755 --- a/clients/tests/test-client.py +++ b/clients/tests/test-client.py @@ -1027,38 +1027,38 @@ class TestNmcli(NmTestBase): def test_003(self): self.init_001() - replace_stdout = [] + replace_uuids = [] - replace_stdout.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-xx1')), 'UUID-con-xx1-REPLACED-REPLACED-REPLA')) + replace_uuids.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-xx1')), 'UUID-con-xx1-REPLACED-REPLACED-REPLA')) self.call_nmcli(['c', 'add', 'type', 'ethernet', 'ifname', '*', 'con-name', 'con-xx1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['c', 's'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) - replace_stdout.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-gsm1')), 'UUID-con-gsm1-REPLACED-REPLACED-REPL')) + replace_uuids.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-gsm1')), 'UUID-con-gsm1-REPLACED-REPLACED-REPL')) self.call_nmcli(['connection', 'add', 'type', 'gsm', 'autoconnect', 'no', 'con-name', 'con-gsm1', 'ifname', '*', 'apn', 'xyz.con-gsm1', 'serial.baud', '5', 'serial.send-delay', '100', 'serial.pari', '1', 'ipv4.dns-options', ' '], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) - replace_stdout.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('ethernet')), 'UUID-ethernet-REPLACED-REPLACED-REPL')) + replace_uuids.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('ethernet')), 'UUID-ethernet-REPLACED-REPLACED-REPL')) self.call_nmcli(['c', 'add', 'type', 'ethernet', 'ifname', '*'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['c', 's'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ALL', 'c', 's'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['--complete-args', '-f', 'ALL', 'c', 's', ''], - replace_stdout = replace_stdout, + replace_stdout = replace_uuids, sort_lines_stdout = True) self.call_nmcli_l(['con', 's', 'con-gsm1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) # activate the same profile on multiple devices. Our stub-implmentation # is fine with that... although NetworkManager service would reject @@ -1074,41 +1074,41 @@ class TestNmcli(NmTestBase): self.call_nmcli(['con', 'up', 'ethernet', 'ifname', dev]) self.call_nmcli_l(['con'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ALL', 'con'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ALL', 'con', 's', '-a'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ACTIVE-PATH,DEVICE,UUID', 'con', 's', '-act'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'UUID,NAME', 'con', 's', '--active'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ALL', 'con', 's', 'ethernet'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'GENERAL.STATE', 'con', 's', 'ethernet'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['con', 's', 'ethernet'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ALL', 'dev', 'status'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) # test invalid call ('s' abbrevates 'status' and not 'show' self.call_nmcli_l(['-f', 'ALL', 'dev', 's', 'eth0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ALL', 'dev', 'show', 'eth0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['-f', 'ALL', '-t', 'dev', 'show', 'eth0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.async_wait() @@ -1123,30 +1123,30 @@ class TestNmcli(NmTestBase): for mode in Util.iter_nmcli_output_modes(): self.call_nmcli_l(mode + ['-f', 'ALL', 'con'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'UUID,TYPE', 'con'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['con', 's', 'ethernet'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['c', 's', '/org/freedesktop/NetworkManager/ActiveConnection/1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'all', 'dev', 'show', 'eth0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) @nm_test def test_004(self): self.init_001() - replace_stdout = [] + replace_uuids = [] - replace_stdout.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-xx1')), 'UUID-con-xx1-REPLACED-REPLACED-REPLA')) + replace_uuids.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-xx1')), 'UUID-con-xx1-REPLACED-REPLACED-REPLA')) self.call_nmcli(['c', 'add', 'type', 'wifi', 'ifname', '*', 'ssid', 'foobar', 'con-name', 'con-xx1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli(['connection', 'mod', 'con-xx1', 'ip.gateway', '']) self.call_nmcli(['connection', 'mod', 'con-xx1', 'ipv4.gateway', '172.16.0.1'], lang = 'pl') @@ -1155,29 +1155,29 @@ class TestNmcli(NmTestBase): self.call_nmcli(['connection', 'mod', 'con-xx1', '802-11-wireless.band', 'a']) self.call_nmcli(['connection', 'mod', 'con-xx1', 'ipv4.addresses', '192.168.77.5/24', 'ipv4.routes', '2.3.4.5/32 192.168.77.1', 'ipv6.addresses', '1:2:3:4::6/64', 'ipv6.routes', '1:2:3:4:5:6::5/128']) self.call_nmcli_l(['con', 's', 'con-xx1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.async_wait() - replace_stdout.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-vpn-1')), 'UUID-con-vpn-1-REPLACED-REPLACED-REP')) + replace_uuids.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-vpn-1')), 'UUID-con-vpn-1-REPLACED-REPLACED-REP')) self.call_nmcli(['connection', 'add', 'type', 'vpn', 'con-name', 'con-vpn-1', 'ifname', '*', 'vpn-type', 'openvpn', 'vpn.data', 'key1 = val1, key2 = val2, key3=val3'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['con', 's'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['con', 's', 'con-vpn-1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli(['con', 'up', 'con-xx1']) self.call_nmcli_l(['con', 's'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli(['con', 'up', 'con-vpn-1']) self.call_nmcli_l(['con', 's'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(['con', 's', 'con-vpn-1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.async_wait() @@ -1188,72 +1188,72 @@ class TestNmcli(NmTestBase): for mode in Util.iter_nmcli_output_modes(): self.call_nmcli_l(mode + ['con', 's', 'con-vpn-1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['con', 's', 'con-vpn-1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'ALL', 'con', 's', 'con-vpn-1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) # This only filters 'vpn' settings from the connection profile. # Contrary to '-f GENERAL' below, it does not show the properties of # the activated VPN connection. This is a nmcli bug. self.call_nmcli_l(mode + ['-f', 'VPN', 'con', 's', 'con-vpn-1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'GENERAL', 'con', 's', 'con-vpn-1'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['dev', 's'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'all', 'dev', 'status'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['dev', 'show'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'all', 'dev', 'show'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['dev', 'show', 'wlan0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'all', 'dev', 'show', 'wlan0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'GENERAL,GENERAL.HWADDR,WIFI-PROPERTIES', 'dev', 'show', 'wlan0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'GENERAL,GENERAL.HWADDR,WIFI-PROPERTIES', 'dev', 'show', 'wlan0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'DEVICE,TYPE,DBUS-PATH', 'dev'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'ALL', 'device', 'wifi', 'list' ], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'COMMON', 'device', 'wifi', 'list' ], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'NAME,SSID,SSID-HEX,BSSID,MODE,CHAN,FREQ,RATE,SIGNAL,BARS,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE,IN-USE,DBUS-PATH', 'device', 'wifi', 'list'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'ALL', 'device', 'wifi', 'list', 'bssid', 'C0:E2:BE:E8:EF:B6'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'COMMON', 'device', 'wifi', 'list', 'bssid', 'C0:E2:BE:E8:EF:B6'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'NAME,SSID,SSID-HEX,BSSID,MODE,CHAN,FREQ,RATE,SIGNAL,BARS,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE,IN-USE,DBUS-PATH', 'device', 'wifi', 'list', 'bssid', 'C0:E2:BE:E8:EF:B6'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'ALL', 'device', 'show', 'wlan0' ], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'COMMON', 'device', 'show', 'wlan0' ], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['-f', 'GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,WIMAX-PROPERTIES,NSP,IP4,DHCP4,IP6,DHCP6,BOND,TEAM,BRIDGE,VLAN,BLUETOOTH,CONNECTIONS', 'device', 'show', 'wlan0' ], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) self.call_nmcli_l(mode + ['dev', 'lldp', 'list', 'ifname', 'eth0'], - replace_stdout = replace_stdout) + replace_stdout = replace_uuids) ############################################################################### |