示例#1
0
    def test_negative_update_auth_url_too_long(self):
        """Update the original url for a repository to value which is too long

        @id: a703de60-8631-4e31-a9d9-e51804f27f03

        @Assert: Repository url not updated
        """
        new_repo = self._make_repository()
        # generate repo URLs with all invalid credentials
        auth_repos = [
            repo.format(cred['login'], cred['pass'])
            for cred in invalid_http_credentials()
            for repo in (FAKE_5_YUM_REPO, FAKE_7_PUPPET_REPO)
        ]

        for url in auth_repos:
            with self.subTest(url):
                with self.assertRaises(CLIReturnCodeError):
                    Repository.update({
                        u'id': new_repo['id'],
                        u'url': url,
                    })
                # Fetch it again
                result = Repository.info({'id': new_repo['id']})
                self.assertEqual(result['url'], new_repo['url'])
示例#2
0
    def test_negative_update_auth_url_too_long(self):
        """Update the original url for a repository to value which is too long

        @id: a703de60-8631-4e31-a9d9-e51804f27f03

        @Assert: Repository url not updated
        """
        new_repo = self._make_repository()
        # generate repo URLs with all invalid credentials
        auth_repos = [
            repo.format(cred['login'], cred['pass'])
            for cred in invalid_http_credentials()
            for repo in (FAKE_5_YUM_REPO, FAKE_7_PUPPET_REPO)
        ]

        for url in auth_repos:
            with self.subTest(url):
                with self.assertRaises(CLIReturnCodeError):
                    Repository.update({
                        u'id': new_repo['id'],
                        u'url': url,
                    })
                # Fetch it again
                result = Repository.info({'id': new_repo['id']})
                self.assertEqual(result['url'], new_repo['url'])
示例#3
0
    def test_negative_create_with_auth_url_too_long(self):
        """Verify that repository URL length is limited

        @id: 5aad4e9f-f7e1-497c-8e1f-55e07e38ee80

        @Assert: A repository is not created and error is raised.
        """
        for cred in invalid_http_credentials():
            with self.subTest(cred):
                url = FAKE_5_YUM_REPO.format(cred['login'], cred['pass'])
                with self.assertRaises(HTTPError):
                    entities.Repository(url=url).create()
    def test_negative_create_with_auth_url_too_long(self):
        """Verify that repository URL length is limited

        @Assert: A repository is not created and error is raised.

        @Feature: HTTP Authentication Repository
        """
        for cred in invalid_http_credentials():
            with self.subTest(cred):
                url = FAKE_5_YUM_REPO.format(cred['login'], cred['pass'])
                with self.assertRaises(HTTPError):
                    entities.Repository(url=url).create()
示例#5
0
    def test_negative_create_with_auth_url_too_long(self):
        """Verify that repository URL length is limited

        @id: de356c66-4237-4421-89e3-f4f8bbe6f526

        @Assert: Repository cannot be created
        """
        for cred in invalid_http_credentials():
            with self.subTest(cred):
                url = FAKE_5_YUM_REPO.format(cred['login'], cred['pass'])
                with self.assertRaises(CLIFactoryError):
                    self._make_repository({u'url': url})
示例#6
0
    def test_negative_create_with_auth_url_too_long(self):
        """Verify that repository URL length is limited

        @Assert: A repository is not created and error is raised.

        @Feature: HTTP Authentication Repository
        """
        for cred in invalid_http_credentials():
            with self.subTest(cred):
                url = FAKE_5_YUM_REPO.format(cred['login'], cred['pass'])
                with self.assertRaises(HTTPError):
                    entities.Repository(url=url).create()
示例#7
0
    def test_negative_create_with_auth_url_too_long(self):
        """Verify that repository URL length is limited

        @id: 5aad4e9f-f7e1-497c-8e1f-55e07e38ee80

        @Assert: A repository is not created and error is raised.
        """
        for cred in invalid_http_credentials():
            with self.subTest(cred):
                url = FAKE_5_YUM_REPO.format(cred['login'], cred['pass'])
                with self.assertRaises(HTTPError):
                    entities.Repository(url=url).create()
示例#8
0
    def test_negative_create_with_auth_url_too_long(self):
        """Verify that repository URL length is limited

        @id: de356c66-4237-4421-89e3-f4f8bbe6f526

        @Assert: Repository cannot be created
        """
        for cred in invalid_http_credentials():
            with self.subTest(cred):
                url = FAKE_5_YUM_REPO.format(cred['login'], cred['pass'])
                with self.assertRaises(CLIFactoryError):
                    self._make_repository({u'url': url})
示例#9
0
    def test_negative_update_auth_url_too_long(self):
        """Update the original url for a repository to value which is too long

        @id: cc00fbf4-d284-4404-88d9-ea0c0f03abe1

        @Assert: Repository url not updated
        """
        new_repo = entities.Repository(product=self.product).create()
        # get auth repos with credentials containing unquoted special chars
        auth_repos = [
            repo.format(cred['login'], cred['pass'])
            for cred in invalid_http_credentials()
            for repo in (FAKE_5_YUM_REPO, FAKE_7_PUPPET_REPO)
        ]

        for url in auth_repos:
            with self.subTest(url):
                new_repo.url = url
                with self.assertRaises(HTTPError):
                    new_repo = new_repo.update()
    def test_negative_update_auth_url_too_long(self):
        """Update the original url for a repository to value which is too long

        @Assert: Repository url not updated

        @Feature: HTTP Authentication Repository
        """
        new_repo = entities.Repository(product=self.product).create()
        # get auth repos with credentials containing unquoted special chars
        auth_repos = [
            repo.format(cred['login'], cred['pass'])
            for cred in invalid_http_credentials()
            for repo in (FAKE_5_YUM_REPO, FAKE_7_PUPPET_REPO)
        ]

        for url in auth_repos:
            with self.subTest(url):
                new_repo.url = url
                with self.assertRaises(HTTPError):
                    new_repo = new_repo.update()