예제 #1
0
 def setUp(self):
     super(TestSetRingtoneProperty, self).setUp()
     self.func = OEMFunc(g_common_obj2.getSerialNumber())
     cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''),
                             'tests.tablet.oem.conf')
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self.oem = OEMImpl(self.config.read(cfg_file, 'default'))
     self.oem.setup_connection()
     self.oem.set_orientation_n()
     self.oem.wake_up()
     u = self.config.read('/etc/oat/sys.conf',
                          'artifactory').get('location')
     print u
     f = u + 'IRDA_OEM_Customization/ringtone_property/'
     print f
     mp3_path = u + 'IRDA_OEM_Customization/ringtone/'
     self.filePath = Artifactory(f).get('oem.prop')
     self.filePath_mp3 = Artifactory(mp3_path).get('Kiss The Rain.mp3')
     self.func.mount_device()
     g_common_obj.adb_cmd("mv /oem/oem.prop  /oem/oem.prop.bak")
     g_common_obj.adb_cmd("ls /oem")
     g_common_obj.push_file(self.filePath, "/oem/")
     g_common_obj.push_file(self.filePath_mp3, "/oem/media/")
     g_common_obj.adb_cmd("chmod 644 /oem/oem.prop")
class TestOEMDefaltLocale_M(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestOEMDefaltLocale_M, self).setUp()
        self.func = OEMFunc(g_common_obj2.getSerialNumber())
        cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''),
                                'tests.tablet.oem.conf')
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.oem = OEMImpl(self.config.read(cfg_file, 'default'))
        self.oem.setup_connection()
        self.oem.set_orientation_n()
        self.oem.wake_up()
        u = self.config.read('/etc/oat/sys.conf',
                             'artifactory').get('location')
        print u
        f = u + 'IRDA_OEM_Customization/oem_local_m/'
        print f
        self.filePath = Artifactory(f).get('oem.prop')
        self.func.mount_device()
        g_common_obj.adb_cmd("mv /oem/oem.prop  /oem/oem.prop.bak")
        g_common_obj.adb_cmd("ls /oem")
        g_common_obj.push_file(self.filePath, "/oem/")
        g_common_obj.adb_cmd("chmod 644 /oem/oem.prop")

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestOEMDefaltLocale_M, self).tearDown()
        self.wifi = None
        g_common_obj.adb_cmd("mv /oem/oem.prop.bak  /oem/oem.prop")
        self.func.factory_reset_local()
        self.func.check_reset()
        self.func.wait_for_android_os()
        g_common_obj.root_on_device()
        self.func.setup_connection()
        self.func.skip_initial_screen_after_factory_reset()

    def TestOEMDefalt_Locale_M(self):
        self.func.setup_connection()
        self.func.unlock_screen()
        self.func.factory_reset()
        self.func.check_reset()
        self.func.wait_for_android_os()
        g_common_obj.root_on_device()
        self.func.mount_device()
        self.func.setup_connection()
        self.oem.local_chinese()
        g_common_obj.adb_cmd_capture_msg("rm -rf /oem/oem.prop")
예제 #3
0
class TestSetRegionProperty(UIATestBase):
    def setUp(self):
        super(TestSetRegionProperty, self).setUp()
        self.func = OEMFunc(g_common_obj2.getSerialNumber())
        cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''),
                                'tests.tablet.oem.conf')
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.oem = OEMImpl(self.config.read(cfg_file, 'default'))
        self.oem.setup_connection()
        self.oem.set_orientation_n()
        self.oem.wake_up()
        u = self.config.read('/etc/oat/sys.conf',
                             'artifactory').get('location')
        print u
        f = u + 'IRDA_OEM_Customization/region_property/'
        print f
        self.filePath = Artifactory(f).get('oem.prop')
        self.func.mount_device()
        g_common_obj.adb_cmd("mv /oem/oem.prop  /oem/oem.prop.bak")
        time.sleep(1)
        g_common_obj.adb_cmd("ls /oem")
        g_common_obj.push_file(self.filePath, "/oem/")
        g_common_obj.adb_cmd("chmod 644 /oem/oem.prop")

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestSetRegionProperty, self).tearDown()
        self.wifi = None
        g_common_obj.adb_cmd("mv /oem/oem.prop.bak  /oem/oem.prop")
        self.func.factory_reset_local()
        self.func.check_reset()
        self.func.wait_for_android_os()
        g_common_obj.root_on_device()
        self.func.setup_connection()
        self.func.skip_initial_screen_after_factory_reset()

    def Testsetregionproperty(self):
        self.func.setup_connection()
        self.func.unlock_screen()
        self.func.factory_reset()
        self.func.check_reset()
        self.func.wait_for_android_os()
        g_common_obj.root_on_device()
        self.func.mount_device()
        cmdstr = "adb shell getprop | grep ro.product.locale.region"
        print cmdstr
        cmd = os.popen(cmdstr).read()
        print cmd
        cmd_search = cmd.count('CN')
        assert cmd_search > 0, "[ERROR]"
        g_common_obj.adb_cmd_capture_msg("rm -rf /oem/oem.prop")