- Timestamp:
- 04/09/11 12:31:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/pyregfi-smoketest.py
r225 r227 8 8 9 9 10 def usage(): 11 sys.stderr.write("USAGE: pyregfi-smoketest.py hive1 [hive2 ...]\n") 12 13 14 10 11 pyregfi.SetLogMask((pyregfi.LOG_TYPES.INFO, pyregfi.LOG_TYPES.WARN, pyregfi.LOG_TYPES.ERROR)) 15 12 16 13 # Uses the HiveIterator to walk all keys … … 192 189 pass 193 190 194 195 if len(sys.argv) < 2: 191 tests = { 192 "iterTallyNames":iterTallyNames, 193 "iterParentWalk":iterParentWalk, 194 "iterTallyData":iterTallyData, 195 "recurseKeyTally":recurseKeyTally, 196 "iterFetchRelated":iterFetchRelated, 197 "iterIterWalk":iterIterWalk, 198 "iterCallbackIO":iterCallbackIO, 199 } 200 201 def usage(): 202 sys.stderr.write("USAGE: pyregfi-smoketest.py test1[,test2[,...]] hive1 [hive2 ...]\n") 203 sys.stderr.write("\tAvailable tests:\n") 204 for t in tests.keys(): 205 sys.stderr.write("\t\t%s\n" % t) 206 207 208 if len(sys.argv) < 3: 196 209 usage() 197 210 sys.exit(1) 198 211 199 200 tests = [("iterTallyNames",iterTallyNames), 201 ("iterParentWalk",iterParentWalk), 202 ("iterTallyData",iterTallyData), 203 ("recurseKeyTally",recurseKeyTally), 204 ("iterFetchRelated",iterFetchRelated), 205 ("iterIterWalk",iterIterWalk),] 206 207 tests = [("iterCallbackIO",iterCallbackIO),] 208 212 selected_tests = sys.argv[1].split(',') 213 for st in selected_tests: 214 if st not in tests: 215 usage() 216 sys.stderr.write("ERROR: %s not a valid test type" % st) 217 sys.exit(1) 209 218 210 219 files = [] 211 for f in sys.argv[ 1:]:220 for f in sys.argv[2:]: 212 221 files.append((f, open(f,"rb"))) 213 222 … … 216 225 for hname,fh in files: 217 226 hive = pyregfi.Hive(fh) 218 for tname,t in tests: 227 for tname in selected_tests: 228 t = tests[tname] 219 229 teststart = time.time() 220 230 tstr = "'%s' on '%s'" % (tname,hname)
Note: See TracChangeset
for help on using the changeset viewer.