Test #5180
closedTest scenario for filtering fields with created_resources
Description
The pull request https://github.com/pulp/pulpcore/pull/228 fixes the issue which prevents users to fetch references to newly created resources while requesting only one field within a filter - created_resources.
A following test scenario may be used for testing:
1. Run the script 2 times in order to create two different tasks in a database:
BASE_ADDR=http://localhost:24817
http POST $BASE_ADDR/pulp/api/v3/remotes/rpm/rpm/ name='epel7-x86_64' url='https://dl.fedoraproject.org/pub/epel/7/x86_64/' policy='immediate'
http POST $BASE_ADDR/pulp/api/v3/repositories/ name='epel7-x86_64'
export REMOTE_HREF=$(http $BASE_ADDR/pulp/api/v3/remotes/rpm/rpm/ | jq -r '.results[] | select(.name == "epel7-x86_64") | ._href')
export REPO_HREF=$(http $BASE_ADDR/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "epel7-x86_64") | ._href')
http POST $BASE_ADDR${REMOTE_HREF}sync/ repository=$REPO_HREF
2. Wait until the tasks are successfully completed and a reference to a corresponding created resource is updated:
3. Build a request which will filter out all fields except created_resources:
http http://localhost:24817/pulp/api/v3/tasks/?fields=created_resources
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"created_resources": [
"/pulp/api/v3/repositories/e8251e9c-ef26-4dbe-a6fc-2b40c186d464/versions/2/"
]
},
{
"created_resources": [
"/pulp/api/v3/repositories/e8251e9c-ef26-4dbe-a6fc-2b40c186d464/versions/1/"
]
}
]
}
4. Check if correct repository versions were returned in the response.
Related issues
Updated by lmjachky over 5 years ago
- Status changed from NEW to POST
- Assignee set to lmjachky
Added by Lubos Mjachky over 5 years ago
Updated by Anonymous over 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp:pulpcore|36f6375d51f6ba9115df148c8c8bbb974b2d2bec.
Updated by kersom over 5 years ago
- Related to Issue #4722: Using the "fields=" feature has strange behavior with "created_resources" added
Updated by kersom about 5 years ago
- Status changed from MODIFIED to CLOSED - COMPLETE
Add test for filtering created_resources field
closes #5180 https://pulp.plan.io/issues/5180