New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 735524 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Remove outdated flimflam test scripts

Project Member Reported by briannorris@chromium.org, Jun 21 2017

Issue description

The flimflam scripts ("shill-test-scripts") have several unpleasant edges:

=== Problem 1 ===

When the converting from flimflam to shill, the flimflam test scripts were mostly ported to use shill APIs. There were some APIs dropped along the way though, and the scripts didn't quite adapt. Simple things like this don't work:

# /usr/local/lib/flimflam/test/test-flimflam services
Traceback (most recent call last):
  File "/usr/local/lib/flimflam/test/test-flimflam", line 375, in <module>
    main()
  File "/usr/local/lib/flimflam/test/test-flimflam", line 161, in main
    print_services(properties["Services"])
  File "/usr/local/lib/flimflam/test/test-flimflam", line 136, in print_services
    if properties["Favorite"] == dbus.Boolean(1):
KeyError: 'Favorite'


(Hint: 'Favorite' doesn't exist any more)

=== Problem 2 ===

I'm not sure if any of the other commands are even working right:

localhost test # /usr/local/lib/flimflam/test/connect-service GoogleGuest     
[140337.238299] mwifiex_pcie 0000:01:00.0: info: trying to associate to 'GoogleGuest' bssid 9c:1c:12:xx:xx:xx
[140337.258424] mwifiex_pcie 0000:01:00.0: info: associated to bssid 9c:1c:12:xx:xx:xx successfully
Success: True
{'assoc_time': 0.53702998161315918,
 'config_time': 1.5322320461273193,
 'service': <Interface <ProxyObject wrapping <dbus._dbus.SystemBus (system) at 0xedd10570> :1.90 /service/31 at 0xedd17910> implementing 'org.chromium.flimflam.Service' at 0xedd179d0>,
 'state': 'online'}
localhost test # /usr/local/lib/flimflam/test/test-flimflam dev mlan0 networks
Device has no networks
localhost test # iw dev
phy#0
	Interface mlan0
		ifindex 4
		wdev 0x1
		addr 18:67:b0:xx:xx:xx
		ssid GoogleGuest
		type managed
		channel 157 (5785 MHz), width: 40 MHz, center1: 5795 MHz


=== Problem 3 ===

How can I connect to a network with a passphrase? This doesn't work:

# /usr/local/lib/flimflam/test/test-flimflam passphrase Ubiquitous thisismypassphrase
Traceback (most recent call last):
  File "/usr/local/lib/flimflam/test/test-flimflam", line 375, in <module>
    main()
  File "/usr/local/lib/flimflam/test/test-flimflam", line 176, in main
    service.SetProperty("Passphrase", passphrase)
  File "/usr/local/lib/python2.7/site-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/local/lib/python2.7/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/local/lib/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: Method "SetProperty" with signature "ss" on interface "org.chromium.flimflam.Service" doesn't exist


Maybe it's user error...


=== Problem 4 ===

Scripts like 'connect-service' use substring matching. So it's luck of the draw whether I'll connect to, for example, "GoogleGuest" or "GoogleGuest-Legacy".
 
I tackled problem 4 here:

https://chromium-review.googlesource.com/583781
=== Problem 5 ===

configure-service and set-service-property can handle string properties, but they do not handle the full range of data types.  In particular, the new StaticIPConfig dictionary property cannot be set (I wasn't even able to make this work by manually hacking the Python code).
Cc: benchan@chromium.org
On CL:583781, Ben said: "As we can obtain the DBus signature of a property, we could probably approximate that by taking a JSON-string from command line and convert that into an equivalent dbus type."

I have not had any luck setting StaticIPConfig as a dict from Python.

I tried this first:

    foo = dbus.Dictionary({'Address': dbus.String("1.2.3.4")})
    service.SetProperty("StaticIPConfig", foo)

This resulted in: "dbus.exceptions.DBusException: org.chromium.flimflam.Error.InvalidArguments: Property StaticIPConfig is not a string map."  I think this is because PropertyStore::SetAnyProperty recognizes that the argument can be interpreted as a Stringmap, so it doesn't even try to interpret it as a VariantDictionary.

Then I tried:

    foo = {'Address': "1.2.3.4", 'Prefixlen': 32}
    service.SetProperty("StaticIPConfig", foo)

but this failed with: "ERROR:dbus.connection:Unable to set arguments ('StaticIPConfig', {'Prefixlen': 32, 'Address': '1.2.3.4'}) according to signature None: <type 'exceptions.TypeError'>: an integer is required"

Same with this:

    foo = dbus.Dictionary({'Address': dbus.String("1.2.3.4"),
                           'Prefixlen': dbus.Int32(32)})

I think how shill_proxy.py:service_properties_to_dbus_types uses variant_level=1 may do the trick.
Project Member

Comment 6 by bugdroid1@chromium.org, Jul 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/69d2de6afc47c76b8cba7d609512d1136829ac51

commit 69d2de6afc47c76b8cba7d609512d1136829ac51
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 25 21:04:06 2017

shill: test-scripts: don't lookup Service names by substring

It's an extremely common pattern to have Wifi SSIDs in a given area
where one network is named $foo and another is named $foo-$bar (for some
values of $foo and $bar; e.g., bar == 5G). The test scripts currently
can't tell the difference between those when you try, e.g.,
"connect-service $foo". It might choose $foo or $foo-bar depending on
Python implementation details.

Let's disambiguate this for scripts that accept a Service arg by
stopping to use substrings.

BUG=chromium:735524
TEST=connect-service, disconnect-service, set-service-property for
     SSID $foo when $foo-bar exists in the same area

Change-Id: Ic424d43ea7e226536480194d981ad79599281b53
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/583781
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/69d2de6afc47c76b8cba7d609512d1136829ac51/test-scripts/disconnect-service
[modify] https://crrev.com/69d2de6afc47c76b8cba7d609512d1136829ac51/test-scripts/set-service-property
[modify] https://crrev.com/69d2de6afc47c76b8cba7d609512d1136829ac51/test-scripts/connect-service
[modify] https://crrev.com/69d2de6afc47c76b8cba7d609512d1136829ac51/test-scripts/flimflam.py

Project Member

Comment 7 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/71821bda595d5a106b5e0b59a9924b3ad8288ca7

commit 71821bda595d5a106b5e0b59a9924b3ad8288ca7
Author: Brian Norris <briannorris@chromium.org>
Date: Thu Aug 10 00:19:42 2017

shill: test-scripts: stop looking for 'Favorites'

These died with flimflam a long time ago, in a galaxy far away.

For printing services, it's probably useful to use the asterisk for
notating IsActive. Do that.

For removing services, I don't know what we want to do. But we surely
don't want the "Favorite" property, so kill it. (Note that "remove" is
still broken.)

BUG=chromium:735524
TEST=`./test-flimflam services` gives a reasonable dump

Change-Id: Ieb82028635d82572364dddeb4c56d61823c10cdc
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/583891
Reviewed-by: Ben Chan <benchan@chromium.org>

[modify] https://crrev.com/71821bda595d5a106b5e0b59a9924b3ad8288ca7/test-scripts/test-flimflam

drive-by:
I see changelists on this bug.  What's the reason it's left open and untriaged?
Status: Available (was: Untriaged)
Several of the original problems reported are not fixed, and no one has signed up to try to fix them. These are also only debug scripts, so their importance is basically determined only by whether the people who might use them care to fix them up.

I guess "Available" is accurate.
Project Member

Comment 10 by sheriffbot@chromium.org, Dec 13

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -cernekee@chromium.org
Labels: -Hotlist-Recharge-Cold
Status: Available (was: Untriaged)
Summary: Remove outdated flimflam test scripts (was: flimflam test scripts haven't aged well)
Labels: Enterprise-Triaged

Sign in to add a comment