コード例 #1
0
class InitOEMCustomize(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(InitOEMCustomize, self).setUp()
        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.wake_up()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(InitOEMCustomize, self).tearDown()
        self.wifi = None

    def testInitOEMCustomize(self):
        """
        Reboot DUT after Change OEM wallpaper to another
        """
        print "[RunTest] %s" % self.__str__()
        sn = g_common_obj2.getSerialNumber()
        oem = oem_init(sn)
        oem.run()
コード例 #2
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")
コード例 #3
0
 def setUp(self):
     super(InitOEMCustomize, self).setUp()
     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.wake_up()
コード例 #4
0
 def setUp(self):
     super(TestAppAfterFactoryReset, self).setUp()
     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()
コード例 #5
0
class TestOEM_device_model(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestOEM_device_model, self).setUp()
        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()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestOEM_device_model, self).tearDown()
        self.wifi = None

    def testOEM_device_model(self):
        """
        DEfault OEM device model
        """
        print "[RunTest] %s" % self.__str__()
        self.oem.check_oem_device_model()
コード例 #6
0
class EXTRA_APPS(UIATestBase):
    def setUp(self):
        super(EXTRA_APPS, self).setUp()
        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()

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

    def testEXTRA_APPS(self):
        """
        Check apks are visible in app menu after factory reset

        The test case spec is following:
        1. Connect the dvt to linux PC follow the precondition.
        2. copy apk to the IRDA device.
        3. On the IRDA device, perform a factory reset.

        The real implementation will be in OemImpl class.
        """
        print "[RunTest]: %s" % self.__str__()

        self.oem.check_apps()
コード例 #7
0
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")
コード例 #8
0
class TestSetRingtoneProperty(UIATestBase):
    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")

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestSetRingtoneProperty, self).tearDown()
        self.wifi = None
        g_common_obj.adb_cmd("mv /oem/oem.prop.bak  /oem/oem.prop")
        self.func.factory_reset()
        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 Testsetringtoneproperty(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.config.ringtone"
        print cmdstr
        cmd = os.popen(cmdstr).read()
        print cmd
        cmd_search = cmd.count('Kiss The Rain')
        assert cmd_search > 0, "[ERROR]"
        g_common_obj.adb_cmd_capture_msg("rm -rf /oem/oem.prop")
コード例 #9
0
class TestDefaultStaticWallpaper(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestDefaultStaticWallpaper, self).setUp()
        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()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestDefaultStaticWallpaper, self).tearDown()
        self.wifi = None

    def testDefault_static_wallpaper(self):
        """
        Default static Wallpaper
        """
        print "[RunTest] %s" % self.__str__()

        self.oem.launch_wallpaper()
        self.oem.change_wallpaper(5, "start.png")

        self.oem.write_oem()
        self.oem.set_default_wallpaper()
        self.oem.unwrite_oem()
        self.oem.reset_device()

        self.oem.take_picture("end.png")
        print "Compare the picture"
        base_path = self.oem.host_file_path + '/file/' + "start.png"
        new_path = self.oem.host_file_path + '/file/' + "end.png"
        print base_path
        from igascomparator import igascomparator
        comp = igascomparator()
        rate = comp.getsimilarityrate(new_path, base_path)
        print "Rate: %s" % rate
        print "Expect that pictures are not similar"
        assert (rate < 0.95)
        os.remove(base_path)
        os.remove(new_path)
コード例 #10
0
class TestSetOEMApp(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestSetOEMApp, self).setUp()
        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()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestSetOEMApp, self).tearDown()
        self.wifi = None

    def testSet_oem_apps(self):
        """
        Set multi-apps by OEM
        """
        print "[RunTest] %s" % self.__str__()

        self.oem.write_oem()
        self.oem.set_oem_app()
        self.oem.unwrite_oem()
        self.oem.reset_device()

        self.oem.check_set_apps()
コード例 #11
0
class TestAppAfterFactoryReset(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestAppAfterFactoryReset, self).setUp()
        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()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestAppAfterFactoryReset, self).tearDown()
        self.wifi = None

    def testApp_after_factory_reset(self):
        """
        Check OEM applications after factory recovery
        """
        print "[RunTest] %s" % self.__str__()

        self.oem.check_oem_apps()
        self.oem.reset_device()
        self.oem.check_oem_apps()
コード例 #12
0
class TestRemoveOEMApps(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestRemoveOEMApps, self).setUp()
        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()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        self.oem.switch_to_owner()
        super(TestRemoveOEMApps, self).tearDown()
        self.wifi = None

    def testRemove_oem_apps(self):
        """
        Remove OEM applications in multi-user mode
        """
        print "[RunTest] %s" % self.__str__()

        self.oem.switch_to_user()
        self.oem.delete_oem_apps()
        self.oem.switch_to_owner()
        self.oem.delete_oem_apps()