Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux AMD64 test fixes #78

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions CI/travis/before_install_linux
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

. CI/travis/lib.sh

install_libiio_from_source() {
git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
mkdir build && cd build
cmake ..
make
sudo make install
sudo ldconfig
cd ../..
}

install_iioemu() {
git clone https://github.com/analogdevicesinc/libtinyiiod.git
cd libtinyiiod
mkdir build && cd build
cmake -DBUILD_EXAMPLES=OFF ..
make
sudo make install
sudo ldconfig
cd ../..

git clone -b v0.1.0 https://github.com/analogdevicesinc/iio-emu.git
cd iio-emu
mkdir build && cd build
cmake ..
make
sudo make install
sudo ldconfig
cd ../..
}

install_sphinx() {
$PYTHON --version

Expand Down Expand Up @@ -45,7 +76,7 @@ handle_centos() {
yum -y install libzstd

yum -y install libxml2-devel libusb1-devel doxygen libaio-devel \
avahi-devel bzip2 gzip rpm rpm-build
avahi-devel bzip2 gzip rpm rpm-build git

if [ -n "$PACKAGE_TO_INSTALL" ] ; then
sudo yum localinstall -y $PACKAGE_TO_INSTALL
Expand All @@ -55,6 +86,7 @@ handle_centos() {
fi

$PYTHON -m pip install pylibiio --no-binary :all:
install_iioemu
}

handle_generic_docker() {
Expand All @@ -66,17 +98,22 @@ handle_default() {
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake doxygen graphviz \
libaio-dev libavahi-client-dev libavahi-common-dev libusb-1.0-0-dev \
libxml2-dev rpm tar bzip2 gzip flex bison libserialport-dev \
python3 python3-pip python3-setuptools
python3 python3-pip python3-setuptools git wget

if [ -n "$PACKAGE_TO_INSTALL" ] ; then
sudo dpkg -i $PACKAGE_TO_INSTALL
elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then
wget http://swdownloads.analog.com/cse/travis_builds/${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb
sudo dpkg -i ./${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb
wget http://swdownloads.analog.com/cse/travis_builds/${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb || true
if [ -f "${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb" ]
sudo dpkg -i ./${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb
else
install_libiio_from_source
fi
fi

$PYTHON -m pip install pylibiio --no-binary :all:
install_sphinx
install_iioemu
}

handle_ubuntu() {
Expand Down
4 changes: 2 additions & 2 deletions CI/travis/make_linux
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ handle_default() {
cd ..
cd bindings/python
pip3 install -r requirements_dev.txt
python3 -m pytest -vs --skip-scan
python3 -m pytest -vs --skip-scan --adi-hw-map
}

handle_centos() {
Expand All @@ -28,7 +28,7 @@ handle_centos() {
cd bindings/python
pip3 install -r requirements_dev.txt
export LD_LIBRARY_PATH=/usr/local/lib/
python3 -m pytest -vs --skip-scan
python3 -m pytest -vs ---skip-scan --adi-hw-map
}

handle_ubuntu() {
Expand Down
14 changes: 7 additions & 7 deletions bindings/python/test/test_ad9361.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
filterfile_name = os.path.join(path, "LTE15_MHz.ftr")


@pytest.mark.iio_hardware(ad9361_all)
@pytest.mark.iio_hardware(ad9361_all, True)
@pytest.mark.parametrize("rate_msps", [*(range(1, 30))])
def test_bb_rate(iio_uri, rate_msps):
rate = rate_msps * 1e6
Expand All @@ -21,7 +21,7 @@ def test_bb_rate(iio_uri, rate_msps):
assert abs(rate - hw) < 3


@pytest.mark.iio_hardware(ad9361_all)
@pytest.mark.iio_hardware(ad9361_all, True)
@pytest.mark.parametrize("rate_msps", [*(range(1, 30))])
def test_bb_rate_custom_filter_manual(iio_uri, rate_msps):
rate = rate_msps * 1e6
Expand All @@ -37,7 +37,7 @@ def test_bb_rate_custom_filter_manual(iio_uri, rate_msps):
assert abs(rate - hw) < 3


@pytest.mark.iio_hardware(ad9361_all)
@pytest.mark.iio_hardware(ad9361_all, True)
@pytest.mark.parametrize("rate_msps", [*(range(1, 30))])
def test_bb_rate_custom_filter(iio_uri, rate_msps):
rate = rate_msps * 1e6
Expand All @@ -48,7 +48,7 @@ def test_bb_rate_custom_filter(iio_uri, rate_msps):
assert abs(rate - hw) < 3


@pytest.mark.iio_hardware("fmcomms5")
@pytest.mark.iio_hardware("fmcomms5", True)
def test_mcs(iio_uri):
ctx = iio.Context(iio_uri)
main = ctx.find_device("ad9361-phy")
Expand All @@ -59,14 +59,14 @@ def test_mcs(iio_uri):
assert ret == 0


@pytest.mark.iio_hardware("fmcomms5")
@pytest.mark.iio_hardware("fmcomms5", True)
def test_fmc5_mcs(iio_uri):
ctx = iio.Context(iio_uri)
ret = ad9361.fmcomms5_multichip_sync(ctx, 3)
assert ret == 0


@pytest.mark.iio_hardware(ad9361_all)
@pytest.mark.iio_hardware(ad9361_all, True)
def test_trx_fir_enable(iio_uri):
ctx = iio.Context(iio_uri)
dev = ctx.find_device("ad9361-phy")
Expand Down Expand Up @@ -97,7 +97,7 @@ def test_trx_fir_enable(iio_uri):
assert dev.find_channel("voltage0", True).attrs["filter_fir_en"].value == "0"


@pytest.mark.iio_hardware("fmcomms5")
@pytest.mark.iio_hardware("fmcomms5", True)
def test_fmc5_phase_sync(iio_uri):
ctx = iio.Context(iio_uri)
ret = ad9361.fmcomms5_phase_sync(ctx, 1e9)
Expand Down