summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorNathan West <nathan.west@okstate.edu>2015-10-05 18:12:10 -0400
committerNathan West <nathan.west@okstate.edu>2015-10-05 18:23:01 -0400
commit7d9f13824e9986650a2f46806d6d6714b99780ce (patch)
treeb72e29e1b5cfe6403404b867675de23a3f3863b5 /gr-blocks/python
parenta42b7dca3c784a3ee2f307d7c1989a9184ee5717 (diff)
blocks: add socket_pdu qa
This test shows a current bug in blocks::socket_pdu. The block hangs in the destructor.
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-xgr-blocks/python/blocks/qa_socket_pdu.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/gr-blocks/python/blocks/qa_socket_pdu.py b/gr-blocks/python/blocks/qa_socket_pdu.py
new file mode 100755
index 0000000000..4dba2bfd45
--- /dev/null
+++ b/gr-blocks/python/blocks/qa_socket_pdu.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest, blocks
+import random
+
+
+class qa_socket_pdu (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test_001 (self):
+ # Test that blocks can be created and destroyed without hanging
+ port = str(random.Random().randint(0, 30000) + 10000)
+ self.pdu_send = blocks.socket_pdu("UDP_CLIENT", "localhost", port)
+ self.pdu_recv = blocks.socket_pdu("UDP_SERVER", "localhost", port)
+ self.pdu_send = None
+ self.pdu_recv = None
+
+if __name__ == '__main__':
+ gr_unittest.run(qa_socket_pdu, "qa_socket_pdu.xml")
+