def run_test(self):
        """
        Execute the test
        """
        LiveNfcBase.run_test(self)
        # enable Beam NFC
        self._nfc_api.enable_nfc_beam()
        time.sleep(self._wait_btwn_cmd)

        # Compare beam status to the one desired
        is_beam_on = self._nfc_api.get_nfc_beam_status()
        if not is_beam_on:
            msg = "Unable to turn beam on"
            self._logger.error(msg)
            raise DeviceException(DeviceException.OPERATION_FAILED, msg)

        # disable Beam NFC
        self._nfc_api.disable_nfc_beam()
        time.sleep(self._wait_btwn_cmd)

        # Compare beam status to the one desired
        is_beam_on = self._nfc_api.get_nfc_beam_status()
        if is_beam_on:
            msg = "Unable to turn beam off"
            self._logger.error(msg)
            raise DeviceException(DeviceException.OPERATION_FAILED, msg)

        return Global.SUCCESS, "No errors"
Example #2
0
    def run_test(self):
        """
        Execute the test
        """
        LiveNfcBase.run_test(self)

        self._nfc_api.exchange_apdu_using_scapi(self._channel, self._reader, self._apdu_case, self._data_length, self._loop)

        return Global.SUCCESS, "No errors"
Example #3
0
    def run_test(self):
        """
        Execute the test
        """
        # Call LiveNfcBase base run_test function
        LiveNfcBase.run_test(self)

        # Check every EUCmd
        for fct2test in self.__fcts2test + self.__robot_fcts2test + self.__secure_element_fcts2test:
            self._check_uecmd(fct2test)
            time.sleep(self._wait_btwn_cmd)

        # Raise an Exception in case of all tests do not pass
        self._compute_general_verdict()

        return Global.SUCCESS, "All UECmds OK"
Example #4
0
    def run_test(self):
        """
        Execute the test
        """
        LiveNfcBase.run_test(self)

        msg = "reading NFC tag successfully done : %s" % self.__uri
        verdict = Global.SUCCESS

        # Check for resolver activity
        if self._system_api.check_Activity("ResolverActivity"):
            count = 0
            while self._system_api.check_Activity(
                    "ResolverActivity") and count < 2:
                self._key_event_api.enter()
                time.sleep(self._wait_btwn_cmd)
                count += 1

            if not self._system_api.check_Activity("ResolverActivity"):

                # Start to search the nfc tag discovering in the logcat log
                ndef_discovered = self._device_logger.get_message_triggered_status(
                    "android.nfc.action.NDEF_DISCOVERED")
                uri_check = self._device_logger.get_message_triggered_status(
                    self.__uri)

                self._key_event_api.home()

                if not ndef_discovered:
                    msg = "NDEF discovering failure"
                    verdict = Global.FAILURE

                if ndef_discovered and not uri_check:
                    msg = "Bad NFC tag discovered expected : %s" % self.__uri
                    verdict = Global.FAILURE

            else:
                msg = "Can't go over the 'choose application' pop-up"
                verdict = Global.FAILURE

        else:
            msg = "No tag discovered"
            verdict = Global.FAILURE

        return verdict, msg
    def run_test(self):
        """
        Execute the test
        """
        LiveNfcBase.run_test(self)
        # enable NFC
        self._nfc_api.nfc_enable()
        time.sleep(self._wait_btwn_cmd)

        # If Beam to be checked
        if self._beam_used and self._beam_checked:
            is_beam_on = self._nfc_api.get_nfc_beam_status()

            # Compare beam status to the one set at the begining
            if is_beam_on != self._beam_wished_value:
                msg = "Unexpected result! Read beam value is %s instead of %s" % (
                    str(is_beam_on), str(self._beam_wished_value))
                self._logger.error(msg)
                raise DeviceException(DeviceException.OPERATION_FAILED, msg)

        # disable NFC
        self._nfc_api.nfc_disable()
        time.sleep(self._wait_btwn_cmd)

        # If Beam to be checked
        if self._beam_used and self._beam_checked:
            is_beam_on = self._nfc_api.get_nfc_beam_status()

            # Compare beam status to the one set at the begining
            if is_beam_on != self._beam_wished_value:
                msg = "Unexpected result! Read beam value is %s instead of %s" % (
                    str(is_beam_on), str(self._beam_wished_value))
                self._logger.error(msg)
                raise DeviceException(DeviceException.OPERATION_FAILED, msg)

        return Global.SUCCESS, "No errors"