* [PATCH] test: add change-pin test case
@ 2011-01-11 12:17 Jussi.Kangas
2011-01-11 18:23 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Jussi.Kangas @ 2011-01-11 12:17 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]
---
Makefile.am | 3 ++-
test/change-pin | 29 +++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletions(-)
create mode 100755 test/change-pin
diff --git a/Makefile.am b/Makefile.am
index cc30624..4c9add4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -446,7 +446,8 @@ test_scripts = test/backtrace \
test/set-tty \
test/set-gsm-band \
test/set-umts-band \
- test/lockdown-modem
+ test/lockdown-modem \
+ test/change-pin
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/change-pin b/test/change-pin new file mode 100755 index 0000000..a2444d6
--- /dev/null
+++ b/test/change-pin
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 5:
+ path = sys.argv[1]
+ pin_type = sys.argv[2]
+ orig_pin = sys.argv[3]
+ new_pin = sys.argv[4]
+elif len(sys.argv) == 4:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+ pin_type = sys.argv[1]
+ orig_pin = sys.argv[2]
+ new_pin = sys.argv[3]
+else:
+ print "%s [PATH] pin_type pin" % (sys.argv[0])
+ sys.exit(0)
+
+print "Change Pin for modem %s..." % path simmanager =
+dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.SimManager')
+
+simmanager.ChangePin(pin_type, orig_pin, new_pin)
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] test: add change-pin test case
2011-01-11 12:17 [PATCH] test: add change-pin test case Jussi.Kangas
@ 2011-01-11 18:23 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2011-01-11 18:23 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]
Hi Jussi,
> Makefile.am | 3 ++-
> test/change-pin | 29 +++++++++++++++++++++++++++++
> 2 files changed, 31 insertions(+), 1 deletions(-)
> create mode 100755 test/change-pin
>
> diff --git a/Makefile.am b/Makefile.am
> index cc30624..4c9add4 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -446,7 +446,8 @@ test_scripts = test/backtrace \
> test/set-tty \
> test/set-gsm-band \
> test/set-umts-band \
> - test/lockdown-modem
> + test/lockdown-modem \
> + test/change-pin
>
> if TEST
> testdir = $(pkglibdir)/test
> diff --git a/test/change-pin b/test/change-pin new file mode 100755 index 0000000..a2444d6
> --- /dev/null
> +++ b/test/change-pin
> @@ -0,0 +1,29 @@
> +#!/usr/bin/python
> +
> +import dbus
> +import sys
> +
> +bus = dbus.SystemBus()
> +
> +if len(sys.argv) == 5:
> + path = sys.argv[1]
> + pin_type = sys.argv[2]
> + orig_pin = sys.argv[3]
> + new_pin = sys.argv[4]
I know that we are not really strict with any coding style in the test
scripts, but at least try to follow the using tabs rule ;)
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-11 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-11 12:17 [PATCH] test: add change-pin test case Jussi.Kangas
2011-01-11 18:23 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.