class Check_Multi_Kmod_N(UIATestBase):
    """
    check haclctl -l
    """

    def setUp(self):
        super(Check_Multi_Kmod_N, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.hal = AutodetectImpl()
    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(Check_Multi_Kmod_N, self).tearDown()
        self.hal=None
    def testCheck_Multi_Kmod_N(self):
        """
        This test case is to check : adb shell haclctl -l

        Test Case Precondition:
        None

        Test Case Step:
        1. Type adb shell halctl -l | grep kmod
        2. Type kmod -n kmod_model

        Expect Result:
        1    Get kmod information.
        2    It will display very verbose information about coretemp module

        """

        print "[RunTest]: %s" % self.__str__()
        self.hal.wake_up()
        self.hal.add_one_multi_user()
        res = g_common_obj2.root_on_device()
        print res
        cmdstr="adb shell halctl -l | grep kmod"
        halctl_cmd=os.popen(cmdstr).read().strip()
        print halctl_cmd
        kmod_model=halctl_cmd.replace('\r\n\t', ' ').split()[0].split(':')[1]
        cmdstr="adb shell kmod -n %s"%kmod_model
        halctl_cmd=os.popen(cmdstr).read()
        print halctl_cmd
        search_result=halctl_cmd.count('alias')
        assert search_result>0,"[Error]:kmod -n  coretemp  is fail"
        print "[INFO]: kmod -n  coretemp  is success"
        self.hal.switch_to_owner()
class Check_Halctl_list_SafeMode(UIATestBase):
    """
    check haclctl -l
    """
    def setUp(self):
        super(Check_Halctl_list_SafeMode, self).setUp()
        cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \
            'tests.tablet.system_domains.conf')
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.hal = AutodetectImpl()
        self.cfg = self.config.read(cfg_file, 'system_domain')

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(Check_Halctl_list_SafeMode, self).tearDown()
        self.cfg = None
        self.hal = None

    def testCheck_Halctl_list_SafeMode(self):
        """
                Test Case Step:
1    Boot  in safemode.
2    Have adb root session
3    Type halctl -l
4    Type halctl -li type=gralloc


        Expect Result:
1    Device boots successfully
2    successfully
3    Show binding list correctly
4    Gralloc entry is listed. Mount source is llvmpipe.

        """

        print "[RunTest]: %s" % self.__str__()
        self.hal.wake_up()
        self.hal.boot_safemode()
        time.sleep(10)
        res = g_common_obj2.root_on_device()
        print res
        result = self.hal.halctl_cmd("-l", para1=None).count("modalias")
        assert result > 10, "[ERROR]: halctl -list is fail"
        print "[INFO]: halctl -list is success"
        g_common_obj2.system_reboot(200)
Exemple #3
0
class Check_Multi_Halctl_list(UIATestBase):
    """
    check haclctl -l
    """
    def setUp(self):
        super(Check_Multi_Halctl_list, self).setUp()
        cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \
            'tests.tablet.system_domains.conf')
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.hal = AutodetectImpl(self.config.read(cfg_file, 'system_domain'))

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(Check_Multi_Halctl_list, self).tearDown()
        self.cfg = None
        self.hal = None

    def testCheck_Multi_Halctl_list(self):
        """
        This test case is to check : adb shell haclctl -l

        Test Case Precondition:
        None

        Test Case Step:
        1. Run "adb shell haclctl -l"

        Expect Result:
        1. It shows more than 100 modalias

        """

        print "[RunTest]: %s" % self.__str__()
        self.hal.wake_up()
        self.hal.add_one_multi_user()
        res = g_common_obj2.root_on_device()
        print res
        result = self.hal.halctl_cmd("-l", para1=None).count("modalias")
        assert result > 10, "[ERROR]: halctl -list is fail"
        print "[INFO]: halctl -list is success"
        self.hal.switch_to_owner()