summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-03-10 15:06:20 -0400
committerTom Rondeau <tom@trondeau.com>2015-04-02 15:38:57 -0700
commit9073e7a1eab5187c92142d9c74e463c58f0c4a03 (patch)
tree83688506c909d36dee232fefdac4364a3ddcfc5f /gr-blocks/python
parent0d195a5a702703cc1f21d60a5c9217525380a94c (diff)
controlport: QA needs to get host and port out of the endpoint.
Probably need a better parsing strategy.
Diffstat (limited to 'gr-blocks/python')
-rw-r--r--gr-blocks/python/blocks/qa_cpp_py_binding.py7
-rw-r--r--gr-blocks/python/blocks/qa_cpp_py_binding_set.py7
-rw-r--r--gr-blocks/python/blocks/qa_ctrlport_probes.py28
3 files changed, 32 insertions, 10 deletions
diff --git a/gr-blocks/python/blocks/qa_cpp_py_binding.py b/gr-blocks/python/blocks/qa_cpp_py_binding.py
index 820c672529..23a5c9b826 100644
--- a/gr-blocks/python/blocks/qa_cpp_py_binding.py
+++ b/gr-blocks/python/blocks/qa_cpp_py_binding.py
@@ -24,7 +24,7 @@
# This program tests mixed python and c++ ctrlport exports in a single app
#
-import sys, time, random, numpy
+import sys, time, random, numpy, re
from gnuradio import gr, gr_unittest, blocks
from gnuradio.ctrlport import GNURadio
@@ -152,10 +152,13 @@ class test_cpp_py_binding(gr_unittest.TestCase):
# Get available endpoint
ep = gr.rpcmanager_get().endpoints()[0]
+ hostname = re.search("-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1)
+ portnum = re.search("-p (\d+)", ep).group(1)
+ argv = [None, hostname, portnum]
# Initialize a simple ControlPort client from endpoint
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
- radiosys = GNURadioControlPortClient(rpcmethod='thrift')
+ radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
# Get all exported knobs
diff --git a/gr-blocks/python/blocks/qa_cpp_py_binding_set.py b/gr-blocks/python/blocks/qa_cpp_py_binding_set.py
index 0f2e58db1e..5b81de08f9 100644
--- a/gr-blocks/python/blocks/qa_cpp_py_binding_set.py
+++ b/gr-blocks/python/blocks/qa_cpp_py_binding_set.py
@@ -24,7 +24,7 @@
# This program tests mixed python and c++ GRCP sets in a single app
#
-import sys, time, random, numpy
+import sys, time, random, numpy, re
from gnuradio import gr, gr_unittest, blocks
from gnuradio.ctrlport import GNURadio
@@ -119,10 +119,13 @@ class test_cpp_py_binding_set(gr_unittest.TestCase):
# Get available endpoint
ep = gr.rpcmanager_get().endpoints()[0]
+ hostname = re.search("-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1)
+ portnum = re.search("-p (\d+)", ep).group(1)
+ argv = [None, hostname, portnum]
# Initialize a simple ControlPort client from endpoint
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
- radiosys = GNURadioControlPortClient(rpcmethod='thrift')
+ radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
self.tb.start()
diff --git a/gr-blocks/python/blocks/qa_ctrlport_probes.py b/gr-blocks/python/blocks/qa_ctrlport_probes.py
index 6bdad7ec3b..c678846df0 100644
--- a/gr-blocks/python/blocks/qa_ctrlport_probes.py
+++ b/gr-blocks/python/blocks/qa_ctrlport_probes.py
@@ -22,7 +22,7 @@
import sys, time, random, numpy
from gnuradio import gr, gr_unittest, blocks
-import os, struct
+import os, struct, re
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
@@ -46,6 +46,7 @@ class test_ctrlport_probes(gr_unittest.TestCase):
self.tb.connect(self.src, self.probe)
self.tb.start()
+
# Probes return complex values as list of floats with re, im
# Imaginary parts of this data set are 0.
expected_result = [1, 2, 3, 4,
@@ -56,10 +57,13 @@ class test_ctrlport_probes(gr_unittest.TestCase):
# Get available endpoint
ep = gr.rpcmanager_get().endpoints()[0]
+ hostname = re.search("-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1)
+ portnum = re.search("-p (\d+)", ep).group(1)
+ argv = [None, hostname, portnum]
# Initialize a simple ControlPort client from endpoint
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
- radiosys = GNURadioControlPortClient(rpcmethod='thrift')
+ radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
# Get all exported knobs
@@ -94,10 +98,13 @@ class test_ctrlport_probes(gr_unittest.TestCase):
# Get available endpoint
ep = gr.rpcmanager_get().endpoints()[0]
+ hostname = re.search("-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1)
+ portnum = re.search("-p (\d+)", ep).group(1)
+ argv = [None, hostname, portnum]
# Initialize a simple ControlPort client from endpoint
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
- radiosys = GNURadioControlPortClient(rpcmethod='thrift')
+ radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
# Get all exported knobs
@@ -131,10 +138,13 @@ class test_ctrlport_probes(gr_unittest.TestCase):
# Get available endpoint
ep = gr.rpcmanager_get().endpoints()[0]
+ hostname = re.search("-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1)
+ portnum = re.search("-p (\d+)", ep).group(1)
+ argv = [None, hostname, portnum]
# Initialize a simple ControlPort client from endpoint
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
- radiosys = GNURadioControlPortClient(rpcmethod='thrift')
+ radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
# Get all exported knobs
@@ -169,10 +179,13 @@ class test_ctrlport_probes(gr_unittest.TestCase):
# Get available endpoint
ep = gr.rpcmanager_get().endpoints()[0]
+ hostname = re.search("-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1)
+ portnum = re.search("-p (\d+)", ep).group(1)
+ argv = [None, hostname, portnum]
# Initialize a simple ControlPort client from endpoint
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
- radiosys = GNURadioControlPortClient(rpcmethod='thrift')
+ radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
# Get all exported knobs
@@ -206,10 +219,13 @@ class test_ctrlport_probes(gr_unittest.TestCase):
# Get available endpoint
ep = gr.rpcmanager_get().endpoints()[0]
+ hostname = re.search("-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1)
+ portnum = re.search("-p (\d+)", ep).group(1)
+ argv = [None, hostname, portnum]
# Initialize a simple ControlPort client from endpoint
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
- radiosys = GNURadioControlPortClient(rpcmethod='thrift')
+ radiosys = GNURadioControlPortClient(argv=argv, rpcmethod='thrift')
radio = radiosys.client
# Get all exported knobs