コード例 #1
0
def teardown_function(function):
    """ teardown any state that was previously setup with a setup_function
    call.
    """
    subarray = SubArray(1)
    if (resource('ska_low/tm_subarray_node/1').get('State') == "ON"):
        #this means there must have been an error
        if (resource('ska_low/tm_subarray_node/1').get('obsState') == "IDLE"):
            LOGGER.info("tearing down composed subarray (IDLE)")
            # subarray.deallocate() #TODO: Once the OET latest charts are available this can be reverted
            tmc.release_resources()
    if (resource('ska_low/tm_subarray_node/1').get('obsState') == "READY"):
        #this means test must have passed
        LOGGER.info("tearing down configured subarray (READY)")
        take_subarray(1).and_end_sb_when_ready()
        LOGGER.info("End is invoked on Subarray 1")
        # subarray.deallocate() #TODO: Once the OET latest charts are available this can be reverted
        tmc.release_resources()
        LOGGER.info("ReleaseResources is invoked on Subarray 1")
    if (resource('ska_low/tm_subarray_node/1').get('obsState') == "CONFIGURING"
        ):
        LOGGER.warn(
            "Subarray is still in configuring! Please restart MVP manualy to complete tear down"
        )
        restart_subarray_low(1)
        #raise exception since we are unable to continue with tear down
        raise Exception("Unable to tear down test setup")
    LOGGER.info("Put Telescope back to standby")
    set_telescope_to_standby()
    LOGGER.info("Telescope is in standby")
コード例 #2
0
def end(result):
    """ teardown any state that was previously setup for the tests.

    Args:
        result (dict): fixture to track test state
    """
    subarray = SubArray(1)
    obsstate = resource(result[SUBARRAY_USED]).get('obsState')
    if obsstate == "IDLE":
        LOGGER.info("CLEANUP: tearing down composed subarray (IDLE)")
        subarray.deallocate()
    if obsstate == "READY":
        LOGGER.info("CLEANUP: tearing down configured subarray (READY)")
        subarray.end()
        subarray.deallocate()
    if obsstate in ["RESOURCING", "CONFIGURING", "SCANNING"]:
        LOGGER.warning(
            "Subarray is still in %s Please restart MVP manually to complete tear down",
            obsstate)
        subarray.restart()
        # raise exception since we are unable to continue with tear down
        raise Exception("Unable to tear down test setup")
    if not telescope_is_in_standby():
        set_telescope_to_standby()
    LOGGER.info("CLEANUP: Sub-array is in %s ",
                resource(result[SUBARRAY_USED]).get('obsState'))
コード例 #3
0
def end(result):
    """ teardown any state that was previously setup with a setup_function
    call.
    """
    subarray = SubArray(1)
    obsstate = resource(result[SUBARRAY_USED]).get('obsState')
    if obsstate == "IDLE":
        LOGGER.info("CLEANUP: tearing down composed subarray (IDLE)")
        subarray.deallocate()
    set_telescope_to_standby()
コード例 #4
0
def set_telescope_in_off_state(result):
    """
    Set telescope to OFF state (stand-by) if it is not yet OFF.
    """
    LOGGER.info("Set telescope to stand-by")
    if not telescope_is_in_standby():
        set_telescope_to_standby()
    telescope_state = resource(result[CENTRAL_NODE_USED]).get('State')
    assert telescope_state == 'OFF', \
        f"Expected telescope to be OFF but instead was {telescope_state}"
    LOGGER.info("Telescope is in OFF state")
コード例 #5
0
ファイル: test_XTP-1567.py プロジェクト: ska-telescope/skampi
def teardown_function(function):
    """ teardown any state that was previously setup with a setup_function
    call.
    """
    if (resource('ska_low/tm_subarray_node/1').get('State') == "ON"):
        if (resource('ska_low/tm_subarray_node/1').get('obsState') == "IDLE"):
            LOGGER.info("tearing down composed subarray (IDLE)")
            # subarray.deallocate() #TODO: Once the OET latest charts are available this can be reverted
            tmc.release_resources()
            LOGGER.info('Invoked ReleaseResources on Subarray')
            wait_before_test(timeout=10)
        if (resource('ska_low/tm_subarray_node/1').get('obsState') == "READY"):
            LOGGER.info("tearing down configured subarray (READY)")
            # subarray.end()
            take_subarray(1).and_end_sb_when_ready()
            resource('ska_low/tm_subarray_node/1').assert_attribute('obsState').equals('IDLE')
            LOGGER.info('Invoked End on Subarray')
            wait_before_test(timeout=10)
            # subarray.deallocate() #TODO: Once the OET latest charts are available this can be reverted
            tmc.release_resources()
            LOGGER.info('Invoked ReleaseResources on Subarray')
            wait_before_test(timeout=10)
        if (resource('ska_low/tm_subarray_node/1').get('obsState') == "CONFIGURING"):
            LOGGER.warn("Subarray is still in CONFIFURING! Please restart MVP manualy to complete tear down")
            restart_subarray_low(1)
            #raise exception since we are unable to continue with tear down
            raise Exception("Unable to tear down test setup")
        if (resource('ska_low/tm_subarray_node/1').get('obsState') == "SCANNING"):
            LOGGER.warn("Subarray is still in SCANNING! Please restart MVP manualy to complete tear down")
            restart_subarray_low(1)
            #raise exception since we are unable to continue with tear down
            raise Exception("Unable to tear down test setup")
        if (resource('ska_low/tm_subarray_node/1').get('obsState') == "ABORTING"):
            LOGGER.warn("Subarray is still in ABORTING! Please restart MVP Low manualy to complete tear down")
            restart_subarray_low(1)
            #raise exception since we are unable to continue with tear down
            raise Exception("Unable to tear down test setup")
        if(resource('ska_low/tm_subarray_node/1').get('obsState') == "ABORTED"):
            LOGGER.info("tearing down configured subarray (ABORTED)")
            take_subarray(1).reset_when_aborted()
            LOGGER.info('Invoked ObsReset on Subarray')
            wait_before_test(timeout=10)
            # subarray.deallocate() #TODO: Once the OET latest charts are available this can be reverted
            tmc.release_resources()
            LOGGER.info('Invoked ReleaseResources on Subarray')
            wait_before_test(timeout=10)
        if (resource('ska_low/tm_subarray_node/1').get('obsState') == "RESETTING"):
            LOGGER.warn("Subarray is still in RESTARTING! Please restart MVP manualy to complete tear down")
            restart_subarray_low(1)
            #raise exception since we are unable to continue with tear down
            raise Exception("Unable to tear down test setup") 
        set_telescope_to_standby()
        LOGGER.info("Telescope is in standBy")
コード例 #6
0
ファイル: test_XTP-1207.py プロジェクト: ska-telescope/skampi
def teardown_function(function):
    """ teardown any state that was previously setup with a setup_function
    call.
    """
    if (resource('ska_low/tm_subarray_node/1').get("obsState") == "IDLE"):
        LOGGER.info("Release all resources assigned to subarray")
        # subarray = SubArray(1)
        # subarray.deallocate() #TODO: Once the OET latest charts are available this can be reverted
        tmc.release_resources()
        LOGGER.info("ResourceIdList is empty for Subarray 1 ")
    LOGGER.info("Put Telescope back to standby")
    set_telescope_to_standby()
    LOGGER.info("Telescope is in standby")
コード例 #7
0
def end():
    """ teardown any state that was previously setup with a setup_function
    call.
    """
    if not telescope_is_in_standby():
        set_telescope_to_standby()