Пример #1
0
 def __init__(self,path):
     self.path = path
     self.procrank = os.path.join(path,log.procrank())
     if not os.path.exists(self.procrank):
         return
     else:
         os.system("dos2unix %s" %self.procrank)
Пример #2
0
 def catMeminfo(self):
     while self.__flag:
         self.a.popen('procrank', stdout=open(os.path.join(self.report_dir, log.procrank()), 'a+'))
         self.a.popen('dumpsys meminfo', stdout=open(os.path.join(self.report_dir, log.dumpsys_meminfo()), 'a+'))
         self.a.popen('cat /proc/meminfo', stdout=open(os.path.join(self.report_dir, log.meminfo()), 'a+'))
         self.a.popen('busybox top -n 1', stdout=open(os.path.join(self.report_dir, log.top()), 'a+'))
         time.sleep(10)
Пример #3
0
 def catMeminfo(self):
     while self.__flag:
         self.a.popen('procrank', stdout=open(os.path.join(self.report_dir, log.procrank()), 'a+'))
         self.a.popen('dumpsys meminfo', stdout=open(os.path.join(self.report_dir, log.dumpsys_meminfo()), 'a+'))
         self.a.popen('cat /proc/meminfo', stdout=open(os.path.join(self.report_dir, log.meminfo()), 'a+'))
         self.a.popen('busybox top', stdout=open(os.path.join(self.report_dir, log.top()), 'a+'))
         time.sleep(10)
Пример #4
0
 def __init__(self,path):
     self.path = path
     self.procrank = os.path.join(path,log.procrank())
     if not os.path.exists(self.procrank):
         return
     else:
         os.system("dos2unix %s" %self.procrank)
Пример #5
0
    def catMeminfo(self):
        while self.__flag:
            self.a.popen('procrank',
                         stdout=open(
                             os.path.join(self.report_dir, log.procrank()),
                             'a+')).wait()

            self.a.popen('dumpsys meminfo',
                         stdout=open(
                             os.path.join(self.report_dir,
                                          log.dumpsys_meminfo()),
                             'a+')).wait()
            self.a.popen('cat /proc/meminfo',
                         stdout=open(
                             os.path.join(self.report_dir, log.meminfo()),
                             'a+')).wait()
            self.a.popen('busybox top -n 1',
                         stdout=open(os.path.join(self.report_dir, log.top()),
                                     'a+')).wait()
            time.sleep(log.CAPTURE_MEMINFO_SLEEP_GAP)
Пример #6
0
import log
from case import TestCase
from case import TestSuite
from connect import ADB, AdbException


def hook(c):
    def decorator(f):
        setattr(c, f.__name__, f)
        return f
    return decorator

LOGCAT_RUNTEST = [  ('logcat -c;logcat -v threadtime', log.logcat()),
                    ('cat /proc/kmsg', log.kernel()),
                    ('dumpsys meminfo', log.dumpsys_meminfo()),
                    ('procrank', log.procrank()),]

CAPTURE_MEMINFO_SLEEP_GAP = 10

class TextRunner(object):

    def __init__(self, a, option):
        self.a = a
        self.option = option
        self.test_number = 0
#         self.report_dir = os.path.join(option.reportdir, 'logs', 'report.%s'%time.strftime("%Y_%m_%d.%H_%M_%S",time.localtime(time.time())))
        self.report_dir = os.path.join(option.reportdir, 'logs', 'report')

        @hook(log)
        def report_directory():
            return report_dir
Пример #7
0
import log
from case import TestCase
from case import TestSuite
from connect import ADB, AdbException


def hook(c):
    def decorator(f):
        setattr(c, f.__name__, f)
        return f
    return decorator

LOGCAT_RUNTEST = [  ('logcat -c;logcat -v threadtime', log.logcat()),
                    ('cat /proc/kmsg', log.kernel()),
                    ('dumpsys meminfo', log.dumpsys_meminfo()),
                    ('procrank', log.procrank()),]

CAPTURE_MEMINFO_SLEEP_GAP = 10

class TextRunner(object):

    def __init__(self, a, option):
        self.a = a
        self.option = option
        self.test_number = 0
        self.report_dir = os.path.join(option.reportdir, 'logs', 'report.%s'%time.strftime("%Y_%m_%d.%H_%M_%S",time.localtime(time.time())))

        @hook(log)
        def report_directory():
            return report_dir
        try: