-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathverify.py
46 lines (41 loc) · 1.25 KB
/
verify.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import subprocess
import sys
import time
files = [
('test_waldisk.py ', 'WAL Layer'),
('test_xv6inode.py', 'Inode layer'),
('test_dirspec.py', 'Directory layer'),
('test_bitmap.py', 'Bitmap disk refinement'),
('test_inodepack.py', 'Inode disk refinement'),
('test_partition.py', 'Multi disk partition refinement'),
]
n = time.time()
for i, pt in files:
sys.stdout.write('Verifying %s.' % pt)
sys.stdout.flush()
outp = ""
lastp = time.time()
w = subprocess.Popen('python2 %s' % i, shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
np = 0
pn = time.time()
while True:
out = w.stderr.read(1)
outp += out
if not out:
t = time.time() - pn
sys.stdout.write("%s%f seconds\n" % ('.' * (50 - np - len(pt) - len(str(int(t)))), t))
w.wait()
if w.returncode != 0:
print
print 'Failure.'
print outp
sys.exit(1)
break
if out == '.':
if time.time() - lastp > 1:
np += 1
sys.stdout.write(out)
sys.stdout.flush()
lastp = time.time()
print
print 'Success. Verified Yxv6 in %fs' % (time.time() - n)