Commits

Leah Hanson  committed ed52d16

started testing framework. There is one test currently, and it works but does not pass.

  • Participants
  • Parent commits 60fced7

Comments (0)

Files changed (5)

File tests/db_delta.py

+import os
+
+file = open("lines_db_delta.txt")
+lines = file.read()
+os.remove("lines_db_delta.txt")
+print "%s" % lines  

File tests/db_get.py

+import os
+
+try:
+  file = open("lines_db_get.txt",'r')
+  lines = file.read()
+  os.remove("lines_db_get.txt")
+  print "%s" % lines
+except:
+  file = open("log.txt",'a')
+  file.write("db_get got called\n")
+  file.close()
+

File tests/db_put.py

+import os
+
+try:
+  file = open("lines_db_put.txt",'r')
+  lines = file.read()
+  os.remove("lines_db_put.txt")
+  print "%s" % lines
+except:
+  file = open("log.txt",'a')
+  file.write("db_put got called\n")
+  file.close()
+

File tests/log.txt

+db_get got called

File tests/test.py

+from subprocess import Popen
+import time
+import os
+
+os.system("rm -rf /boot/home/Dropbox/*")
+os.system("rm log.txt lines_*")
+os.system("touch log.txt")
+
+# start dbclient
+p = Popen(["../objects.x86-gcc2-release/hdbclient.exe"])
+time.sleep(2)
+
+putlines = open("lines_db_put.txt",'w+')
+putlines.write("success")
+putlines.close()
+
+foo = open("/boot/home/Dropbox/foo",'w+')
+foo.write("Hello,World")
+foo.close()
+
+deltalines = open("lines_db_delta.txt",'w+')
+deltalines.write("FILE /foo")
+deltalines.close()
+
+time.sleep(10)
+
+# kill dbclient
+p.kill()
+
+print "Checking Assertions:"
+os.system("cat log.txt")
+