Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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}')
Ejemplo n.º 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']})
Ejemplo n.º 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']})
Ejemplo n.º 8
0
    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()
Ejemplo n.º 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'])
Ejemplo n.º 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'])
Ejemplo n.º 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']})
Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 14
0
    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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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']})
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 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']
Ejemplo n.º 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")
Ejemplo n.º 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})
Ejemplo n.º 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)
Ejemplo n.º 25
0
    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)
Ejemplo n.º 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']})
Ejemplo n.º 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']})
Ejemplo n.º 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()
Ejemplo n.º 29
0
    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)
Ejemplo n.º 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']})
Ejemplo n.º 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']})
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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"
            )
Ejemplo n.º 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}
            )
Ejemplo n.º 36
0
    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)
Ejemplo n.º 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}
            )
Ejemplo n.º 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)
Ejemplo n.º 39
0
    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)
Ejemplo n.º 40
0
    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)
Ejemplo n.º 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}
            )
Ejemplo n.º 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'])
Ejemplo n.º 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'])
Ejemplo n.º 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)
Ejemplo n.º 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'])
Ejemplo n.º 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'])
Ejemplo n.º 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'])
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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'])
Ejemplo n.º 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()