Пример #1
0
def imported_domain(appliance, branch):
    repo = AutomateGitRepository(url=GIT_REPO_URL,
                                 verify_ssl=False,
                                 appliance=appliance)
    domain = repo.import_domain_from(branch=branch)
    yield domain
    domain.delete_if_exists()
def test_automate_git_import_multiple_domains(request, appliance):
    """
    Importing of multiple domains from a single git repository is not allowed.

    Polarion:
        assignee: ghubale
        initialEstimate: 1/12h
        caseimportance: medium
        caseposneg: negative
        testtype: functional
        startsin: 5.10
        casecomponent: Automate
        tags: automate
        title: Test automate git import multiple domains
        testSteps:
            1. Enable server role: git Repositories Owner
            2. Navigate to Automation > Automate > Import/Export
            3. Import multiple domains from a single git repository
        expectedResults:
            1.
            2.
            3. Import of multiple domains from a single git repo is not allowed
    """
    url = "https://github.com/ganeshhubale/ManageIQ-automate-git"
    repo = AutomateGitRepository(url=url, verify_ssl=True, appliance=appliance)
    with pytest.raises(ValueError):
        domain = repo.import_domain_from(branch="origin/master")
        request.addfinalizer(domain.delete_if_exists)
        assert not domain.exists
def test_domain_import_git(
    request, appliance, url, param_type, param_value, verify_ssl
):
    """This test case Verifies that a domain can be imported from git and Importing domain from git
       should work with or without the top level domain directory.

    Polarion:
        assignee: ghubale
        initialEstimate: 1/6h
        caseimportance: medium
        caseposneg: positive
        testtype: functional
        startsin: 5.7
        casecomponent: Automate
        tags: automate
        title: Test automate git domain import top level directory
        testSteps:
            1. Enable server role: git Repositories Owner
            2. Navigate to Automation > Automate > Import/Export
            3. Create a Git Repository with the contents of a domain directory without including
               the domain directory.
        expectedResults:
            1.
            2.
            3. Import should work with or without the top level domain directory.

    Bugzilla:
        1389823
    """
    repo = AutomateGitRepository(url=url, verify_ssl=verify_ssl, appliance=appliance)
    domain = repo.import_domain_from(**{param_type: param_value})
    request.addfinalizer(domain.delete)
    assert domain.exists
Пример #4
0
def test_domain_import_git(request, appliance, url, param_type, param_value, verify_ssl):
    """Verifies that a domain can be imported from git."""
    repo = AutomateGitRepository(url=url, verify_ssl=verify_ssl, appliance=appliance)
    domain = repo.import_domain_from(**{param_type: param_value})
    request.addfinalizer(domain.delete_if_exists)
    assert domain.exists
    domain.delete()
Пример #5
0
def imported_domain(appliance, branch):
    repo = AutomateGitRepository(
        url=GIT_REPO_URL,
        verify_ssl=False,
        appliance=appliance
    )
    domain = repo.import_domain_from(branch=branch)
    yield domain
    domain.delete_if_exists()
Пример #6
0
def test_domain_import_git(request, appliance, url, param_type, param_value,
                           verify_ssl):
    """Verifies that a domain can be imported from git."""
    repo = AutomateGitRepository(url=url,
                                 verify_ssl=verify_ssl,
                                 appliance=appliance)
    domain = repo.import_domain_from(**{param_type: param_value})
    request.addfinalizer(domain.delete_if_exists)
    assert domain.exists
    domain.delete()
Пример #7
0
def test_domain_import_git(request, appliance, url, param_type, param_value, verify_ssl):
    """Verifies that a domain can be imported from git.

    Polarion:
        assignee: dmisharo
        casecomponent: Automate
        initialEstimate: 1/20h
    """
    repo = AutomateGitRepository(url=url, verify_ssl=verify_ssl, appliance=appliance)
    domain = repo.import_domain_from(**{param_type: param_value})
    request.addfinalizer(domain.delete_if_exists)
    assert domain.exists
    domain.delete()
Пример #8
0
 def all(self):
     table = self.appliance.db.client['miq_ae_namespaces']
     query = self.appliance.db.client.session.query(
         table.name, table.description, table.enabled, table.source,
         table.ref, table.ref_type, table.git_repository_id)
     query = query.filter(table.name != '$',
                          table.parent_id == None)  # noqa
     result = []
     for name, description, enabled, source, ref, ref_type, git_repository_id in query:
         if source != 'remote':
             result.append(
                 self.instantiate(name=name,
                                  description=description or '',
                                  enabled=enabled,
                                  locked=source
                                  in {'user_locked', 'system'}))
         else:
             repo_table = self.appliance.db.client['git_repositories']
             repo = self.appliance.db.client.session\
                 .query(repo_table)\
                 .filter(repo_table.id == git_repository_id)\
                 .first()
             from cfme.automate.import_export import AutomateGitRepository
             agr = AutomateGitRepository(url=repo.url,
                                         verify_ssl=repo.verify_ssl,
                                         appliance=self.appliance)
             result.append(
                 self.instantiate(name=name,
                                  description=description,
                                  enabled=enabled,
                                  locked=True,
                                  git_repository=agr,
                                  git_checkout_type=ref_type,
                                  git_checkout_value=ref))
     return result
Пример #9
0
 def git_repository(self):
     """Returns an associated git repository object. None if no git repo associated."""
     dbo = self.db_object
     if dbo.git_repository_id is None:
         return None
     from cfme.automate.import_export import AutomateGitRepository
     return AutomateGitRepository.from_db(dbo.git_repository_id, appliance=self.appliance)
Пример #10
0
 def git_repository(self):
     """Returns an associated git repository object. None if no git repo associated."""
     dbo = self.db_object
     if dbo.git_repository_id is None:
         return None
     from cfme.automate.import_export import AutomateGitRepository
     return AutomateGitRepository.from_db(dbo.git_repository_id, appliance=self.appliance)
Пример #11
0
def test_domain_import_git(request, appliance, url, param_type, param_value,
                           verify_ssl):
    """Verifies that a domain can be imported from git.

    Polarion:
        assignee: dmisharo
        casecomponent: automate
        initialEstimate: 1/20h
    """
    repo = AutomateGitRepository(url=url,
                                 verify_ssl=verify_ssl,
                                 appliance=appliance)
    domain = repo.import_domain_from(**{param_type: param_value})
    request.addfinalizer(domain.delete_if_exists)
    assert domain.exists
    domain.delete()