Changeset 255 for test


Ignore:
Timestamp:
06/13/11 15:15:08 (13 years ago)
Author:
tim
Message:

fixed error condition deadlock in regfi
prevented early garbage collection of hive file handles
fixed module imports under python3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/pyregfi-smoketest.py

    r253 r255  
    106106    global recurseKey_stat
    107107    global recurseValue_stat
    108     recurseKey_stat += (key.mtime.low^key.mtime.high - key.max_bytes_subkeyname) * key.flags
     108    recurseKey_stat += (key.mtime - key.max_bytes_subkeyname) * key.flags
    109109    for v in key.values:
    110110        recurseValue_stat += (v.data_off - v.data_size) / (1.0 + v.flags) + v.data_in_offset
    111         value = key.values[v.name]
    112         if v != value:
    113             print("WARNING: iterator value '%s' does not match dictionary value '%s'."
    114                   % (v.name, value.name))
     111        try:
     112            value = key.values[v.name]
     113            if v != value:
     114                print("WARNING: iterator value '%s' does not match dictionary value '%s'."
     115                      % (v.name, value.name))
     116        except Exception as e:
     117                print("WARNING: iterator value name '%s' is not retrievable via value list\n"
     118                      % (v.name,))
     119       
    115120
    116121def recurseTree(cur, operation):
     
    258263    print("  Security stat: %d" % stat)
    259264
     265
    260266tests = {
    261267    "iterTallyNames":iterTallyNames,
     
    286292    if st not in tests:
    287293        usage()
    288         sys.stderr.write("ERROR: %s not a valid test type" % st)
     294        sys.stderr.write("ERROR: %s not a valid test type\n\n" % st)
    289295        sys.exit(1)
    290296
     
    296302start_time = time.time()
    297303for hname,fh in files:
    298     hive = pyregfi.Hive(fh)
     304    #hive = pyregfi.Hive(fh)
     305    hive = pyregfi.openHive(hname)
    299306    for tname in selected_tests:
    300307        t = tests[tname]
Note: See TracChangeset for help on using the changeset viewer.