コード例 #1
0
 def doScript(self, script, logger):
     mgr = manager(level=manager.LOG_ERROR, log_file=logger)
     return mgr.runWithOptions(
         self.minfo.serverinfo,
         "",
         [script,],
         {
             "$userid1:"   : self.user,
             "$pswd1:"     : self.pswd,
             "$principal1:": "/principals/users/%s/" % (self.user,)
         }
     )
コード例 #2
0
 def runner(*args):
     """
     Test runner method. 
     @param *args:
     """
     
     if pinfo.logging:
         print "Start: %s" % (args[0]["moresubs"]["$userid1:"],)
     try:
         mgr = manager(level=manager.LOG_NONE)
         _ignore_result, _ignore_timing = mgr.runWithOptions(*args[1:], **args[0])
         if pinfo.logging:
             print "Done: %s" % (args[0]["moresubs"]["$userid1:"],)
     except Exception, e:
         print "Thread run exception: %s" % (str(e),)
コード例 #3
0
def getFSUsage(count, testscript, runs, pid, sname):
    tmpfile = "temp.fsusage.%02d" % (count,)
    fd = open(tmpfile, "w")
    cid = subprocess.Popen(["fs_usage", "-f", "filesys", "%s" %(pid,),], stdout=fd, stderr=fd).pid
    
    time.sleep(5)
    
    pname = None
    fnames = [testscript]

    mgr = manager(level=manager.LOG_NONE)
    _ignore_result, _ignore_timing = mgr.runWithOptions(sname, pname, fnames, {})

    os.kill(cid, signal.SIGTERM)

    fd = open(tmpfile, "r")
    ctr = 0
    for _ignore_line in fd:
        ctr += 1

    return ctr / runs
コード例 #4
0
 def runner(*args):
     """
     Test runner method. 
     @param *args:
     """
     
     while(True):
         if self.logging:
             print "Start: %s" % (args[0]["moresubs"]["$userid1:"],)
         try:
             mgr = manager(level=manager.LOG_NONE)
             result, timing = mgr.runWithOptions(*args[1:], **args[0])
             if result > 0:
                 failed[0] = True
             results.append((time.time(), timing))
             if divmod(len(results), 10)[1] == 0:
                 print len(results)
             if self.logging:
                 print "Done: %s %.3f" % (args[0]["moresubs"]["$userid1:"], timing,)
         except Exception, e:
             print "Thread run exception: %s" % (str(e),)
         if time.time() > endtime:
             break
コード例 #5
0
 def setUpClass(cls):
     cls.filename = 'weg_2015_1T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract',
                                         '--psm 10 --oem 2')
コード例 #6
0
 def setUpClass(cls):
     cls.filename = 'gerdau_2017_1T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract', '--psm 5')
コード例 #7
0
 def setUpClass(cls):
     cls.filename = 'engie_2020_2T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract')
コード例 #8
0
 def setUpClass(cls):
     cls.filename = 'engie_2019_2T.pdf'
     cls.manager_pypdf2 = m.manager([cls.filename], 'pypdf2')
コード例 #9
0
 def setUpClass(cls):
     cls.filename = 'weg_2019_2T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract', '--psm 6')
コード例 #10
0
 def setUpClass(cls):
     cls.filename = 'fleury_2019_3T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract')
コード例 #11
0
 def setUpClass(cls):
     cls.filename = 'ambev_2019_1T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract')
コード例 #12
0
 def setUpClass(cls):
     cls.filename = 'gerdau_2017_1T.pdf'
     cls.manager_pypdf2 = m.manager([cls.filename], 'pypdf2')
コード例 #13
0
from src.manager import manager

if __name__ == '__main__':
    manager()
コード例 #14
0
 def setUpClass(cls):
     cls.filename = 'weg_2015_1T.pdf'
     cls.manager_pypdf2 = m.manager([cls.filename], 'pypdf2')
コード例 #15
0
 def setUpClass(cls):
     cls.filename = 'fleury_2020_2T.pdf'
     cls.manager_pypdf2 = m.manager([cls.filename], 'pypdf2')
コード例 #16
0
#!/usr/bin/env python
#
##
# Copyright (c) 2006-2013 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#
# Runs a suite of tests defined in a config file against a caldav server
#

from src.manager import manager
import sys

if __name__ == "__main__":

    manager = manager()
    manager.readCommandLine()
    result, timing = manager.runAll()
    sys.exit(result)
コード例 #17
0
 def setUpClass(cls):
     cls.filename = 'gerdau_2019_2T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract')
コード例 #18
0
 def setUpClass(cls):
     cls.filename = 'fleury_2020_2T.pdf'
     cls.manager_pytesseract = m.manager([cls.filename], 'pytesseract', '--psm 6')
コード例 #19
0
    for looper in range(loop):
        print "-Overall loop: %d of %d" % (looper + 1, loop,)
        data = []
        for ctr, f in enumerate(fnames):
            
            print "--Script: %d of %d" % (ctr + 1, len(fnames),)
    
            # Get initial memory usage for later comparison
            start_usage = getMemusage(pid)
            
            # Now run caldav tester scripts a number of times
            for loopy in range(num):
                if num > 1:
                    print "---Loop %d of %d" % (loopy + 1, num,)
                tester = manager()
                if suppress:
                    tester.logLevel = manager.LOG_NONE
                else:
                    tester.logLevel = manager.LOG_LOW
                tester.runWithOptions(sname, pname, [f], {}, pid=pid, memUsage=monitor)
            
            # Get final memory usage
            end_usage = getMemusage(pid)
            
            data.append((f, start_usage, end_usage,))
        
        if not suppress:
            print ""
            print "RESULTS"
            print ""
コード例 #20
0
 def setUpClass(cls):
     cls.filename = 'ambev_2019_1T.pdf'
     cls.manager_pypdf2 = m.manager([cls.filename], 'pypdf2')
コード例 #21
0
ファイル: testcaldav.py プロジェクト: Bedework/caldavtester
#!/usr/bin/env python
#
##
# Copyright (c) 2006-2016 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#
# Runs a suite of tests defined in a config file against a caldav server
#

from src.manager import manager
import sys

if __name__ == "__main__":

    manager = manager()
    manager.readCommandLine()
    result, timing = manager.runAll()
    sys.exit(result)