← Back to team overview

ubuntu-apps-bugs team mailing list archive

[Bug 1287628] [NEW] invoke_incoming_call() doesn't seem to work, result is not checked, yet test_incoming test passes (?!)

 

Public bug reported:

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.

** Affects: dialer-app
     Importance: Undecided
     Assignee: Martin Pitt (pitti)
         Status: New

** Affects: dialer-app (Ubuntu)
     Importance: Undecided
     Assignee: Dimitri John Ledkov (xnox)
         Status: New

** Affects: ofono (Ubuntu)
     Importance: Undecided
     Assignee: Tony Espy (awe)
         Status: New

** Also affects: dialer-app
   Importance: Undecided
       Status: New

** Also affects: ofono (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: dialer-app (Ubuntu)
     Assignee: (unassigned) => Dimitri John Ledkov (xnox)

** Changed in: ofono (Ubuntu)
     Assignee: (unassigned) => Tony Espy (awe)

** Changed in: dialer-app
     Assignee: (unassigned) => Martin Pitt (pitti)

-- 
You received this bug notification because you are a member of Ubuntu
Apps bug tracking, which is subscribed to dialer-app in Ubuntu.
https://bugs.launchpad.net/bugs/1287628

Title:
  invoke_incoming_call() doesn't seem to work, result is not checked,
  yet test_incoming test passes (?!)

Status in Dialer app for Ubuntu Touch:
  New
Status in “dialer-app” package in Ubuntu:
  New
Status in “ofono” package in Ubuntu:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dialer-app/+bug/1287628/+subscriptions


Follow ups

References