Commit 0200a93c authored by Federico Vaga's avatar Federico Vaga

tst: start pytest effort with basic open/close dma test

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent fefdf297
"""
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2020 CERN
"""
import pytest
from PySPEC import PySPEC
@pytest.fixture(scope="function")
def spec():
return PySPEC(pytest.pci_id)
def pytest_addoption(parser):
parser.addoption("--pci-id",
required=True, help="SPEC PCI Identifier")
def pytest_configure(config):
pytest.pci_id = config.getoption("--pci-id")
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2020 CERN
[pytest]
addopts = -v -p no:cacheprovider
\ No newline at end of file
"""
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2020 CERN
"""
import pytest
from PySPEC import PySPEC
class TestDma(object):
def test_acquisition_release(self, spec):
"""
Users can open and close the DMA channel
"""
spec.dma_start()
spec.dma_stop()
def test_acquisition_release_contention(self, spec):
"""
Refuse simultaneous DMA transfers
"""
spec.dma_start()
spec_c = PySPEC(spec.pci_id)
with pytest.raises(OSError) as error:
spec_c.dma_start()
spec.dma_stop()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment