30_getdents.py 1.2 KB

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python2
  2. import os, sys, mmap
  3. from regression import Regression
  4. loader = sys.argv[1]
  5. # Running Bootstrap
  6. regression = Regression(loader, "getdents", None, 10000)
  7. # This doesn't catch extraneous entries, but should be fine
  8. # until the LTP test can be run (need symlink support)
  9. regression.add_check(name="Directory listing (32-bit)",
  10. check=lambda res: "getdents: setup ok" in res[0].out and \
  11. "getdents32: . [0x4]" in res[0].out and \
  12. "getdents32: .. [0x4]" in res[0].out and \
  13. "getdents32: file1 [0x8]" in res[0].out and \
  14. "getdents32: file2 [0x8]" in res[0].out and \
  15. "getdents32: dir3 [0x4]" in res[0].out)
  16. regression.add_check(name="Directory listing (64-bit)",
  17. check=lambda res: "getdents: setup ok" in res[0].out and \
  18. "getdents64: . [0x4]" in res[0].out and \
  19. "getdents64: .. [0x4]" in res[0].out and \
  20. "getdents64: file1 [0x8]" in res[0].out and \
  21. "getdents64: file2 [0x8]" in res[0].out and \
  22. "getdents64: dir3 [0x4]" in res[0].out)
  23. rv = regression.run_checks()
  24. if rv: sys.exit(rv)