コード例 #1
0
def ostree_repo_with_user(ostree_user_credentials):
    """Create an user, organization, product and ostree repo,
    sync ostree repo for particular user,
    create content view and publish it for particular user
    """
    org = make_org_with_credentials(credentials=ostree_user_credentials)
    product = make_product_with_credentials(
        {'organization-id': org['id']}, ostree_user_credentials
    )
    # Create new custom ostree repo
    ostree_repo = make_repository_with_credentials(
        {
            'product-id': product['id'],
            'content-type': 'ostree',
            'publish-via-http': 'false',
            'url': OSTREE_REPO,
        },
        ostree_user_credentials,
    )
    Repository.with_user(*ostree_user_credentials).synchronize({'id': ostree_repo['id']})
    cv = make_content_view(
        {'organization-id': org['id'], 'repository-ids': [ostree_repo['id']]},
        ostree_user_credentials,
    )
    ContentView.with_user(*ostree_user_credentials).publish({'id': cv['id']})
    cv = ContentView.with_user(*ostree_user_credentials).info({'id': cv['id']})
    return {'cv': cv, 'org': org, 'ostree_repo': ostree_repo, 'product': product}
コード例 #2
0
ファイル: test_ostreebranch.py プロジェクト: hkx303/robottelo
 def setUpClass(cls):
     """Create an organization, product and ostree repo."""
     super(OstreeBranchTestCase, cls).setUpClass()
     password = '******'
     cls.user = make_user({'admin': 'true', 'password': password})
     cls.user['password'] = password
     credentials = cls.get_user_credentials()
     cls.org = make_org_with_credentials(credentials=credentials)
     cls.product = make_product_with_credentials(
         {u'organization-id': cls.org['id']}, credentials)
     # Create new custom ostree repo
     cls.ostree_repo = make_repository_with_credentials(
         {
             u'product-id': cls.product['id'],
             u'content-type': u'ostree',
             u'publish-via-http': u'false',
             u'url': FEDORA27_OSTREE_REPO,
         }, credentials)
     Repository.with_user(*credentials).synchronize(
         {'id': cls.ostree_repo['id']})
     cls.cv = make_content_view(
         {
             u'organization-id': cls.org['id'],
             u'repository-ids': [cls.ostree_repo['id']],
         }, credentials)
     ContentView.with_user(*credentials).publish({u'id': cls.cv['id']})
     cls.cv = ContentView.with_user(*credentials).info(
         {u'id': cls.cv['id']})
コード例 #3
0
 def setUpClass(cls):
     """Create an organization, product and ostree repo."""
     super(OstreeBranchTestCase, cls).setUpClass()
     password = '******'
     cls.user = make_user({'admin': 'true', 'password': password})
     cls.user['password'] = password
     credentials = cls.get_user_credentials()
     cls.org = make_org_with_credentials(
         credentials=credentials)
     cls.product = make_product_with_credentials(
         {
             u'organization-id': cls.org['id']
         },
         credentials
     )
     # Create new custom ostree repo
     cls.ostree_repo = make_repository_with_credentials(
         {
             u'product-id': cls.product['id'],
             u'content-type': u'ostree',
             u'publish-via-http': u'false',
             u'url': FEDORA27_OSTREE_REPO,
         },
         credentials
     )
     Repository.with_user(*credentials).synchronize(
         {'id': cls.ostree_repo['id']})
     cls.cv = make_content_view(
         {
             u'organization-id': cls.org['id'],
             u'repository-ids': [cls.ostree_repo['id']],
         },
         credentials
     )
     ContentView.with_user(*credentials).publish({u'id': cls.cv['id']})
     cls.cv = ContentView.with_user(*credentials).info(
         {u'id': cls.cv['id']})