Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# requirements: sudo apt-get install memtester
import sys
import os
def main():
if len(sys.argv) != 2 and len(sys.argv) !=3:
sys.exit("Usuage: %s <memory> [iterations]" % (sys.argv[0]))
if len(sys.argv) == 3:
iteration = int(sys.argv[2])
iteration = 0
memory = sys.argv[1]
ret = os.system("sudo memtester %s %d" % (memory, iteration))
if ret == 0:
if ret & 0x1 == 0x1:
print("error allocatinh or locking memory, or inrocation error")
if ret & 0x2 == 0x2:
print("error during stuck address test")
if ret & 0x4 == 0x4:
print("error during one of the other tests")
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.