def test_positive_update_url(self):
        """Proxy url update

        @id: 0305fd54-4e0c-4dd9-a537-d342c3dc867e

        @Assert: Proxy has the url updated
        """
        # Create fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = entities.SmartProxy(url=url).create()
        # Open another tunnel to update url
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy.url = url
            proxy = proxy.update(['url'])
            self.assertEqual(proxy.url, url)
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
    def test_positive_update_url(self):
        """Proxy url update

        :id: 0305fd54-4e0c-4dd9-a537-d342c3dc867e

        :expectedresults: Proxy has the url updated

        :CaseImportance: Critical
        """
        # Create fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._create_smart_proxy(url=url)
        # Open another tunnel to update url
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy.url = url
            proxy = proxy.update(['url'])
            self.assertEqual(proxy.url, url)
Beispiel #3
0
    def test_positive_update_url(self):
        """Proxy url update

        :id: 0305fd54-4e0c-4dd9-a537-d342c3dc867e

        :expectedresults: Proxy has the url updated

        :CaseImportance: Critical
        """
        # Create fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._create_smart_proxy(url=url)
        # Open another tunnel to update url
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy.url = url
            proxy = proxy.update(['url'])
            self.assertEqual(proxy.url, url)
Beispiel #4
0
def test_positive_update_url(request):
    """Proxy url update

    :id: 0305fd54-4e0c-4dd9-a537-d342c3dc867e

    :expectedresults: Proxy has the url updated

    :CaseLevel: Component

    """
    # Create fake capsule
    port = get_available_capsule_port()
    with default_url_on_new_port(9090, port) as url:
        proxy = _create_smart_proxy(request, url=url)
    # Open another tunnel to update url
    new_port = get_available_capsule_port()
    with default_url_on_new_port(9090, new_port) as url:
        proxy.url = url
        proxy = proxy.update(['url'])
        assert proxy.url == url
Beispiel #5
0
def module_fake_proxy(request, default_sat):
    """Create a Proxy and register the cleanup function"""
    args = {'name': gen_string(str_type='alpha')}
    newport = get_available_capsule_port()
    try:
        with default_url_on_new_port(9090, newport) as url:
            args['url'] = url
            proxy = default_sat.api.SmartProxy(**args).create()
            yield proxy
            capsule_cleanup(proxy.id)
    except CapsuleTunnelError as err:
        pytest.fail(f'Failed to create ssh tunnel: {err}')
Beispiel #6
0
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        :id: 42e3a9c0-62e1-4049-9667-f3c0cdfe0b04

        :expectedresults: Puppet classes are imported from proxy

        :CaseImportance: Critical
        """
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._make_proxy({u'url': url})
            Proxy.import_classes({u'id': proxy['id']})
Beispiel #7
0
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        :id: 42e3a9c0-62e1-4049-9667-f3c0cdfe0b04

        :expectedresults: Puppet classes are imported from proxy

        :CaseImportance: Critical
        """
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._make_proxy({u'url': url})
            Proxy.import_classes({u'id': proxy['id']})
    def test_positive_delete(self):
        """Proxy deletion

        @id: 872bf12e-736d-43d1-87cf-2923966b59d0

        @Assert: Proxy is deleted
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            proxy.delete()
        with self.assertRaises(HTTPError):
            proxy.read()
Beispiel #9
0
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        @id: 42e3a9c0-62e1-4049-9667-f3c0cdfe0b04

        @Assert: Puppet classes are imported from proxy
        """
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port):
            url = u'https://{0}:{1}'.format(settings.server.hostname, port)
            proxy = make_proxy({u'url': url})
            Proxy.importclasses({u'id': proxy['id']})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #10
0
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        @id: 42e3a9c0-62e1-4049-9667-f3c0cdfe0b04

        @Assert: Puppet classes are imported from proxy
        """
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port):
            url = u'https://{0}:{1}'.format(settings.server.hostname, port)
            proxy = make_proxy({u'url': url})
            Proxy.importclasses({u'id': proxy['id']})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #11
0
def test_positive_import_puppet_classes(request):
    """Import puppet classes from proxy

    :id: 42e3a9c0-62e1-4049-9667-f3c0cdfe0b04

    :expectedresults: Puppet classes are imported from proxy

    :CaseLevel: Component

    """
    port = get_available_capsule_port()
    with default_url_on_new_port(9090, port) as url:
        proxy = _make_proxy(request, {'url': url})
        Proxy.import_classes({'id': proxy['id']})
Beispiel #12
0
    def test_positive_create_with_name(self):
        """Proxy creation with valid name

        :id: 0ffe0dc5-675e-45f4-b7e1-a14d3dd81f6e

        :expectedresults: Proxy is created

        :CaseImportance: Critical
        """
        for name in valid_data_list():
            with self.subTest(name):
                new_port = get_available_capsule_port()
                with default_url_on_new_port(9090, new_port) as url:
                    proxy = self._create_smart_proxy(name=name, url=url)
                    self.assertEquals(proxy.name, name)
Beispiel #13
0
    def test_positive_delete(self):
        """Proxy deletion

        :id: 872bf12e-736d-43d1-87cf-2923966b59d0

        :expectedresults: Proxy is deleted

        :CaseImportance: Critical
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            proxy.delete()
        with self.assertRaises(HTTPError):
            proxy.read()
    def test_positive_create_with_name(self):
        """Proxy creation with valid name

        @id: 0ffe0dc5-675e-45f4-b7e1-a14d3dd81f6e

        @Assert: Proxy is created
        """
        for name in valid_data_list():
            with self.subTest(name):
                new_port = get_available_capsule_port()
                with default_url_on_new_port(9090, new_port) as url:
                    proxy = entities.SmartProxy(name=name, url=url).create()
                    self.assertEquals(proxy.name, name)
                # Add capsule id to cleanup list
                self.addCleanup(capsule_cleanup, proxy.id)
Beispiel #15
0
    def test_positive_create_with_name(self):
        """Proxy creation with valid name

        :id: 0ffe0dc5-675e-45f4-b7e1-a14d3dd81f6e

        :expectedresults: Proxy is created

        :CaseImportance: Critical
        """
        for name in valid_data_list():
            with self.subTest(name):
                new_port = get_available_capsule_port()
                with default_url_on_new_port(9090, new_port) as url:
                    proxy = self._create_smart_proxy(name=name, url=url)
                    self.assertEquals(proxy.name, name)
Beispiel #16
0
def test_positive_create_with_name(request, name):
    """Proxy creation with valid name

    :id: 0ffe0dc5-675e-45f4-b7e1-a14d3dd81f6e

    :expectedresults: Proxy is created

    :CaseLevel: Component

    :Parametrized: Yes

    """
    new_port = get_available_capsule_port()
    with default_url_on_new_port(9090, new_port) as url:
        proxy = _create_smart_proxy(request, name=name, url=url)
        assert proxy.name == name
Beispiel #17
0
def test_positive_import_puppet_classes(session_puppet_enabled_sat, puppet_proxy_port_range):
    """Import puppet classes from proxy

    :id: 42e3a9c0-62e1-4049-9667-f3c0cdfe0b04

    :expectedresults: Puppet classes are imported from proxy

    :CaseLevel: Component

    """
    with session_puppet_enabled_sat:
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = make_proxy({'url': url})
            Proxy.import_classes({'id': proxy['id']})
        Proxy.delete({'id': proxy['id']})
Beispiel #18
0
    def test_positive_update_name(self):
        """Proxy name update

        :id: f279640e-d7e9-48a3-aed8-7bf406e9d6f2

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            for new_name in valid_data_list():
                with self.subTest(new_name):
                    proxy.name = new_name
                    proxy = proxy.update(['name'])
                    self.assertEqual(proxy.name, new_name)
Beispiel #19
0
def test_positive_update_name(request):
    """Proxy name update

    :id: f279640e-d7e9-48a3-aed8-7bf406e9d6f2

    :expectedresults: Proxy has the name updated

    :CaseLevel: Component

    """
    new_port = get_available_capsule_port()
    with default_url_on_new_port(9090, new_port) as url:
        proxy = _create_smart_proxy(request, url=url)
        for new_name in valid_data_list():
            proxy.name = new_name
            proxy = proxy.update(['name'])
            assert proxy.name == new_name
Beispiel #20
0
def test_positive_delete():
    """Proxy deletion

    :id: 872bf12e-736d-43d1-87cf-2923966b59d0

    :expectedresults: Proxy is deleted

    :CaseLevel: Component

    :BZ: 1398695
    """
    new_port = get_available_capsule_port()
    with default_url_on_new_port(9090, new_port) as url:
        proxy = entities.SmartProxy(url=url).create()
        proxy.delete()
    with pytest.raises(HTTPError):
        proxy.read()
Beispiel #21
0
def test_positive_import_puppet_classes(request):
    """Import puppet classes from proxy

    :id: 385efd1b-6146-47bf-babf-0127ce5955ed

    :expectedresults: Puppet classes are imported from proxy

    :CaseLevel: Integration

    :BZ: 1398695
    """
    new_port = get_available_capsule_port()
    with default_url_on_new_port(9090, new_port) as url:
        proxy = _create_smart_proxy(request, url=url)
        result = proxy.import_puppetclasses()
        assert ("Successfully updated environment and puppetclasses from "
                "the on-disk puppet installation") in result['message']
Beispiel #22
0
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        :id: 385efd1b-6146-47bf-babf-0127ce5955ed

        :expectedresults: Puppet classes are imported from proxy

        :CaseImportance: Critical
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            result = proxy.import_puppetclasses()
            self.assertEqual(
                result['message'],
                "Successfully updated environment and puppetclasses from "
                "the on-disk puppet installation")
Beispiel #23
0
    def test_positive_update_location(self):
        """Proxy name update with the home proxy

        :id: e08eaaa9-7c11-4cda-bbe7-6d1f7c732569

        :expectedresults: Proxy has the name updated

        :CaseLevel: Component

        """
        locations = [entities.Location().create() for _ in range(2)]
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            proxy.location = locations
            proxy = proxy.update(['location'])
            self.assertEqual({loc.id for loc in proxy.location}, {loc.id for loc in locations})
Beispiel #24
0
    def test_positive_update_name(self):
        """Proxy name update

        :id: f279640e-d7e9-48a3-aed8-7bf406e9d6f2

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            for new_name in valid_data_list():
                with self.subTest(new_name):
                    proxy.name = new_name
                    proxy = proxy.update(['name'])
                    self.assertEqual(proxy.name, new_name)
    def test_positive_update_name(self):
        """Proxy name update

        @id: f279640e-d7e9-48a3-aed8-7bf406e9d6f2

        @Assert: Proxy has the name updated
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            for new_name in valid_data_list():
                with self.subTest(new_name):
                    proxy.name = new_name
                    proxy = proxy.update(['name'])
                    self.assertEqual(proxy.name, new_name)
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
Beispiel #26
0
    def test_positive_refresh_features_by_name(self):
        """Refresh smart proxy features, search for proxy by name

        :id: 2ddd0097-8f65-430e-963d-a3b5dcffe86b

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['name']})
Beispiel #27
0
    def test_positive_refresh_features_by_id(self):
        """Refresh smart proxy features, search for proxy by id

        :id: d3db63ce-b877-40eb-a863-294c12489ddd

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['id']})
Beispiel #28
0
    def test_positive_refresh_features(self):
        """Refresh smart proxy features, search for proxy by id

        :id: d0237546-702e-4d1a-9212-8391295174da

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            proxy.refresh()
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        @id: 385efd1b-6146-47bf-babf-0127ce5955ed

        @Assert: Puppet classes are imported from proxy
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            result = proxy.import_puppetclasses()
            self.assertEqual(
                result.message,
                "Successfully updated environment and puppetclasses from "
                "the on-disk puppet installation"
            )
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
Beispiel #30
0
    def test_positive_refresh_features_by_id(self):
        """Refresh smart proxy features, search for proxy by id

        :id: d3db63ce-b877-40eb-a863-294c12489ddd

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['id']})
Beispiel #31
0
    def test_positive_refresh_features_by_name(self):
        """Refresh smart proxy features, search for proxy by name

        :id: 2ddd0097-8f65-430e-963d-a3b5dcffe86b

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port) as url:
            proxy = self._make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['name']})
Beispiel #32
0
    def test_positive_refresh_features(self):
        """Refresh smart proxy features, search for proxy by id

        :id: d0237546-702e-4d1a-9212-8391295174da

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            proxy.refresh()
Beispiel #33
0
def test_positive_update_name(request):
    """Proxy name update with the home proxy

    :id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316

    :expectedresults: Proxy has the name updated

    :CaseLevel: Component

    :BZ: 1398695
    """
    proxy = _make_proxy(request, {'name': gen_alphanumeric()})
    for new_name in valid_data_list().values():
        newport = get_available_capsule_port()
        with default_url_on_new_port(9090, newport) as url:
            Proxy.update({'id': proxy['id'], 'name': new_name, 'url': url})
            proxy = Proxy.info({'id': proxy['id']})
            assert proxy['name'] == new_name
Beispiel #34
0
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        :id: 385efd1b-6146-47bf-babf-0127ce5955ed

        :expectedresults: Puppet classes are imported from proxy

        :CaseImportance: Critical
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            result = proxy.import_puppetclasses()
            self.assertEqual(
                result['message'],
                "Successfully updated environment and puppetclasses from "
                "the on-disk puppet installation"
            )
Beispiel #35
0
    def test_positive_update_organization(self):
        """Proxy name update with the home proxy

        :id: 62631275-7a92-4d34-a949-c56e0c4063f1

        :expectedresults: Proxy has the name updated

        :CaseLevel: Component

        """
        organizations = [entities.Organization().create() for _ in range(2)]
        newport = get_available_capsule_port()
        with default_url_on_new_port(9090, newport) as url:
            proxy = self._create_smart_proxy(url=url)
            proxy.organization = organizations
            proxy = proxy.update(['organization'])
            self.assertEqual(
                {org.id for org in proxy.organization}, {org.id for org in organizations}
            )
    def test_positive_update_location(self):
        """Proxy name update with the home proxy

        @id: e08eaaa9-7c11-4cda-bbe7-6d1f7c732569

        @Assert: Proxy has the name updated
        """
        locations = [entities.Location().create() for _ in range(2)]
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            proxy.location = locations
            proxy = proxy.update(['location'])
            self.assertEqual(
                {loc.id for loc in proxy.location},
                {loc.id for loc in locations}
            )
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
Beispiel #37
0
    def test_positive_update_location(self):
        """Proxy name update with the home proxy

        :id: e08eaaa9-7c11-4cda-bbe7-6d1f7c732569

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        locations = [entities.Location().create() for _ in range(2)]
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = self._create_smart_proxy(url=url)
            proxy.location = locations
            proxy = proxy.update(['location'])
            self.assertEqual(
                {loc.id for loc in proxy.location},
                {loc.id for loc in locations}
            )
Beispiel #38
0
    def test_positive_import_puppet_classes(self):
        """Import puppet classes from proxy

        :id: 385efd1b-6146-47bf-babf-0127ce5955ed

        :expectedresults: Puppet classes are imported from proxy

        :CaseImportance: Critical
        """
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            result = proxy.import_puppetclasses()
            self.assertEqual(
                result.message,
                "Successfully updated environment and puppetclasses from "
                "the on-disk puppet installation")
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
    def test_positive_refresh_features(self):
        """Refresh smart proxy features, search for proxy by id

        @id: d0237546-702e-4d1a-9212-8391295174da

        @Assert: Proxy features are refreshed

        @CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            proxy.refresh()
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
    def test_positive_update_organization(self):
        """Proxy name update with the home proxy

        @id: 62631275-7a92-4d34-a949-c56e0c4063f1

        @Assert: Proxy has the name updated
        """
        organizations = [
            entities.Organization().create() for _ in range(2)]
        newport = get_available_capsule_port()
        with default_url_on_new_port(9090, newport) as url:
            proxy = entities.SmartProxy(url=url).create()
            proxy.organization = organizations
            proxy = proxy.update(['organization'])
            self.assertEqual(
                {org.id for org in proxy.organization},
                {org.id for org in organizations}
            )
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
Beispiel #41
0
    def test_positive_update_organization(self):
        """Proxy name update with the home proxy

        :id: 62631275-7a92-4d34-a949-c56e0c4063f1

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        organizations = [
            entities.Organization().create() for _ in range(2)]
        newport = get_available_capsule_port()
        with default_url_on_new_port(9090, newport) as url:
            proxy = self._create_smart_proxy(url=url)
            proxy.organization = organizations
            proxy = proxy.update(['organization'])
            self.assertEqual(
                {org.id for org in proxy.organization},
                {org.id for org in organizations}
            )
Beispiel #42
0
    def test_positive_refresh_features_by_name(self):
        """Refresh smart proxy features, search for proxy by name

        @id: 2ddd0097-8f65-430e-963d-a3b5dcffe86b

        @Assert: Proxy features are refreshed

        @CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port):
            url = u'https://{0}:{1}'.format(settings.server.hostname, port)
            proxy = make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['name']})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #43
0
    def test_positive_refresh_features_by_id(self):
        """Refresh smart proxy features, search for proxy by id

        :id: d3db63ce-b877-40eb-a863-294c12489ddd

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port):
            url = u'https://{0}:{1}'.format(settings.server.hostname, port)
            proxy = make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['id']})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #44
0
    def test_positive_update_location(self):
        """Proxy name update with the home proxy

        :id: e08eaaa9-7c11-4cda-bbe7-6d1f7c732569

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        locations = [entities.Location().create() for _ in range(2)]
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            proxy.location = locations
            proxy = proxy.update(['location'])
            self.assertEqual({loc.id
                              for loc in proxy.location},
                             {loc.id
                              for loc in locations})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
Beispiel #45
0
    def test_positive_update_name(self):
        """Proxy name update with the home proxy

        @id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316

        @Assert: Proxy has the name updated
        """
        proxy = make_proxy({u'name': gen_alphanumeric()})
        for new_name in valid_data_list():
            with self.subTest(new_name):
                newport = get_available_capsule_port()
                with default_url_on_new_port(9090, newport) as url:
                    Proxy.update({
                        u'id': proxy['id'],
                        u'name': new_name,
                        u'url': url,
                    })
                    proxy = Proxy.info({u'id': proxy['id']})
                    self.assertEqual(proxy['name'], new_name)
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #46
0
    def test_positive_refresh_features_by_name(self):
        """Refresh smart proxy features, search for proxy by name

        @id: 2ddd0097-8f65-430e-963d-a3b5dcffe86b

        @Assert: Proxy features are refreshed

        @CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port):
            url = u'https://{0}:{1}'.format(settings.server.hostname, port)
            proxy = make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['name']})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #47
0
    def test_positive_update_name(self):
        """Proxy name update with the home proxy

        @id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316

        @Assert: Proxy has the name updated
        """
        proxy = make_proxy({u'name': gen_alphanumeric()})
        for new_name in valid_data_list():
            with self.subTest(new_name):
                newport = get_available_capsule_port()
                with default_url_on_new_port(9090, newport) as url:
                    Proxy.update({
                        u'id': proxy['id'],
                        u'name': new_name,
                        u'url': url,
                    })
                    proxy = Proxy.info({u'id': proxy['id']})
                    self.assertEqual(proxy['name'], new_name)
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #48
0
    def test_positive_update_organization(self):
        """Proxy name update with the home proxy

        :id: 62631275-7a92-4d34-a949-c56e0c4063f1

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        organizations = [entities.Organization().create() for _ in range(2)]
        newport = get_available_capsule_port()
        with default_url_on_new_port(9090, newport) as url:
            proxy = entities.SmartProxy(url=url).create()
            proxy.organization = organizations
            proxy = proxy.update(['organization'])
            self.assertEqual({org.id
                              for org in proxy.organization},
                             {org.id
                              for org in organizations})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy.id)
Beispiel #49
0
    def test_positive_update_name(self):
        """Proxy name update with the home proxy

        :id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        proxy = self._make_proxy({u'name': gen_alphanumeric()})
        for new_name in valid_data_list():
            with self.subTest(new_name):
                newport = get_available_capsule_port()
                with default_url_on_new_port(9090, newport) as url:
                    Proxy.update({
                        u'id': proxy['id'],
                        u'name': new_name,
                        u'url': url,
                    })
                    proxy = Proxy.info({u'id': proxy['id']})
                    self.assertEqual(proxy['name'], new_name)
Beispiel #50
0
    def test_positive_update_name(self):
        """Proxy name update with the home proxy

        :id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316

        :expectedresults: Proxy has the name updated

        :CaseImportance: Critical
        """
        proxy = self._make_proxy({u'name': gen_alphanumeric()})
        for new_name in valid_data_list():
            with self.subTest(new_name):
                newport = get_available_capsule_port()
                with default_url_on_new_port(9090, newport) as url:
                    Proxy.update({
                        u'id': proxy['id'],
                        u'name': new_name,
                        u'url': url,
                    })
                    proxy = Proxy.info({u'id': proxy['id']})
                    self.assertEqual(proxy['name'], new_name)
Beispiel #51
0
    def test_positive_refresh_features_by_id(self):
        """Refresh smart proxy features, search for proxy by id

        :id: d3db63ce-b877-40eb-a863-294c12489ddd

        :expectedresults: Proxy features are refreshed

        :CaseLevel: Integration
        """
        # Since we want to run multiple commands against our fake capsule, we
        # need the tunnel kept open in order not to allow different concurrent
        # test to claim it. Thus we want to manage the tunnel manually.

        # get an available port for our fake capsule
        port = get_available_capsule_port()
        with default_url_on_new_port(9090, port):
            url = u'https://{0}:{1}'.format(settings.server.hostname, port)
            proxy = make_proxy({u'url': url})
            Proxy.refresh_features({u'id': proxy['id']})
        # Add capsule id to cleanup list
        self.addCleanup(capsule_cleanup, proxy['id'])
Beispiel #52
0
def test_positive_import_puppet_classes(session_puppet_enabled_sat,
                                        puppet_proxy_port_range):
    """Import puppet classes from proxy

    :id: 385efd1b-6146-47bf-babf-0127ce5955ed

    :expectedresults: Puppet classes are imported from proxy

    :CaseLevel: Integration

    :BZ: 1398695
    """
    with session_puppet_enabled_sat:
        new_port = get_available_capsule_port()
        with default_url_on_new_port(9090, new_port) as url:
            proxy = entities.SmartProxy(url=url).create()
            result = proxy.import_puppetclasses()
            assert (
                "Successfully updated environment and puppetclasses from "
                "the on-disk puppet installation"
            ) in result[
                'message'] or "No changes to your environments detected" in result[
                    'message']
        entities.SmartProxy(id=proxy.id).delete()