invoke_incoming_call() produces an unhandled exception apport report

Bug #1287628 reported by Dimitri John Ledkov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dialer-app
Fix Released
Undecided
Dimitri John Ledkov
dialer-app (Ubuntu)
Fix Released
Undecided
Dimitri John Ledkov
ofono (Ubuntu)
Invalid
Undecided
Tony Espy

Bug Description

Looking at the autopilot tests:
def invoke_incoming_call():
    """Invoke an incoming call for test purpose."""
    # magic number 199 will cause a callback from 1234567; dialing 199
    # itself will fail, so quiesce the error
    subprocess.call(['/usr/share/ofono/scripts/dial-number', '199'],
                    stdout=subprocess.PIPE, stderr=subprocess.PIPE)

That does not check that dial-number succeeded and did not generate tracebacks.

Later, it is expected than incomming call is comming...

    def test_incoming(self):
        """Incoming call"""
        number = "1234567"
        helpers.invoke_incoming_call()

        # wait for incoming call, accept; it would be nicer to fake-click the
        # popup notification, but as this isn't generated by dialer-app it
        # isn't exposed to autopilot
        helpers.wait_for_incoming_call()
        time.sleep(1) # let's hear the ringing sound for a second :-)
        subprocess.check_call(
            [
                "dbus-send", "--session", "--print-reply",
                "--dest=com.canonical.Approver", "/com/canonical/Approver",
                "com.canonical.TelephonyServiceApprover.AcceptCall"
            ], stdout=subprocess.PIPE)

        # call back is from that number
        self.assertThat(
            self.main_view.live_call_page.title, Eventually(Equals(number)))

        # stop watch should start counting
        elapsed_time = self.main_view.live_call_page.get_elapsed_call_time()
        self.assertIn("00:0", elapsed_time)

        try:
            self.main_view.live_call_page.click_hangup_button()
        except MismatchError as e:
            print('Expected failure due to known Mir crash '
                  '(https://launchpad.net/bugs/1240400): %s' % e)

This indicates there is a problem with a test (setup is not verified that incoming call is actually there), and I'm not sure how the test manages to pass.... by virtue of catching the MismatchError?

I'll be investigating further, to see if dial-number is getting invoked correctly or not, and why it times out.

Related branches

Changed in dialer-app (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
Changed in ofono (Ubuntu):
assignee: nobody → Tony Espy (awe)
Changed in dialer-app:
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Right, so dial-number fails in both python2 and python3 editions, the later one is the only one that generates a whoopsie crash file.

bug 1287659

I'm thinking, instead of doing external call to dial-number, why can't the AP tests themself do dbus call to ofono to invoke the callback? Afterall dial-number script is not doing anything else...

Changed in ofono (Ubuntu):
status: New → Invalid
Oliver Grawert (ogra)
Changed in dialer-app (Ubuntu):
status: New → Confirmed
Changed in dialer-app:
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Proposed replacing sub-process call to dial-number, with a direct dbus call.

Changed in dialer-app:
assignee: Martin Pitt (pitti) → Dimitri John Ledkov (xnox)
Revision history for this message
Martin Pitt (pitti) wrote :

> Right, so dial-number fails in both python2 and python3 editions

Indeed I get this with current ofono:

$ sudo ./dial-number 199
Using modem /phonesim
Traceback (most recent call last):
  File "./dial-number", line 40, in <module>
    path = vcm.Dial(number, hide_callerid)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "Dial" with signature "ss" on interface "org.ofono.VoiceCallManager" doesn't exist

Is that the same as what you saw?

I also noticed that the current ofono-scripts doesn't pull in python3-dbus, but Dimitri already fixed that in bzr.

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, apparently the UnknownMethod is because ofono-phonesim-autostart didn't actually set up the enulated modem any more:

$ sudo /usr/share/ofono/scripts/list-modems
[ /phonesim ]
    Type = hardware
    Online = 0
    Powered = 0
    Features =
    Lockdown = 0
    Emergency = 0
    Interfaces =

That was from testing in a container.

I tried "/usr/share/ofono/scripts/dial-number 1234" on today's phone build (with a real SIM card) and that works (and so does hangup-call etc.). When I install ofono-phonesim-autostart on the phone, list-modems, dial-numer 122 also works and actually dials the number. Please note that when you call "199" that will cause an "operation failed" exception, as this will cause the simulator to reject the outgoing call and synthesize an incoming call instead.

So I'm afraid I need some more information what fails for you with dial-number?

Revision history for this message
Martin Pitt (pitti) wrote :

FTR, dial-number/hangup-all/etc. also work fine for me in a container, I just need to run ./enable-modem and ./online-modem first.

Revision history for this message
Martin Pitt (pitti) wrote :

See my followup in the MP.

summary: - invoke_incoming_call() doesn't seem to work, result is not checked, yet
- test_incoming test passes (?!)
+ invoke_incoming_call() produces an unhandled exception apport report
Changed in dialer-app:
status: Confirmed → Triaged
Changed in dialer-app (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dialer-app - 0.1+14.04.20140410-0ubuntu1

---------------
dialer-app (0.1+14.04.20140410-0ubuntu1) trusty; urgency=low

  [ Dimitri John Ledkov ]
  * Invoke magic 199 callback via dbus, instead of scripts to reliably
    quiesce the error. (LP: #1287628) (LP: #1287628)
 -- Ubuntu daily release <email address hidden> Thu, 10 Apr 2014 19:43:15 +0000

Changed in dialer-app (Ubuntu):
status: Triaged → Fix Released
Changed in dialer-app:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.