- Timestamp:
- 06/17/11 13:51:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/pyregfi-smoketest.py
r255 r262 65 65 path = getCurrentPath(k) 66 66 try: 67 print(repr(path)) 67 68 hive_iter = hive.subtree(path) 68 69 if hive_iter.current_key() != k: … … 174 175 ssk = hive_iter.find_subkey(sk.name) 175 176 if ssk != None: 176 sk_stat += len(ssk.name) 177 if ssk.name != None: 178 sk_stat += len(ssk.name) 177 179 else: 178 180 print("WARNING: ssk was None") … … 183 185 vv = hive_iter.find_value(v.name) 184 186 if vv != None: 185 v_stat += len(vv.name) 187 if vv.name != None: 188 v_stat += len(vv.name) 186 189 else: 187 190 print("WARNING: vv was None") … … 230 233 231 234 def loopSecurity(hive, fh): 232 start = hive.root.fetch_security() 233 print(start.descriptor.group) 234 cur = start.next_security() 235 236 while cur != start: 237 print(start.descriptor.group) 238 cur = cur.next_security() 235 cur = hive.root.fetch_security() 236 while True: 237 stat += len(cur.descriptor.owner) 238 stat += len(cur.descriptor.group) 239 if cur.descriptor.sacl: 240 stat += len(cur.descriptor.sacl) 241 if cur.descriptor.dacl: 242 stat += len(cur.descriptor.dacl) 243 244 nxt = cur.next_security() 245 if cur == nxt: 246 break 239 247 240 248 … … 278 286 279 287 def usage(): 280 sys.stderr.write("USAGE: pyregfi-smoketest.py test1[,test2[,...]]hive1 [hive2 ...]\n")288 sys.stderr.write("USAGE: pyregfi-smoketest.py { test1[,test2[,...]] | * } hive1 [hive2 ...]\n") 281 289 sys.stderr.write("\tAvailable tests:\n") 282 290 for t in tests.keys(): … … 288 296 sys.exit(1) 289 297 290 selected_tests = sys.argv[1].split(',') 291 for st in selected_tests: 292 if st not in tests: 293 usage() 294 sys.stderr.write("ERROR: %s not a valid test type\n\n" % st) 295 sys.exit(1) 298 if sys.argv[1] == '*': 299 selected_tests = tests.keys() 300 else: 301 selected_tests = sys.argv[1].split(',') 302 for st in selected_tests: 303 if st not in tests: 304 usage() 305 sys.stderr.write("ERROR: %s not a valid test type\n\n" % st) 306 sys.exit(1) 296 307 297 308 files = []
Note: See TracChangeset
for help on using the changeset viewer.