Example #1
0
    def check_delayed_activation(self, activationTime, activationType):
        active = Active()
        active.unrouteAll()
        preActivationState = active.buildJSONObject()

        outputList = getOutputList()
        testRouteAction = outputList[0].findAcceptableTestRoute()
        activation = Activation()
        activation.addAction(testRouteAction)
        activation.type = activationType
        activation.activationTimestamp = activationTime
        try:
            activation.fireActivation()
        except NMOSTestException as e:
            time.sleep(2)
            raise e

        pendingState = active.buildJSONObject()
        if not compare_json(preActivationState, pendingState):
            msg = globalConfig.test.FAIL("Scheduled Activation completed immediately")
            raise NMOSTestException(msg)

        time.sleep(2)

        active.assertActionCompleted(testRouteAction, retries=5)

        time.sleep(1)
Example #2
0
    def test_06_locking_response(self, test):
        """Attempting to change a locked route results in a 423 response"""
        globalConfig.test = test

        outputList = getOutputList()
        testRouteAction = outputList[0].findAcceptableTestRoute()
        activation = Activation()
        activation.addAction(testRouteAction)
        activation.type = SCHEDULED_RELATIVE_ACTIVATION
        activation.activationTimestamp = "5:0"
        activation.fireActivation()
        activation.checkLock()

        return test.PASS()
Example #3
0
    def test_05_delete_activations(self, test):
        """Activations can be deleted once created"""
        globalConfig.test = test

        Active().unrouteAll()
        outputList = getOutputList()
        testRouteAction = outputList[0].findAcceptableTestRoute()
        activation = Activation()
        activation.addAction(testRouteAction)
        activation.type = SCHEDULED_RELATIVE_ACTIVATION
        activation.activationTimestamp = "2:0"
        try:
            activation.fireActivation()
        except NMOSTestException as e:
            time.sleep(2)
            raise e

        time.sleep(1)

        activation.delete()

        return test.PASS()