示例#1
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call UseCase base Init function
        LabPwrMeasBase.__init__(self, tc_name, global_config)

        # Get TC Parameters
        self._video_save_path = self._tc_parameters.get_param_value(
            "VIDEO_PATH")
        self._camera_name = self._tc_parameters.get_param_value("CAMERA_NAME")
        self._camera = self._tc_parameters.get_param_value("CAMERA")
        self._quality = self._tc_parameters.get_param_value("QUALITY")
        self._flash_mode = self._tc_parameters.get_param_value("FLASH_MODE")
        self._color_effect = self._tc_parameters.get_param_value(
            "COLOR_EFFECT")
        self._white_balance = self._tc_parameters.get_param_value(
            "WHITE_BALANCE")
        self._dvs = self._tc_parameters.get_param_value("DVS")
        self._noise_reduction = self._tc_parameters.get_param_value(
            "NOISE_REDUCTION")

        self._video_filename = None

        # Get UECmdLayer
        self._video_record_api = self._device.get_uecmd("VideoRecorder")
        self._phonesystem_api = self._device.get_uecmd("PhoneSystem")
    def tear_down(self):
        """
        Tear down
        """
        LabPwrMeasBase.tear_down(self)

        self.__application.uninstall()

        return Global.SUCCESS, "No errors"
示例#3
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        # Call power measurement base Init function
        LabPwrMeasBase.__init__(self, tc_name, global_config)

        # Read sleep mode of the board and brightness for s0 mode
        self._sleep_mode = self._tc_parameters.get_param_value("MODE")
        flight_mode = self._tc_parameters.get_param_value(
            "FLIGHT_MODE", True, "str_to_bool")
        if not flight_mode:
            self._technology_power.append("cellular")
    def set_up(self):
        """
        Initialize the test
        """
        LabPwrMeasBase.set_up(self)

        self._phonesystem_api.display_on()
        time.sleep(self._wait_btwn_cmd)

        self._system_api.adjust_specified_stream_volume("Media", self._volume)
        self.__display.set_display_orientation("landscape")
        self._video_api.play_native(self._multimedia_path + self._video_file)

        return Global.SUCCESS, "No errors"
    def tear_down(self):
        """
        End and dispose the test
        """

        self._video_api.close_native()
        self.__display.set_display_orientation("auto")

        # Call tear_down of LabPwrMeasBase
        LabPwrMeasBase.tear_down(self)

        # Release the phone display
        self._phonesystem_api.display_off()

        return Global.SUCCESS, "No errors"
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        LabPwrMeasBase.__init__(self, tc_name, global_config)

        # Get path to multimedia files
        self._multimedia_path = self._device.multimedia_path

        # Get TC Parameters
        self._video_file = self._tc_parameters.get_param_value("VIDEO_FILE")
        self._volume = int(self._tc_parameters.get_param_value("VOLUME"))

        self.__display = self._device.get_uecmd("Display")
示例#7
0
    def tear_down(self):
        """
        End and dispose the test
        """
        # Call Lab PwrMeas base tear down function
        LabPwrMeasBase.tear_down(self)

        #Stop video record as prevention mechanism
        self._logger.debug(
            "Stop video record (prevention mechanism in teardown)")
        self._video_record_api.stop_video_record(self._video_save_path,
                                                 self._video_filename)

        # Release the phone display
        self._phonesystem_api.display_off()

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Set up the test configuration
        """
        # Call power measurement base setup function
        LabPwrMeasBase.set_up(self)

        # Wakes up the phone
        self._phonesystem_api.display_on()
        application_name = self._tc_parameters.get_param_value(
            "APPLICATION_NAME")
        # appuri contains the app name to retrieve in pnp module config
        app_key = self._tc_parameters.get_param_value("APP_NAME")
        main_app_full_name = self.__retrieve_value_from_module_config(app_key)
        if not main_app_full_name:
            # specified key is not in config, it could be a real app name
            main_app_full_name = app_key
        # additional contains additional app name to install to retrieve in pnp module config
        additionnals = self._tc_parameters.get_param_value("ADDITIONALS")
        additional_app_full_name = self.__retrieve_value_from_module_config(
            additionnals)
        if not additional_app_full_name:
            # specified key is not in config, it could be a real app name
            additional_app_full_name = additionnals

        arguments = self._tc_parameters.get_param_value("ARGUMENTS")
        arguments_full_name = self.__retrieve_value_from_module_config(
            arguments)
        if not arguments_full_name:
            arguments_full_name = arguments
        self.__loop_mode = self._tc_parameters.get_param_value("LOOP_MODE")
        url = self._tc_parameters.get_param_value("URL")
        self.__application = self._device.get_application_instance(
            application_name)

        self.__application.pre_install(self._execution_config_path,
                                       self.global_config, self._dut_config)
        self.__application.install(main_app_full_name,
                                   additional_app_full_name,
                                   arguments_full_name, url)
        self.__application.post_install()

        return Global.SUCCESS, "No errors"
示例#9
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        LabPwrMeasBase.__init__(self, tc_name, global_config)

        # Set "wifi" power to on in the technology_power
        # dictionnary (attribute of the power measurement base usecase)
        self._technology_power.append("wifi")

        self._sleep_mode = "s3"

        # Get WIFI Router configuration according
        # WIFI SECURITY ("OPEN", "WEP" or WPA)
        self._security = str(
            self._tc_parameters.get_param_value("WIFI_SECURITY")).upper()

        if self._security == "WEP":
            self._logger.debug(
                "WEP Wifi Security selected, getting parameters")
            # Get WEP WIFI Router configuration
            self._wifirouter = global_config.benchConfig.\
                get_parameters("WEP_WIFI_ROUTER")
            self._ssid = self._wifirouter.get_param_value("SSID")
            self._passphrase = self._wifirouter.get_param_value("passphrase")

        if self._security == "WPA":
            self._logger.debug(
                "WPA Wifi Security selected, getting parameters")
            # Get WPA WIFI Router configuration
            self._wifirouter = global_config.benchConfig.\
                get_parameters("WPA_WIFI_ROUTER")
            self._ssid = self._wifirouter.get_param_value("SSID")
            self._passphrase = self._wifirouter.get_param_value("passphrase")

        if self._security in ("NONE", "OPEN"):
            self._logger.debug("\"OPEN\" Wifi Security type" +
                               " selected, getting parameters")
            self._wifirouter = \
                global_config.benchConfig.\
                get_parameters("NO_SECURITY_WIFI_ROUTER")
            self._ssid = self._wifirouter.get_param_value("SSID")
示例#10
0
    def set_up(self):
        """
        Initialize the test
        """
        # Call LabPwrMeasBase base Setup function
        LabPwrMeasBase.set_up(self)

        # Lock the phone display to ON
        self._phonesystem_api.display_on()

        # Kill camera package to make next upload video profile can work
        self._video_record_api.kill_camera(self._camera_name)
        time.sleep(self._wait_btwn_cmd)

        # Starting the video recording
        self._video_filename = self._video_record_api.native_video_record(
            self._video_save_path, self._camera_name, self._camera,
            self._quality, self._flash_mode, self._color_effect,
            self._white_balance, self._dvs, self._noise_reduction)

        return Global.SUCCESS, "No errors"
示例#11
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        LabPwrMeasBase.__init__(self, tc_name, global_config)

        # Get TC Parameters
        audio_file = self._tc_parameters.get_param_value("AUDIO_FILE")
        self._music_player = self._tc_parameters.get_param_value(
            "MUSIC_PLAYER")

        if audio_file is not None:
            self._audio_file = self._device.multimedia_path + audio_file
        else:
            raise AcsConfigException(
                AcsConfigException.INVALID_PARAMETER,
                "Audio file is not set in test case parameter")

        self._volume = int(self._tc_parameters.get_param_value("VOLUME"))

        self._sleep_mode = "lpmp3"
 def __init__(self, tc_name, global_config):
     """
     Constructor
     """
     # Call power measurement base Init function
     LabPwrMeasBase.__init__(self, tc_name, global_config)