diff --git a/ioc/startioc.py b/ioc/startioc.py index a1dfcee..5412d10 100644 --- a/ioc/startioc.py +++ b/ioc/startioc.py @@ -37,4 +37,4 @@ def startioc(): f'epicsEnvSet("MASTERMACS1_PORT", "{config["controllers"]["masterMacs1"]["port"]}")\n') # Start the IOC itself - subprocess.run("st_cmd") + subprocess.run("st.cmd") diff --git a/maketestenv b/maketestenv index 4e13dbc..c9c4e87 100644 --- a/maketestenv +++ b/maketestenv @@ -9,4 +9,4 @@ source testenv/bin/activate pip install 'caproto' pip install 'pytest' -pip install 'yaml' \ No newline at end of file +pip install 'pyyaml' \ No newline at end of file diff --git a/tests/sinqAxis/__init__.py b/tests/sinqAxis/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/sinqAxis/home.py b/tests/sinqAxis/home.py deleted file mode 100644 index 3a3d1d7..0000000 --- a/tests/sinqAxis/home.py +++ /dev/null @@ -1,41 +0,0 @@ -import time - - -def home(motor, forward): - - encoder = motor.read_field('encoder_type') - if encoder == 'absolute': - is_absolute = True - elif encoder == 'incremental': - is_absolute = False - else: - raise ValueError(f'Unknown encoder type {encoder}') - - # Start a homing run and observe the motor behaviour depending on the - # encoder type - if forward: - motor.write_field('homeforward') - else: - motor.write_field('homereverse') - - # Give the record some time to react - time.sleep(0.5) - - if is_absolute: - # Motor should not move at all - assert motor.read_field('moving') == 0 - assert motor.read_field('donemoving') == 1 - assert not motor.has_error() - else: - # Motor should start movement - assert motor.read_field('moving') == 1 - assert motor.read_field('donemoving') == 0 - assert not motor.has_error() - assert not motor.is_homed() - - motor.wait_for_done() - - assert motor.read_field('moving') == 0 - assert motor.read_field('donemoving') == 1 - assert not motor.has_error() - assert motor.is_homed() diff --git a/tests/sinqAxis/limits.py b/tests/sinqAxis/limits.py deleted file mode 100644 index fd28202..0000000 --- a/tests/sinqAxis/limits.py +++ /dev/null @@ -1,21 +0,0 @@ -import time - - -def reread_limits_from_hw(motor): - """ - sinqAxis motors usually read their limits from the hardware at each poll, - hence any values manually written to DHLM or DLLM should be overwritten - after the next poll at latest - """ - (high_limit, low_limit) = motor.limits() - motor.write_field('dialhighlimit', high_limit-+10) - motor.write_field('diallowlimit', low_limit-10) - - # After two seconds, at least one poll has been done - time.sleep(2) - - # Values should have been reread - assert motor.read_field('highlimit') == high_limit - assert motor.read_field('lowlimit') == low_limit - assert motor.read_field('dialhighlimit') == high_limit - assert motor.read_field('diallowlimit') == low_limit diff --git a/tests/sinqAxis/turboPmac/__init__.py b/tests/sinqAxis/turboPmac/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/sinqAxis/turboPmac/lin1/__init__.py b/tests/sinqAxis/turboPmac/lin1/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/sinqAxis/turboPmac/lin1/prepare.py b/tests/sinqAxis/turboPmac/lin1/prepare.py deleted file mode 100644 index 4d57e15..0000000 --- a/tests/sinqAxis/turboPmac/lin1/prepare.py +++ /dev/null @@ -1,9 +0,0 @@ -# Prepare - -import pytest -from common import TurboPMAC - - -@pytest.fixture -def lin1(): - return TurboPMAC() diff --git a/tests/sinqAxis/turboPmac/rot1/__init__.py b/tests/sinqAxis/turboPmac/rot1/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/sinqAxis/turboPmac/rot1/conftest.py b/tests/sinqAxis/turboPmac/rot1/conftest.py deleted file mode 100644 index 75299de..0000000 --- a/tests/sinqAxis/turboPmac/rot1/conftest.py +++ /dev/null @@ -1,25 +0,0 @@ -# This module defines fixtures which are shared for all tests of motor "rot1". - -import pytest -from common import TurboPMAC, read_config - - -@pytest.fixture(autouse=True) -def motor(): - config = read_config() - return TurboPMAC(config['controllers']['turboPmac1']['ip'], - config['controllers']['turboPmac1']['port'], - config['pvprefix'] + 'turboPmac1:rot1') - - -def reset(motor): - """ - Reset the motor for the next test. This means the following things: - 1) Resetting all errors - 2) Enabling the motor - 3) Moving to zero - """ - motor.write_field('stop', 1) - motor.write_field('reseterrorpv', 1) - motor.write_field('enable', 1) - motor.move_and_wait(0) diff --git a/tests/sinqAxis/turboPmac/rot1/test_common.py b/tests/sinqAxis/turboPmac/rot1/test_common.py deleted file mode 100644 index 11829fa..0000000 --- a/tests/sinqAxis/turboPmac/rot1/test_common.py +++ /dev/null @@ -1,18 +0,0 @@ -# Run a selection of common tests - -from tests.move import * -from tests.sinqAxis.limits import * -from tests.sinqAxis.turboPmac.rot1.conftest import reset - - -# def test_move_to_low_limit_switch(motor): -# reset(motor) -# move_to_low_limit_switch(motor) - - -# def test_move_to_high_limit_switch(motor): -# reset(motor) -# move_to_high_limit_switch(motor) - -def test_reread_limits_from_hw(motor): - reread_limits_from_hw(motor)