Exemplo n.º 1
0
    def test_sync_signatures_only(self):
        """Test that only collections with a signatures are synced when specified."""
        body = gen_ansible_remote(self.distro2.client_url, signed_only=True)
        remote = self.remote_collection_api.create(body)
        self.addCleanup(self.remote_collection_api.delete, remote.pulp_href)
        repo = self._create_repo_and_sync_with_remote(remote)

        content_response = get_content(repo.to_dict())
        self.assertEqual(len(content_response["ansible.collection_version"]), 2)
        self.assertEqual(len(content_response["ansible.collection_signature"]), 2)
Exemplo n.º 2
0
    def test_sync_signatures(self):
        """Test that signatures are also synced."""
        body = gen_ansible_remote(self.distro1.client_url)
        remote = self.remote_collection_api.create(body)
        self.addCleanup(self.remote_collection_api.delete, remote.pulp_href)
        repo = self._create_repo_and_sync_with_remote(remote)

        content_response = get_content(repo.to_dict())
        self.assertEqual(len(content_response["ansible.collection_version"]), 4)
        self.assertEqual(len(content_response["ansible.collection_signature"]), 4)
Exemplo n.º 3
0
    def test_01_create_signed_collections(self):
        """Test collection signatures can be created through the sign task."""
        repo = self.repo_api.create(gen_repo())
        body = {"add_content_units": self.collections}
        monitor_task(self.repo_api.modify(repo.pulp_href, body).task)

        body = {"content_units": self.collections, "signing_service": self.sign_service.pulp_href}
        monitor_task(self.repo_api.sign(repo.pulp_href, body).task)
        repo = self.repo_api.read(repo.pulp_href)
        self.repo.update(repo.to_dict())

        self.assertEqual(int(repo.latest_version_href[-2]), 2)
        content_response = get_content(self.repo)
        self.assertIn("ansible.collection_signature", content_response)
        self.assertEqual(len(content_response["ansible.collection_signature"]), 4)
        self.signed_collections.extend(content_response["ansible.collection_signature"])