def test_try_to_push_same_application_twice(self, context, sample_cli_app, tap_cli):
        """
        <b>Description:</b>
        Push sample application and wait until it state is running. Then try to push same application again.

        <b>Input data:</b>
        1. Sample application

        <b>Expected results:</b>
        Test passes when application is pushed and is in running state and trying to push same application again causes
        an error.

        <b>Steps:</b>
        1. Push application.
        2. Verify that application is present in applications list.
        3. Check that application is running.
        4. Check that application is ready.
        5. Try to push same application again.
        """
        step("Try to push same application again")
        assert_raises_command_execution_exception(1, TapMessage.APPLICATION_ALREADY_EXISTS,
                                                  CliApplication.push,
                                                  context, tap_cli=tap_cli,
                                                  app_type=sample_cli_app.app_type,
                                                  app_path=sample_cli_app.target_directory,
                                                  name=sample_cli_app.name,
                                                  instances=sample_cli_app.instances)
    def test_delete_invitation_and_resend(self, tap_cli, invitation):
        """
        <b>Description:</b>
        Delete pending invitation and resend.

        <b>Input data:</b>
        1. Invitation.

        <b>Expected results:</b>
        Invitation is successfully deleted
        and re-invitation returns error message.

        <b>Steps:</b>
        1. Delete invitation.
        2. Re-invite user.
        3. Check exception message.
        """
        step("Deleting invitation...")
        invitation.delete()
        expected_code = 1
        expected_message_scheme = \
            TapMessage.MSG_RESEND_NOT_EXIST_INVITATION
        expected_message = expected_message_scheme.format(invitation.username)
        step("Ensuring legitimate response has been returned")
        assert_raises_command_execution_exception(expected_code,
                                                  expected_message,
                                                  tap_cli.reinvite,
                                                  username=invitation.username)
    def test_try_push_app_with_invalid_manifest(self, class_context, tap_cli, sample_app_target_directory):
        """
        <b>Description:</b>
        Try to push an application with invalid manifest.

        <b>Input data:</b>
        1. Sample application with invalid manifest.json

        <b>Expected results:</b>
        Test passes when attempt to push application with invalid app name in manifest.json returns proper message.

        <b>Steps:</b>
        1. Prepare directory with sample application.
        2. Update manifest.json with invalid app name.
        3. Try to push application with wrong manifest.json.
        """
        step("prepare directory with sample application")
        p_a = PrepApp(sample_app_target_directory)
        step("update manifest.json to contain improper app name")
        manifest_params = {"name": self.INVALID_APP_NAME, "type": self.APP_TYPE}
        p_a.update_manifest(params=manifest_params)
        assert_raises_command_execution_exception(1, TapMessage.MANIFEST_JSON_INCORRECT_NAME_VALUE.format(self.INVALID_APP_NAME),
                                                  CliApplication.push,
                                                  class_context, tap_cli=tap_cli,
                                                  app_type=self.APP_TYPE,
                                                  app_path=p_a.app_path,
                                                  name=p_a.app_name,
                                                  instances=p_a.instances)
Пример #4
0
    def test_cannot_login_with_empty_parameter(self, test_case,
                                               empty_parameter_test_cases,
                                               tap_cli):
        """
        <b>Description:</b>
        Check that TAP CLI will fail to login with any of the following parameters empty: api, username, password.

        <b>Input data:</b>
        1. Command name: login
        2. any of --api, --username, --pasword parameters empty

        <b>Expected results:</b>
        Test passes when TAP CLI reports "Incorrect Usage"

        <b>Steps:</b>
        1. Run TAP CLI with command login with:
            a) --api
            b) --username
            c) --pasword
            parameter empty value
        2. Verify "Incorrect Usage" raported
        """
        step("Check that user will not be logged in with missing " +
             empty_parameter_test_cases[test_case]["parameter"] +
             " parameter value")
        assert_raises_command_execution_exception(
            1, TapMessage.INCORRECT_USAGE, tap_cli._run_command,
            empty_parameter_test_cases[test_case]["command"])
    def test_user_login_with_old_passwd(self, tap_cli, current_username,
                                        current_password):
        """
        <b>Description:</b>
        Changes password and login with old password.

        <b>Input data:</b>
        1. New password

        <b>Expected results:</b>
        Authentication failed.

        <b>Steps:</b>
        1. Change password.
        2. Logout.
        3. Login again with old password.
        """
        new_passwd = 'NewSecurePassword'
        step("Changing password...")
        tap_cli.change_password(current=current_password, new=new_passwd)
        old_passwd = current_password
        step("New user logs in with old password...")
        assert_raises_command_execution_exception(
            1,
            TapMessage.AUTHENTICATION_FAILED,
            tap_cli.login,
            tap_auth=[current_username, old_passwd])
Пример #6
0
    def test_cannot_create_service_instance_with_invalid_name(
            self, offering, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to create service instance with invalid name will return proper information.

        <b>Input data:</b>
        1. Command name: service create
        2. Service offering

        <b>Expected results:</b>
        Attempt to create service without name will return proper information.

        <b>Steps:</b>
        1. Run TAP CLI with command.
        1. Verify that attempt to create service with invalid name returns expected message.
        """
        invalid_name = "INVALID_NAME"
        expected_message = TapMessage.NAME_HAS_INCORRECT_VALUE.format(
            invalid_name)
        step("Check error message when creating instance with invalid name")
        assert_raises_command_execution_exception(
            1, expected_message, tap_cli.create_service, [
                "--name", invalid_name, "--offering", offering.label, "--plan",
                offering.service_plans[0].name
            ])
        assert_not_in_with_retry(invalid_name, tap_cli.service_list)
Пример #7
0
    def test_cannot_create_service_instance_with_invalid_plan(
            self, tap_cli, offering):
        """
        <b>Description:</b>
        Check that attempt to create service instance with invalid plan will return proper information.

        <b>Input data:</b>
        1. Command name: service create
        2. Service offering

        <b>Expected results:</b>
        Attempt to create service with invalid plan will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command create-service.
        2. Verify that attempt to create service with invalid plan return expected message.
        """
        step("Check error message when creating instance with invalid plan")
        expected_msg = TapMessage.CANNOT_FIND_PLAN_FOR_SERVICE.format(
            self.INVALID_SERVICE_PLAN, offering.label)
        assert_raises_command_execution_exception(
            1, expected_msg, tap_cli.create_service, [
                "--offering", offering.label, "--plan",
                self.INVALID_SERVICE_PLAN, "--name", 'test1'
            ])
Пример #8
0
    def test_cannot_create_service_instance_for_non_existing_offering(
            self, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to create service instance of non existing offering will return proper information.

        <b>Input data:</b>
        1. Command name: service create
        2. Non existing offering name

        <b>Expected results:</b>
        Attempt to create service instance of non existing offering will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command create-service.
        2. Verify that attempt to create service of non existing offering return expected message.
        """
        step(
            "Check error message when creating instance for non existing offering"
        )
        assert_raises_command_execution_exception(
            1,
            TapMessage.CANNOT_FIND_SERVICE.format(self.INVALID_SERVICE_NAME),
            tap_cli.create_service, [
                "--offering", self.INVALID_SERVICE_NAME, "--plan", 'free',
                "--name", 'test1'
            ])
Пример #9
0
    def test_cannot_get_non_existing_service_instance_info(self, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to get non existing service info returns legitimate response.

        <b>Input data:</b>
        1. Command name: service info
        2. Service name

        <b>Expected results:</b>
        Attempt to get info about non existing service returns proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command service info --name non-existing-service-name.
        2. Verify that attempt to get non existing service info returns legitimate response.
        """
        non_existing_name = ''.join(
            random.SystemRandom().choice(string.ascii_uppercase +
                                         string.digits) for _ in range(20))
        expected_message = TapMessage.CANNOT_FIND_INSTANCE_WITH_NAME.format(
            non_existing_name)
        step("Check error message when getting non existing service info")
        assert_raises_command_execution_exception(
            1,
            expected_message,
            tap_cli.get_service,
            service_name=non_existing_name)
    def test_no_manifest(self, class_context, tap_cli, sample_app_target_directory):
        """
        <b>Description:</b>
        Try to push an application, but don't provide the manifest.

        <b>Input data:</b>
        1. Sample application without manifest.json

        <b>Expected results:</b>
        Test passes when attempt to push application without providing manifest.json returns proper message.

        <b>Steps:</b>
        1. Prepare directory with sample application.
        2. Remove manifest.json from prepared directory.
        3. Try to push application.
        """
        app_name = "app-test-name"
        step("prepare directory with sample application")
        p_a = PrepApp(sample_app_target_directory)
        step("remove manifest.json from prepared directory")
        manifest_path = os.path.join(sample_app_target_directory, p_a.MANIFEST_NAME)
        os.remove(manifest_path)
        step("try to push application")
        assert_raises_command_execution_exception(1, TapMessage.CANNOT_FIND_MANIFEST,
                                                  CliApplication.push,
                                                  class_context, tap_cli=tap_cli,
                                                  app_type=self.APP_TYPE,
                                                  app_path=p_a.app_path,
                                                  name=app_name,
                                                  instances=p_a.instances)
    def test_cannot_unbind_services_with_dst_and_src_params(self, class_context, service_instance_1,
                                                            service_instance_2, tap_cli):
        """
        <b>Description:</b>
        Check that service instance can be unbound from other service instance with both dst and src params set.

        <b>Input data:</b>
        1. Service instance to bind to
        2. Second service instance that will be bind

        <b>Expected results:</b>
        Service instances cannot be unbind.

        <b>Steps:</b>
        1. Bind one service instance to another.
        2. Check that services are bound.
        3. Try to unbind one service instance from another with both dst and src params set.
        4. Check that error with proper message will be thrown.
        """
        step("bind one service instance to another")
        binding = CliBinding.create(context=class_context, type=TapCli.SERVICE, tap_cli=tap_cli,
                                    name=service_instance_1.name, dst_name=service_instance_2.name)
        step("check that services are bound")
        binding.ensure_on_bindings_list()
        service_instance_2.ensure_service_state(TapEntityState.RUNNING)
        cmd = [tap_cli.NAME_PARAM, service_instance_1.name, tap_cli.SRC_NAME_PARAM, service_instance_1.name,
               tap_cli.DST_NAME_PARAM, service_instance_2.name]
        step('try to unbind one service instance from another with both dst and src params set')
        step('check that error with proper message will be thrown')
        assert_raises_command_execution_exception(8, TapMessage.CANNOT_BIND_UNBIND_INSTANCES_WITH_BOTH_DST_AND_SRC_FLAGS_SET,
                                                  tap_cli.unbind,
                                                  instance_type=TapCli.SERVICE,
                                                  cmd=cmd)
    def test_cannot_get_offering_when_doesnt_exist(self, context, tap_cli):
        """
        <b>Description:</b>
        Check that offering details can't be printed when it doesn't exist.

        <b>Input data:</b>
        1. Command name: offering info

        <b>Expected results:</b>
        Test passes when offering is not printable.

        <b>Steps:</b>
        Verify that unexisting offering cannot be displyed (proper message shown)
        """
        assert_raises_command_execution_exception(1, TapMessage.NO_SUCH_OFFERING,
                                                  tap_cli.print_offering, "unexisting")
    def test_cli_attempt_to_create_offering_with_default_params(self, tap_cli):
        """
        <b>Description:</b>
        Check that CLI tries to create offering from manifest.json if path not provided

        <b>Input data:</b>
        1. Command name: offering create

        <b>Expected results:</b>
        Attempt to create offering without parameters will take manifest.json into account.

        <b>Steps:</b>
        1. Run TAP CLI with command offering create.
        2. Verify that attempt to create offering without parameters will try to use manifest.json file.
        """
        assert_raises_command_execution_exception(1, TapMessage.MANIFEST_JSON_NO_SUCH_FILE,
                                                  tap_cli.create_offering, "")
    def test_cannot_create_offering_without_json(self, tap_cli):
        """
        <b>Description:</b>
        Check that can't create offering without providing json for manifest flag.

        <b>Input data:</b>
        1. Command name: offering create

        <b>Expected results:</b>
        Attempt to create offering without json will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command offering create.
        2. Verify that attempt to create offering without json will return expected message.
        """
        invalid_json = generate_test_object_name(separator="-")
        assert_raises_command_execution_exception(1, TapMessage.NO_SUCH_FILE_OR_DIRECTORY.format(invalid_json),
                                                  tap_cli.create_offering, invalid_json)
    def test_cannot_delete_offering_with_existing_instance(self, tap_cli, service):
        """
        <b>Description:</b>
        Check that CLI cannot delete offering that has instance created

        <b>Input data:</b>
        1. Command name: offering delete

        <b>Expected results:</b>
        Attempt to delete offering with existing instance is forbidden. Explanation displayed.

        <b>Steps:</b>
        1. Make sure mysql instance is on platform.
        2. Try to delete mysql offering.
        3. Verify that attempt to delete offering will end up with proper message shown.
        """
        assert_raises_command_execution_exception(1, TapMessage.CANNOT_DELETE_OFFERING_WITH_INSTANCE,
                                                  tap_cli.delete_offering, service.offering_name)
    def test_try_start_non_existing_app(self, tap_cli):
        """
        <b>Description:</b>
        Try to start non existing application.

        <b>Input data:</b>
        1. Command name: application start --name <non_existing_name>
        2. Name of non existing application

        <b>Expected results:</b>
        Test passes when attempt to start non existing application returns proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command: application start --name <non_existing_name>.
        2. Verify that attempt to start non existing application return expected error message.
        """
        step("Try to start app with non existing name")
        assert_raises_command_execution_exception(1, self.CANNOT_FIND_MSG, tap_cli.app_start,
                                                  application_name=self.NON_EXISTING_APP_NAME)
    def test_cannot_create_offering_with_already_used_name(self, context, offering, tap_cli):
        """
        <b>Description:</b>
        Check that can't create offering with already used name.

        <b>Input data:</b>
        1. Command name: offering create
        2. Existing offering

        <b>Expected results:</b>
        Attempt to create offering with already used name will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command offering create.
        2. Verify that attempt to create offering with already used name will return expected message.
        """
        assert_raises_command_execution_exception(1, TapMessage.SERVICE_ALREADY_EXISTS.format(offering.name),
                                                  CliOffering.create, context=context, tap_cli=tap_cli,
                                                  name=offering.name, plans=offering.plans)
    def test_try_check_logs_for_non_existing_app(self, tap_cli):
        """
        <b>Description:</b>
        Try to retrieve logs of non existing application.

        <b>Input data:</b>
        1. Command name: application logs show --name <non_existing_name>
        2. Name of non existing application

        <b>Expected results:</b>
        Test passes when attempt to retrieve logs of non existing application returns proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command: application logs show --name <non_existing_name>.
        2. Verify that attempt to retrieve logs for non existing application return expected message.
        """
        step("Try to check logs for non existing app name")
        assert_raises_command_execution_exception(1, self.CANNOT_FIND_MSG, tap_cli.app_logs,
                                                  application_name=self.NON_EXISTING_APP_NAME)
Пример #19
0
    def test_cannot_delete_service_instance_in_running_state(
            self, tap_cli, service):
        """
        <b>Description:</b>
        Check that attempt to delete service in running state returns proper information.

        <b>Input data:</b>
        1. Service instance

        <b>Expected results:</b>
        Legitimate error message.

        <b>Steps:</b>
        1. Delete service.
        """
        step("Ensuring service is running ...")
        service.ensure_service_state(TapEntityState.RUNNING)
        step("Trying to delete a service")
        assert_raises_command_execution_exception(
            1, TapMessage.CANNOT_DELETE_RUNNING_APP, tap_cli.delete_service,
            ["--name", service.name])
    def test_cannot_unbind_service_from_invalid_service(self, tap_cli, service_instance_1, nonexistent_service):
        """
        <b>Description:</b>
        Check that attempt to unbind non existent service instance will return proper information.

        <b>Input data:</b>
        1. Non existent service instance to unbind from
        2. Service instance to unbind

        <b>Expected results:</b>
        Attempt to unbind non existent instances will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command unbind.
        2. Verify that attempt unbind from non existent service instance return expected message.
        """
        step("Check that attempt to unbind from invalid service instance will return error")
        expected_msg = TapMessage.CANNOT_FIND_INSTANCE_WITH_NAME.format(nonexistent_service.name)
        binding = CliBinding(tap_cli=tap_cli, type=TapCli.SERVICE,
                             name=service_instance_1.name, dst_name=nonexistent_service.name)
        assert_raises_command_execution_exception(1, expected_msg, binding.delete)
Пример #21
0
    def test_cannot_delete_non_existing_service(self, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to delete non existent service will return error.

        <b>Input data:</b>
        1. Command name: service delete

        <b>Expected results:</b>
        Attempt to delete non existent service will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command delete-service.
        2. Verify that attempt to delete non existent service return expected message.
        """
        step("Check error when deleting non-existing service")
        expected_msg = TapMessage.CANNOT_FIND_INSTANCE_WITH_NAME.format(
            self.INVALID_SERVICE_NAME)
        assert_raises_command_execution_exception(
            1, expected_msg, tap_cli.delete_service,
            ["--name", self.INVALID_SERVICE_NAME])
Пример #22
0
    def test_cannot_get_logs_for_non_existing_service(self, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to retrieve logs of non existent service will return proper information.

        <b>Input data:</b>
        1. Command name: service logs show

        <b>Expected results:</b>
        Attempt to retrieve logs of non existent service will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command logs.
        2. Verify that attempt to retrieve logs of non existent service return expected message.
        """
        step("Check error when getting logs for non-existing service")
        expected_msg = TapMessage.CANNOT_FIND_INSTANCE_WITH_NAME.format(
            self.INVALID_SERVICE_NAME)
        assert_raises_command_execution_exception(1, expected_msg,
                                                  tap_cli.service_log,
                                                  self.INVALID_SERVICE_NAME)
    def test_try_to_delete_app_in_running_state(self, sample_cli_app):
        """
        <b>Description:</b>
        Push sample application and wait until it state is running. Then try to delete application in RUNNING state.

        <b>Input data:</b>
        1. Sample application

        <b>Expected results:</b>
        Test passes when trying to delete application in RUNNING state causes an error.

        <b>Steps:</b>
        1. Push application.
        2. Verify that application is present in applications list.
        3. Check that application is running.
        4. Check that application is ready.
        5. Try to delete application.
        """
        step("Try to delete application in running state")
        assert_raises_command_execution_exception(1, TapMessage.CANNOT_DELETE_APPLICATION_IN_RUNNING_STATE,
                                                  sample_cli_app.delete)
Пример #24
0
    def test_cannot_delete_service_without_providing_all_required_arguments(
            self, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to delete service without providing all required arguments will return proper information.

        <b>Input data:</b>
        1. Command name: service delete

        <b>Expected results:</b>
        Attempt to delete service without providing all required arguments will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command delete-service.
        2. Verify that attempt to delete service without providing all required arguments return expected message.
        """
        step(
            "Check error message when deleting instance without instance name")
        assert_raises_command_execution_exception(3,
                                                  TapMessage.MISSING_PARAMETER,
                                                  tap_cli.delete_service, [])
Пример #25
0
    def test_cannot_create_service_instance_without_plan(
            self, offering, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to create service instance without plan will return proper information.

        <b>Input data:</b>
        1. Command name: service create
        2. Service offering

        <b>Expected results:</b>
        Attempt to create service without plan will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command create-service.
        2. Verify that attempt to create service without plan return expected message.
        """
        step("Check error message when creating instance without plan name")
        assert_raises_command_execution_exception(
            3, TapMessage.MISSING_PARAMETER, tap_cli.create_service,
            ["--offering", offering.label, "--name", "test"])
Пример #26
0
    def test_cannot_get_service_credentials_without_name(self, tap_cli):
        """
        <b>Description:</b>
        Check that attempt to get service credentials service without providing service name will return proper information.

        <b>Input data:</b>
        1. Command name: service credentials show

        <b>Expected results:</b>
        Attempt to get service credentials service without providing service name will return proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command service credentials show.
        2. Verify that attempt to get service credentials service without providing service name will return proper message.
        """
        step(
            "Check error message when getting service credentialswithout instance name"
        )
        assert_raises_command_execution_exception(3,
                                                  TapMessage.MISSING_PARAMETER,
                                                  tap_cli.service_credentials,
                                                  [])
    def test_try_scale_non_existing_app(self, tap_cli):
        """
        <b>Description:</b>
        Try to scale non existing application.

        <b>Input data:</b>
        1. Command scale: application scale --name <non_existing_name> --replicas <number_of_replicas>
        2. Name of non existing application
        3. Number of replicas

        <b>Expected results:</b>
        Test passes when attempt to scale non existing application returns proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command: application scale --name <non_existing_name> --replicas <number_of_replicas>.
        2. Verify that attempt to scale non existing application return expected error message.
        """
        scaled_instances = '3'
        step("Try to scale app with non existing name")
        assert_raises_command_execution_exception(1, self.CANNOT_FIND_MSG, tap_cli.app_scale,
                                                  application_name=self.NON_EXISTING_APP_NAME,
                                                  instances=scaled_instances)
Пример #28
0
    def test_cannot_login_with_incorrect_domain(self, tap_cli, restore_login):
        """
        <b>Description:</b>
        Check that TAP CLI can't login with incorrect domain and corresponding information is shown.

        <b>Input data:</b>
        1. Command name: login
        2. Incorrect TAP domain address

        <b>Expected results:</b>
        Test passes when TAP CLI login with incorrect TAP domain returns proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command login.
        2. Verify that TAP CLI command login with incorrect domain returns expected message.
        """
        step("Check that user cannot login to tap cli using incorrect domain")
        assert_raises_command_execution_exception(
            1,
            TapMessage.DOMAIN_NOT_FOUND,
            tap_cli.login,
            login_domain=self.INCORRECT_DOMAIN)
Пример #29
0
    def test_cannot_login_with_foreign_domain(self, tap_cli, restore_login):
        """
        <b>Description:</b>
        Check that TAP CLI can't login to foreign domain and corresponding information is shown.

        <b>Input data:</b>
        1. Command name: login
        2. Foreign domain address

        <b>Expected results:</b>
        Test passes when TAP CLI login with foreign domain returns proper message.

        <b>Steps:</b>
        1. Run TAP CLI with command login.
        2. Verify that TAP command login with foreign domain returns expected message.
        """
        step("Check that user cannot login to tap cli using foreign domain")
        assert_raises_command_execution_exception(
            1,
            TapMessage.CANNOT_REACH_API,
            tap_cli.login,
            login_domain=self.FOREIGN_DOMAIN)
    def test_cannot_delete_bound_service(self, class_context, tap_cli, service_instance_1, service_instance_2):
        """
        <b>Description:</b>
        Check that an attempt to delete bound service instance fails with an error and instance won't be removed.

        <b>Input data:</b>
        1. Service instance to unbind from
        2. Service instance to unbind

        <b>Expected results:</b>
        Attempt to delete bounded instance will return proper message and not delete service.

        <b>Steps:</b>
        1. Bind second service to first one.
        2. Check that second service is on first service binding list.
        3. Verify that attempt to delete bounded service instance return expected message.
        4. Check that second service is shown on services list.
        5. Check that second service is shown on first service binding list
        """
        step("Bind service instances")

        binding = CliBinding.create(context=class_context, type=TapCli.SERVICE, tap_cli=tap_cli,
                                    name=service_instance_2.name, dst_name=service_instance_1.name)
        binding.ensure_on_bindings_list()
        step("Check that an attempt to delete bound service instance fails with an error")
        expected_msg = TapMessage.INSTANCE_IS_BOUND_TO_OTHER_INSTANCE.format(service_instance_2.name,
                                                                             service_instance_1.name,
                                                                             service_instance_1.id)
        assert_raises_command_execution_exception(1, expected_msg, service_instance_2.delete)
        step("Check that the service still exists")
        service_instance_2.ensure_on_service_list()
        step("Check that the services are still bound")
        binding.ensure_on_bindings_list()

        step("Get rid of binding")
        binding.delete()
        binding.ensure_not_on_bindings_list()
        service_instance_1.ensure_service_state(TapEntityState.RUNNING)