Commit a4a64e23 authored by Marco Buttu's avatar Marco Buttu
Browse files

In PF the setup does not turn AS conf and elevation tracking ON

The setup() turns the ASConfiguration and elevation tracking ON
only when the SRP is active
parent 11db5897
Loading
Loading
Loading
Loading
+11 −2
Changes for SRT/Servers/SRTMinorServo/src/MinorServoBossImpl.cpp: 11 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -339,11 +339,18 @@ void MinorServoBossImpl::setup(const char *config) throw (CORBA::SystemException

void MinorServoBossImpl::setupImpl(const char *config) throw (ManagementErrors::ConfigurationErrorExImpl)
{

    try {
        if(!m_configuration->isElevationTrackingEn())
        if(!endswith(string(config), "P")) {
            if(!m_configuration->isElevationTrackingEn()) {
                setElevationTrackingImpl(IRA::CString("ON"));
            }
        }
        else {
            if(m_configuration->isElevationTrackingEn()) {
                turnTrackingOff();
            }
        }
    }
    catch(...) {
        THROW_EX(ManagementErrors, ConfigurationErrorEx, "cannot turn the tracking on", false);
    }
@@ -354,7 +361,9 @@ void MinorServoBossImpl::setupImpl(const char *config) throw (ManagementErrors::
    if(m_configuration->isParking())
        THROW_EX(ManagementErrors, ConfigurationErrorEx, "The system is executing a park", false);

    if(!endswith(string(config), "P")) {
        m_configuration->setASConfiguration(IRA::CString("ON"));
    }
    m_configuration->init(string(config));  // Throw (ComponentErrors::CDBAccessExImpl);

    try {
+1 −1
Changes for SRT/Servers/SRTMinorServo/src/ParkThread.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ void ParkThread::run()
                }
            }
            catch(...) {
                ACS_SHORT_LOG((LM_ERROR, ("ParkThread: cannot disable "  + comp_name).c_str()));
                ACS_SHORT_LOG((LM_ERROR, ("ParkThread: unexpected error, cannot disable "  + comp_name).c_str()));
            }
        }
        else {
+29 −0
Changes for SRT/Servers/SRTMinorServo/test/functional/test_setup.py: 29 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ class SetupTest(unittest2.TestCase):
        cls.client.releaseComponent('MINORSERVO/Boss')
        cls.client.disconnect()

    def tearDown(self):
        self.boss.park()
        self.wait_until_not_ready()

    def test_elevation_tracking_ON(self):
        """The setup turns the elevation tracking on"""
        self.boss.setup('KKG')
@@ -44,19 +48,44 @@ class SetupTest(unittest2.TestCase):
        self.wait_until_ready()
        self.assertEqual(self.boss.getActualSetup(), 'KKG_ASACTIVE')

    def test_do_not_turn_PF_elevation_tracking_ON(self):
        """In the Primary Focus, do not turn the elevation tracking on"""
        self.boss.setup('LLP')
        self.wait_until_ready()
        self.assertFalse(self.boss.isElevationTrackingEn())

    def test_do_not_turn_PF_as_configuration_ON(self):
        """In the Primary Focus, do not turn the AS configuration on"""
        self.boss.setup('LLP')
        self.wait_until_ready()
        self.assertEqual(self.boss.getActualSetup(), 'LLP')

    def test_actual_setup_unknown(self):
        self.boss.setup('KKG')
        self.wait_until_ready()
        self.boss.setup('KKG')
        self.assertEqual(self.boss.getActualSetup(), 'unknown')
        self.wait_until_ready() # Becase the tearDown() executes a park

    def wait_until_ready(self, timeout=240):
        time.sleep(0.5)
        t0 = datetime.now()
        while not self.boss.isReady():
            if (datetime.now() - t0).seconds > timeout:
                assert False, 'The minor servo boss is not ready'
            else:
                time.sleep(1)
        time.sleep(0.5)

    def wait_until_not_ready(self, timeout=240):
        time.sleep(0.5)
        t0 = datetime.now()
        while self.boss.isReady():
            if (datetime.now() - t0).seconds > timeout:
                assert False, 'The minor servo boss is not parked'
            else:
                time.sleep(1)
        time.sleep(0.5)


if __name__ == '__main__':