dl1ksv / gr-funcube

Provide a gnuradio oot module for the for the funcube and the funcube pro plus dongle, requires gnuradio 3.9 and pybind
GNU General Public License v3.0
5 stars 5 forks source link

Some tests are failing #3

Open yarda opened 3 years ago

yarda commented 3 years ago
+ cd /builddir/build/BUILD
+ cd gr-funcube-1.0.0
+ cd x86_64-redhat-linux-gnu
+ make test
Running tests...
/usr/bin/ctest --force-new-ctest-process 
Test project /builddir/build/BUILD/gr-funcube-1.0.0/x86_64-redhat-linux-gnu
    Start 1: funcube_qa_fcdpp.cc
1/8 Test #1: funcube_qa_fcdpp.cc ..............   Passed    0.01 sec
    Start 2: funcube_qa_fcdpp_control.cc
2/8 Test #2: funcube_qa_fcdpp_control.cc ......   Passed    0.01 sec
    Start 3: funcube_qa_fcd.cc
3/8 Test #3: funcube_qa_fcd.cc ................   Passed    0.01 sec
    Start 4: funcube_qa_fcd_control.cc
4/8 Test #4: funcube_qa_fcd_control.cc ........   Passed    0.01 sec
    Start 5: qa_fcd_control
5/8 Test #5: qa_fcd_control ...................***Failed    0.29 sec
    Start 6: qa_fcd
6/8 Test #6: qa_fcd ...........................***Failed    0.19 sec
    Start 7: qa_fcdpp_control
7/8 Test #7: qa_fcdpp_control .................***Failed    0.20 sec
    Start 8: qa_fcdpp
8/8 Test #8: qa_fcdpp .........................***Failed    0.20 sec

50% tests passed, 4 tests failed out of 8

Total Test time (real) =   0.91 sec

The following tests FAILED:
      5 - qa_fcd_control (Failed)
      6 - qa_fcd (Failed)
      7 - qa_fcdpp_control (Failed)
      8 - qa_fcdpp (Failed)
Errors while running CTest
make: *** [Makefile:152: test] Error 8
error: Bad exit status from /var/tmp/rpm-tmp.W7Z3Re (%check)
yarda commented 3 years ago

This is verbose run through ctest -V (just the failing tests):

5: Test command: /usr/bin/sh "/builddir/build/BUILD/gr-funcube-1.0.0/x86_64-redhat-linux-gnu/python/qa_fcd_control_test.sh"
5: Test timeout computed to be: 10000000
5: Traceback (most recent call last):
5:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcd_control.py", line 12, in <module>
5:     from funcube import fcd_control
5: ModuleNotFoundError: No module named 'funcube'
5: 
5: During handling of the above exception, another exception occurred:
5: 
5: Traceback (most recent call last):
5:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcd_control.py", line 18, in <module>
5:     from funcube import fcd_control
5: ModuleNotFoundError: No module named 'funcube'
5/8 Test #5: qa_fcd_control ...................***Failed    0.19 sec
test 6
    Start 6: qa_fcd

6: Test command: /usr/bin/sh "/builddir/build/BUILD/gr-funcube-1.0.0/x86_64-redhat-linux-gnu/python/qa_fcd_test.sh"
6: Test timeout computed to be: 10000000
6: Traceback (most recent call last):
6:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcd.py", line 12, in <module>
6:     from funcube import fcd
6: ModuleNotFoundError: No module named 'funcube'
6: 
6: During handling of the above exception, another exception occurred:
6: 
6: Traceback (most recent call last):
6:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcd.py", line 18, in <module>
6:     from funcube import fcd
6: ModuleNotFoundError: No module named 'funcube'
6/8 Test #6: qa_fcd ...........................***Failed    0.18 sec
test 7
    Start 7: qa_fcdpp_control

7: Test command: /usr/bin/sh "/builddir/build/BUILD/gr-funcube-1.0.0/x86_64-redhat-linux-gnu/python/qa_fcdpp_control_test.sh"
7: Test timeout computed to be: 10000000
7: Traceback (most recent call last):
7:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcdpp_control.py", line 12, in <module>
7:     from funcube import fcdpp_control
7: ModuleNotFoundError: No module named 'funcube'
7: 
7: During handling of the above exception, another exception occurred:
7: 
7: Traceback (most recent call last):
7:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcdpp_control.py", line 18, in <module>
7:     from funcube import fcdpp_control
7: ModuleNotFoundError: No module named 'funcube'
7/8 Test #7: qa_fcdpp_control .................***Failed    0.19 sec
test 8
    Start 8: qa_fcdpp

8: Test command: /usr/bin/sh "/builddir/build/BUILD/gr-funcube-1.0.0/x86_64-redhat-linux-gnu/python/qa_fcdpp_test.sh"
8: Test timeout computed to be: 10000000
8: Traceback (most recent call last):
8:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcdpp.py", line 12, in <module>
8:     from funcube import fcdpp
8: ModuleNotFoundError: No module named 'funcube'
8: 
8: During handling of the above exception, another exception occurred:
8: 
8: Traceback (most recent call last):
8:   File "/builddir/build/BUILD/gr-funcube-1.0.0/python/qa_fcdpp.py", line 18, in <module>
8:     from funcube import fcdpp
8: ModuleNotFoundError: No module named 'funcube'
8/8 Test #8: qa_fcdpp .........................***Failed    0.19 sec
dl1ksv commented 3 years ago

If you install funcube an then run the tests the failing tests pass, too. If you run the tests before installing the python libs are not found. I must still figure out how to set the pathes pointing to the build environment.

yarda commented 3 years ago

It seems the problem is wrong library name, e.g. in the qa_fcd_controll.py:

....
   from funcube import fcd_control
....

But the library is named funcube_python. The following works for me:

   from funcube_python import fcd_control

Also it seems the path can be set in the cmake by e.g.:

set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/python/bindings)

So the python tests probably don't need the try block when loading the library.

yarda commented 3 years ago

By changing the library name and setting the GR_TEST_PYTHON_DIRS the testsuite now passes in the build time. I don't know whether it's the best solution but it works in Fedora downstream, I can PR it.

dl1ksv commented 3 years ago

Yes that did it! Many thanks. I just push your proposed fix.

barjac commented 3 years ago

Are the tests supposed to pass with no dongle attached? If so, I am seeing tests fail with the patch applied. I am packaging this to replace gr-fcdproplus in Mageia and have adapted your Fedora spec (with thanks!) to our way of doing things. We libify gnuradio into individual libraries, python and -devel packages so maybe the tests require more than the gnuradio BuildRequires that we have in the build chroot?

BuildRequires: pkgconfig(gnuradio-audio) BuildRequires: pkgconfig(gnuradio-blocks) BuildRequires: pkgconfig(gnuradio-runtime) BuildRequires: gnuradio-utils (this currently has the cmake files which I intend to move into the appropriate -devel packages)

Start testing: Mar 27 16:57 GMT
----------------------------------------------------------
1/8 Testing: funcube_qa_fcdpp.cc
1/8 Test: funcube_qa_fcdpp.cc
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib/funcube_qa_fcdpp.cc_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib
"funcube_qa_fcdpp.cc" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Running 1 test case...

*** No errors detected

<end of output>
Test time =   0.04 sec
----------------------------------------------------------
Test Passed.
"funcube_qa_fcdpp.cc" end time: Mar 27 16:57 GMT
"funcube_qa_fcdpp.cc" time elapsed: 00:00:00
----------------------------------------------------------

2/8 Testing: funcube_qa_fcdpp_control.cc
2/8 Test: funcube_qa_fcdpp_control.cc
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib/funcube_qa_fcdpp_control.cc_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib
"funcube_qa_fcdpp_control.cc" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Running 1 test case...

*** No errors detected

<end of output>
Test time =   0.01 sec
----------------------------------------------------------
Test Passed.
"funcube_qa_fcdpp_control.cc" end time: Mar 27 16:57 GMT
"funcube_qa_fcdpp_control.cc" time elapsed: 00:00:00
----------------------------------------------------------

3/8 Testing: funcube_qa_fcd.cc
3/8 Test: funcube_qa_fcd.cc
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib/funcube_qa_fcd.cc_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib
"funcube_qa_fcd.cc" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Running 1 test case...

*** No errors detected

<end of output>
Test time =   0.01 sec
----------------------------------------------------------
Test Passed.
"funcube_qa_fcd.cc" end time: Mar 27 16:57 GMT
"funcube_qa_fcd.cc" time elapsed: 00:00:00
----------------------------------------------------------

4/8 Testing: funcube_qa_fcd_control.cc
4/8 Test: funcube_qa_fcd_control.cc
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib/funcube_qa_fcd_control.cc_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/lib
"funcube_qa_fcd_control.cc" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Running 1 test case...

*** No errors detected

<end of output>
Test time =   0.00 sec
----------------------------------------------------------
Test Passed.
"funcube_qa_fcd_control.cc" end time: Mar 27 16:57 GMT
"funcube_qa_fcd_control.cc" time elapsed: 00:00:00
----------------------------------------------------------

5/8 Testing: qa_fcd_control
5/8 Test: qa_fcd_control
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python/qa_fcd_control_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python
"qa_fcd_control" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Traceback (most recent call last):
  File "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/python/qa_fcd_control.py", line 9, in <module>
    from gnuradio import gr, gr_unittest
ImportError: cannot import name 'gr' from 'gnuradio' (unknown location)
<end of output>
Test time =   0.04 sec
----------------------------------------------------------
Test Failed.
"qa_fcd_control" end time: Mar 27 16:57 GMT
"qa_fcd_control" time elapsed: 00:00:00
----------------------------------------------------------

6/8 Testing: qa_fcd
6/8 Test: qa_fcd
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python/qa_fcd_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python
"qa_fcd" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Traceback (most recent call last):
  File "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/python/qa_fcd.py", line 9, in <module>
    from gnuradio import gr, gr_unittest
ImportError: cannot import name 'gr' from 'gnuradio' (unknown location)
<end of output>
Test time =   0.03 sec
----------------------------------------------------------
Test Failed.
"qa_fcd" end time: Mar 27 16:57 GMT
"qa_fcd" time elapsed: 00:00:00
----------------------------------------------------------

7/8 Testing: qa_fcdpp_control
7/8 Test: qa_fcdpp_control
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python/qa_fcdpp_control_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python
"qa_fcdpp_control" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Traceback (most recent call last):
  File "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/python/qa_fcdpp_control.py", line 9, in <module>
    from gnuradio import gr, gr_unittest
ImportError: cannot import name 'gr' from 'gnuradio' (unknown location)
<end of output>
Test time =   0.03 sec
----------------------------------------------------------
Test Failed.
"qa_fcdpp_control" end time: Mar 27 16:57 GMT
"qa_fcdpp_control" time elapsed: 00:00:00
----------------------------------------------------------

8/8 Testing: qa_fcdpp
8/8 Test: qa_fcdpp
Command: "/usr/bin/sh" "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python/qa_fcdpp_test.sh"
Directory: /home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/build/python
"qa_fcdpp" start time: Mar 27 16:57 GMT
Output:
----------------------------------------------------------
Traceback (most recent call last):
  File "/home/baz/BLD/BLD_Mga9_02/gr-funcube/BUILD/gr-funcube-1.0.0/python/qa_fcdpp.py", line 9, in <module>
    from gnuradio import gr, gr_unittest
ImportError: cannot import name 'gr' from 'gnuradio' (unknown location)
<end of output>
Test time =   0.03 sec
----------------------------------------------------------
Test Failed.
"qa_fcdpp" end time: Mar 27 16:57 GMT
"qa_fcdpp" time elapsed: 00:00:00
----------------------------------------------------------

End testing: Mar 27 16:57 GMT
dl1ksv commented 3 years ago

The test should run without any devices attached. t only checks, if the lis can be loaded. But I think gr-pdu is missing. And perhaps some python parts? gr is located in gnuradio-runtime/python/gnuradio/gr

yarda commented 3 years ago

It works for me without any dongle attached. The only failures I can see are on the ppc64le and s390x architectures. It coredumps there without catching the exception in the 'try' block. It's very suspicious, but the test log looks differently than yours. I am going to debug these alternative arches failure (hopefully).

barjac commented 3 years ago

Tests now complete with no errors after adding: BuildRequires: python-gnuradio-pmt BuildRequires: python-gnuradio-runtime

Thanks, Barry G4MKT

dl1ksv commented 3 years ago

@yarda Could you fix the coredumps ? I'm testing on fc33 master branch and everything is fine. But when I test against the feature/gr-iio branch I get coredumps in python.

On ubuntu 20.04 everything is fine. At the moment I have no idea how to fix.

yarda commented 3 years ago

@yarda Could you fix the coredumps ? I'm testing on fc33 master branch and everything is fine. But when I test against the feature/gr-iio branch I get coredumps in python.

On ubuntu 20.04 everything is fine. At the moment I have no idea how to fix.

I am seeing the coredumps only on the s390x and ppc64le. The tracebacks doesn't seem useful - everything seems fine, so this could be also tooling problem (e.g. gcc, binutils, ...). Currently it's not prio for me, because I don't think there are any users on such arches, but I would like to take deeper look on it.

dl1ksv commented 3 years ago

Thanks for your info.

dl1ksv commented 2 years ago

@yarda Can we close this issue?

yarda commented 2 years ago

I will retest on Fedora 37.