def be_0001_add_and_remove_backend_test():
        """
        Create an ALBA backend and verify its status
        Validate services, etcd, arakoon without claiming disks
        Claim some disks and validate whether backend can be used for storing objects in namespaces
        """
        backend = GeneralBackend.get_by_name(TestALBA.backend_name)
        if backend is not None:
            raise ValueError('A backend has already been deployed, cannot execute test')

        alba_backend = GeneralAlba.add_alba_backend(TestALBA.backend_name)
        GeneralAlba.validate_alba_backend_sanity_without_claimed_disks(alba_backend=alba_backend)

        GeneralAlba.claim_asds(alba_backend, 3, 'SATA')
        GeneralAlba.validate_alba_backend_sanity_with_claimed_disks(alba_backend=alba_backend)

        guid = alba_backend.guid
        name = TestALBA.backend_name
        service_names = GeneralAlba.get_maintenance_services_for_alba_backend(alba_backend=alba_backend)

        GeneralAlba.unclaim_disks(alba_backend)
        GeneralAlba.remove_alba_backend(alba_backend)
        GeneralAlba.validate_alba_backend_removal(alba_backend_info={'name': name,
                                                                     'guid': guid,
                                                                     'maintenance_service_names': service_names})
def teardown():
    """
    Teardown for Backend package, will be executed when all started tests in this package have ended
    Removal actions of possible things left over after the test-run
    :return: None
    """
    alba_backend = GeneralAlba.get_by_name(General.get_config().get('backend', 'name'))
    if alba_backend is not None:
        GeneralAlba.unclaim_disks(alba_backend)
        GeneralAlba.remove_alba_backend(alba_backend)