summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2010-08-18 17:56:06 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-08-18 19:08:54 +0200
commitb16225a6267520a19417059076fc3dff8e35a718 (patch)
tree6fbceb730e3fc1dceaaae7db5f4be1d8f289671f /test
parentce5e47bd96e821e44ba29c4e747cd5b923e0d426 (diff)
downloadconnman-b16225a6267520a19417059076fc3dff8e35a718.tar.gz
connman-b16225a6267520a19417059076fc3dff8e35a718.tar.bz2
connman-b16225a6267520a19417059076fc3dff8e35a718.zip
Add support for roaming/home network statistic
Currently connman only has one set of counters for collecting statistics on online time and the amount of transfered bytes. For 3G connections we should destinguish between home network and roaming. This patch introduces two sets of counter values for home network and roaming network. Changing from Home to Roaming counters relies on connman_network_set_roaming being called. Currently, this is only done in the ofono plugin. Getting Wifi 'Hot-Spot Provider' Roaming (e.g. T-Mobile Germany to T-Mobile USA) is not yet working.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-counter11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test-counter b/test/test-counter
index 8b3062ca..c05449a9 100755
--- a/test/test-counter
+++ b/test/test-counter
@@ -29,7 +29,7 @@ def print_stats(stats):
for key in keys:
val = int(stats[key])
- str = " %s = %s" % (key, val)
+ str = " %s = %s" % (key, val)
if key in ["RX.Bytes", "TX.Bytes"]:
hstr = make_bytes_readable(val)
@@ -49,8 +49,13 @@ class Counter(dbus.service.Object):
in_signature='oa{sv}a{sv}', out_signature='')
def Usage(self, path, home, roaming):
print "%s" % (path)
- print_stats(home)
- print_stats(roaming)
+
+ if len(home) > 0:
+ print " Home"
+ print_stats(home)
+ if len(roaming) > 0:
+ print " Roaming"
+ print_stats(roaming)
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)