Skip to content

Commit

Permalink
Polling to check for segmentation faults
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Aug 29, 2013
1 parent 71734b7 commit e59d27a
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
60 changes: 60 additions & 0 deletions python-api/tests/integrationtests/test_controller.py
Expand Up @@ -34,6 +34,11 @@ def test_establish(self):
s.terminate()
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -70,6 +75,11 @@ def test_compose_ports(self):
s.terminate()
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -109,6 +119,11 @@ def test_encode_ports(self):
s.terminate()
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -151,6 +166,11 @@ def test_audio_ports(self):
s.terminate()
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -195,6 +215,11 @@ def test_audio_ports(self):
s.terminate()
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -237,6 +262,11 @@ def test_get_preview_ports(self):
s.terminate()
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -304,6 +334,11 @@ def set_composite_mode(self, mode, generate_frames=False):

finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -361,6 +396,11 @@ def test_new_record(self):
assert ((os.path.exists(test_filename)) or (os.path.exists(alt_test_filename))) == True
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -399,6 +439,11 @@ def adjust_pip(self, dx, dy, dw, dh, index, generate_frames=False):

finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -449,6 +494,11 @@ def switch(self, channel, port, index, generate_frames=False):
s.terminate()
finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -496,6 +546,11 @@ def click_video(self, dx, dy, dw, dh, index, generate_frames=False):

finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down Expand Up @@ -552,6 +607,11 @@ def mark_face(self, faces, index, generate_frames=False):

finally:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.terminate()
f = open('server.log')
print f.read()
Expand Down
5 changes: 5 additions & 0 deletions python-api/tests/integrationtests/test_server.py
Expand Up @@ -25,6 +25,11 @@ def startstop(self):
assert s.proc is None
except OSError:
if s.proc:
poll = s.poll()
if poll == -11:
print "SEGMENTATION FAULT OCCURRED"
else:
print "ERROR CODE - {0}".format(poll)
s.kill()
f = open('server.log')
print f.read()
Expand Down

0 comments on commit e59d27a

Please sign in to comment.