コード例 #1
0
class compass_longlasting_streaming(UIATestBase):
    def setUp(self):
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.sensorImpl = SensorImpl()
        self.sensorCommon = SensorCommon()
        self.sensorCommon.keep_awake()
        super(compass_longlasting_streaming, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(compass_longlasting_streaming, self).tearDown()

    def test_compass_longlasting_streaming(self):
        fileName = os.path.split(os.path.realpath(__file__))[1]
        sensor_type = fileName.split('_')[0].strip()
        compass_type = "magnetic field"
        sensor_longlasting_mark = "longlasting"
        num = 0
        self.sensorImpl.logger.info("-------test %s jitter----------------" %
                                    sensor_type)
        self.sensorImpl.sensor_log(sensor_longlasting_mark, "Fastest",
                                   compass_type)

        for loop in range(100):
            self.sensorImpl.logger.info("")
            self.sensorImpl.logger.info("Loop %d/100 " % (loop + 1) + fileName)
            print "sensor log check"
            self.sensorImpl.longlasting_20min_get()
            if self.sensorImpl.long_lasting_check_log() is False:
                num += 1
        print num
        if num > 90:
            self.sensorImpl.long_lasting_check_log()
            assert self.sensorImpl.long_lasting_check_log()
コード例 #2
0
class jitter_rotation_vector_normal(UIATestBase):
    '''
    calculate the jitter of rotation vector sensor normal delay time
    '''
    def setUp(self):
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        configuration = "tests.tablet.sensor.conf"
        self.cfg_file = configuration
        self.sensorImpl = SensorImpl()
        super(jitter_rotation_vector_normal, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(jitter_rotation_vector_normal, self).tearDown()

    def test_jitter_rotation_vector_normal(self):

        fileName = os.path.split(os.path.realpath(__file__))[1]
        sensor_type = fileName.split('_')[1].strip() + " vector"

        self.sensorImpl.sensor_log(
            self.config.read(self.cfg_file, "artifactory"), "Normal",
            sensor_type)
        self.sensorImpl.check_log()
コード例 #3
0
class accelerometer_streaming(UIATestBase):

    def setUp(self):
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.sensortest_package = "android.intel.umg.sensor.test"
        self.sensor_package = "android.intel.umg.sensor"
        self.sensorImpl = SensorImpl()
        self.cfg_file = "tests.tablet.sensor.conf"
        self.sensorImpl.install_app(self.config.read(self.cfg_file, "artifactory"), "location_apks", "testprjsenortest", self.sensortest_package)
        self.sensorImpl.install_app(self.config.read(self.cfg_file, "artifactory"), "location_apks", "sensortest", self.sensor_package)
        super(accelerometer_streaming, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(accelerometer_streaming, self).tearDown()

    def test_accelerometer_streaming(self):
        fileName = os.path.split(os.path.realpath(__file__))[1]
        sensor_type = fileName.split('_')[0].strip()

        num = 0
        for loop in range(10):
            self.sensorImpl.logger.info("")
            self.sensorImpl.logger.info("Loop %d/10 test accelerometer delay" %(loop+1))
            if self.sensorImpl.excute(fileName, "delay", sensor_type, str(10), "fastest", str(0), "fastest") is False:
                num += 1
        if num > 5:
            assert False

        self.sensorImpl.logger.info("test accelerometer jitter--------^_^--------")
        self.sensorImpl.sensor_log(self.config.read(self.cfg_file, "artifactory"), "Fastest", sensor_type)
        self.sensorImpl.check_log()
コード例 #4
0
class jitter_linear_accelerometer_game(UIATestBase):
    '''
    calculate the jitter of linear accelerometer sensor game delay time
    '''
    def setUp(self):
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        configuration = "tests.tablet.sensor.conf"
        self.cfg_file = configuration
        self.sensorImpl = SensorImpl()
        super(jitter_linear_accelerometer_game, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(jitter_linear_accelerometer_game, self).tearDown()

    def test_jitter_linear_accelerometer_game(self):

        fileName = os.path.split(os.path.realpath(__file__))[1]
        sensor_type = fileName.split('_')[1].strip() + " acceleration"

        self.sensorImpl.sensor_log(
            self.config.read(self.cfg_file, "artifactory"), "Game",
            sensor_type)
        self.sensorImpl.check_log()
コード例 #5
0
class jitter_compass_sync(UIATestBase):
    def setUp(self):
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        configuration = "tests.tablet.sensor.conf"
        self.cfg_file = configuration
        self.sensorImpl = SensorImpl()
        super(jitter_compass_sync, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(jitter_compass_sync, self).tearDown()

    def test_jitter_compass_sync(self):

        fileName = os.path.split(os.path.realpath(__file__))[1]

        self.sensorImpl.sensor_log(
            self.config.read(self.cfg_file, "artifactory"), "Fastest",
            "magnetic field")
        self.sensorImpl.check_log_average()
コード例 #6
0
class jitter_linear_accelerometer_sync(UIATestBase):
    def setUp(self):
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        configuration = "tests.tablet.sensor.conf"
        self.cfg_file = configuration
        self.sensorImpl = SensorImpl()
        super(jitter_linear_accelerometer_sync, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(jitter_linear_accelerometer_sync, self).tearDown()

    def test_jitter_linear_accelerometer_sync(self):

        fileName = os.path.split(os.path.realpath(__file__))[1]
        sensor_type = fileName.split('_')[1].strip() + " acceleration"

        self.sensorImpl.sensor_log(
            self.config.read(self.cfg_file, "artifactory"), "Fastest",
            sensor_type)
        self.sensorImpl.check_log_average()
コード例 #7
0
class jitter_compass_fastest(UIATestBase):
    '''
    calculate the jitter of compass sensor fastest delay time
    '''

    def setUp(self):
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        configuration = "tests.tablet.sensor.conf"
        self.cfg_file = configuration
        self.sensorImpl = SensorImpl()
        super(jitter_compass_fastest, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(jitter_compass_fastest, self).tearDown()

    def test_jitter_compass_fastest(self):

        fileName = os.path.split(os.path.realpath(__file__))[1]

        self.sensorImpl.sensor_log(self.config.read(self.cfg_file, "artifactory"), "Fastest", "magnetic field", 198)
        self.sensorImpl.check_log(40)
コード例 #8
0
class fusion_sensor_longlasting_streaming(UIATestBase):
    def setUp(self):
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        self.sensorImpl = SensorImpl()
        self.sensorCommon = SensorCommon()
        self.sensorCommon.keep_awake()
        super(fusion_sensor_longlasting_streaming, self).setUp()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(fusion_sensor_longlasting_streaming, self).tearDown()

    def test_gravity_longlasting_streaming(self):
        fileName = "gravity_longlasting_streaming"
        sensor_type = fileName.split('_')[0].strip()
        sensor_longlasting_mark = "longlasting"
        num = 0
        self.sensorImpl.logger.info("-------test %s jitter----------------" %
                                    sensor_type)
        self.sensorImpl.sensor_log(sensor_longlasting_mark, "Fastest",
                                   sensor_type)

        for loop in range(100):
            self.sensorImpl.logger.info("")
            self.sensorImpl.logger.info("Loop %d/100 " % (loop + 1) + fileName)
            self.sensorImpl.longlasting_20min_get()
            if self.sensorImpl.long_lasting_check_log() is False:
                num += 1
        print num
        if num > 90:
            self.sensorImpl.long_lasting_check_log()
            assert self.sensorImpl.long_lasting_check_log()

    def test_orientation_longlasting_streaming(self):
        fileName = "orientation_longlasting_streaming"
        sensor_type = fileName.split('_')[0].strip()
        sensor_longlasting_mark = "longlasting"
        num = 0
        self.sensorImpl.logger.info("-------test %s jitter----------------" %
                                    sensor_type)
        self.sensorImpl.sensor_log(sensor_longlasting_mark, "Fastest",
                                   sensor_type)

        for loop in range(100):
            self.sensorImpl.logger.info("")
            self.sensorImpl.logger.info("Loop %d/100 " % (loop + 1) + fileName)
            self.sensorImpl.longlasting_20min_get()
            if self.sensorImpl.long_lasting_check_log() is False:
                num += 1
        print num
        if num > 90:
            self.sensorImpl.long_lasting_check_log()
            assert self.sensorImpl.long_lasting_check_log()

    def test_rotation_vector_longlasting_streaming(self):
        fileName = "rotation_vector_longlasting_streaming"
        sensor_type = fileName.split('_')[0].strip() + " " + fileName.split(
            '_')[1].strip()
        print sensor_type
        sensor_longlasting_mark = "longlasting"
        num = 0
        self.sensorImpl.logger.info("-------test %s jitter----------------" %
                                    sensor_type)
        self.sensorImpl.sensor_log(sensor_longlasting_mark, "Fastest",
                                   sensor_type)

        for loop in range(100):
            self.sensorImpl.logger.info("")
            self.sensorImpl.logger.info("Loop %d/100 " % (loop + 1) + fileName)
            self.sensorImpl.longlasting_20min_get()
            if self.sensorImpl.long_lasting_check_log() is False:
                num += 1
        print num
        if num > 90:
            self.sensorImpl.long_lasting_check_log()
            assert self.sensorImpl.long_lasting_check_log()

    def test_linear_accelerometer_longlasting_streaming(self):
        fileName = "linear_acceleration_longlasting_streaming"
        sensor_type = fileName.split('_')[0].strip() + " " + fileName.split(
            '_')[1].strip()
        sensor_longlasting_mark = "longlasting"
        num = 0
        self.sensorImpl.logger.info("-------test %s jitter----------------" %
                                    sensor_type)
        self.sensorImpl.sensor_log(sensor_longlasting_mark, "Fastest",
                                   sensor_type)

        for loop in range(100):
            self.sensorImpl.logger.info("")
            self.sensorImpl.logger.info("Loop %d/100 " % (loop + 1) + fileName)
            self.sensorImpl.longlasting_20min_get()
            if self.sensorImpl.long_lasting_check_log() is False:
                num += 1
        print num
        if num > 90:
            self.sensorImpl.long_lasting_check_log()
            assert self.sensorImpl.long_lasting_check_log()